function DatabaseTestCase::installTables

Set up several tables needed by a certain test.

Parameters

$schema: An array of table definitions to install.

6 calls to DatabaseTestCase::installTables()
DatabaseSelectComplexTestCase2::setUp in drupal-7.x/modules/simpletest/tests/database_test.test
Sets up a Drupal site for running functional and integration tests.
DatabaseSelectComplexTestCase2::setUp in drupal-7.x/modules/simpletest/tests/database_test.test
Sets up a Drupal site for running functional and integration tests.
DatabaseTestCase::ensureSampleDataNull in drupal-7.x/modules/simpletest/tests/database_test.test
Set up tables for NULL handling.
DatabaseTestCase::ensureSampleDataNull in drupal-7.x/modules/simpletest/tests/database_test.test
Set up tables for NULL handling.
DatabaseTestCase::setUp in drupal-7.x/modules/simpletest/tests/database_test.test
Sets up a Drupal site for running functional and integration tests.

... See full list

Archivo

drupal-7.x/modules/simpletest/tests/database_test.test, line 41

Class

DatabaseTestCase
Base test class for databases.

Código

function installTables($schema) {
  // This ends up being a test for table drop and create, too, which is nice.
  foreach ($schema as $name => $data) {
    if (db_table_exists($name)) {
      db_drop_table($name);
    }
    db_create_table($name, $data);
  }

  foreach ($schema as $name => $data) {
    $this->assertTrue(db_table_exists($name), format_string('Table @name created successfully.', array('@name' => $name)));
  }
}