You are here

public function UrlAliasFixtures::createTables in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Path/UrlAliasFixtures.php \Drupal\system\Tests\Path\UrlAliasFixtures::createTables()

Create the tables required for the sample data.

Parameters

\Drupal\Core\Database\Connection $connection: The connection to use to create the tables.

File

core/modules/system/src/Tests/Path/UrlAliasFixtures.php, line 23
Contains \Drupal\system\Tests\Path\UrlAliasFixtures.

Class

UrlAliasFixtures
Utility methods to generate sample data, database configuration, etc.

Namespace

Drupal\system\Tests\Path

Code

public function createTables(Connection $connection) {
  $tables = $this
    ->tableDefinition();
  $schema = $connection
    ->schema();
  foreach ($tables as $name => $table) {
    $schema
      ->dropTable($name);
    $schema
      ->createTable($name, $table);
  }
}