function NextIdTest::setUp

Same name in this branch
  1. 10 core/modules/mysql/tests/src/Kernel/mysql/NextIdTest.php \Drupal\Tests\mysql\Kernel\mysql\NextIdTest::setUp()
Same name in other branches
  1. 9 core/modules/mysql/tests/src/Kernel/mysql/NextIdTest.php \Drupal\Tests\mysql\Kernel\mysql\NextIdTest::setUp()
  2. 9 core/tests/Drupal/KernelTests/Core/Database/NextIdTest.php \Drupal\KernelTests\Core\Database\NextIdTest::setUp()
  3. 8.9.x core/tests/Drupal/KernelTests/Core/Database/NextIdTest.php \Drupal\KernelTests\Core\Database\NextIdTest::setUp()

Overrides DatabaseTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Database/NextIdTest.php, line 25

Class

NextIdTest
Tests the sequences API.

Namespace

Drupal\KernelTests\Core\Database

Code

protected function setUp() : void {
    parent::setUp();
    $table_specification = [
        'description' => 'Stores IDs.',
        'fields' => [
            'value' => [
                'description' => 'The value of the sequence.',
                'type' => 'serial',
                'unsigned' => TRUE,
                'not null' => TRUE,
            ],
        ],
        'primary key' => [
            'value',
        ],
    ];
    $this->connection
        ->schema()
        ->createTable('sequences', $table_specification);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.