You are here

protected function TransactionTest::executeDDLStatement in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php \Drupal\KernelTests\Core\Database\TransactionTest::executeDDLStatement()
  2. 9 core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php \Drupal\KernelTests\Core\Database\TransactionTest::executeDDLStatement()

Executes a DDL statement.

File

core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php, line 291

Class

TransactionTest
Tests the transaction abstraction system.

Namespace

Drupal\KernelTests\Core\Database

Code

protected function executeDDLStatement() {
  static $count = 0;
  $table = [
    'fields' => [
      'id' => [
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
    ],
    'primary key' => [
      'id',
    ],
  ];
  $this->connection
    ->schema()
    ->createTable('database_test_' . ++$count, $table);
}