function SchemaTest::testTableWithSpecificDataType

Same name in this branch
  1. 10 core/modules/mysql/tests/src/Kernel/mysql/SchemaTest.php \Drupal\Tests\mysql\Kernel\mysql\SchemaTest::testTableWithSpecificDataType()
  2. 10 core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php \Drupal\Tests\pgsql\Kernel\pgsql\SchemaTest::testTableWithSpecificDataType()
Same name and namespace in other branches
  1. 11.x core/modules/sqlite/tests/src/Kernel/sqlite/SchemaTest.php \Drupal\Tests\sqlite\Kernel\sqlite\SchemaTest::testTableWithSpecificDataType()
  2. 11.x core/modules/mysql/tests/src/Kernel/mysql/SchemaTest.php \Drupal\Tests\mysql\Kernel\mysql\SchemaTest::testTableWithSpecificDataType()
  3. 11.x core/modules/pgsql/tests/src/Kernel/pgsql/SchemaTest.php \Drupal\Tests\pgsql\Kernel\pgsql\SchemaTest::testTableWithSpecificDataType()

Tests creating a table with database specific data type.

Overrides DriverSpecificSchemaTestBase::testTableWithSpecificDataType

File

core/modules/sqlite/tests/src/Kernel/sqlite/SchemaTest.php, line 34

Class

SchemaTest
Tests schema API for the SQLite driver.

Namespace

Drupal\Tests\sqlite\Kernel\sqlite

Code

public function testTableWithSpecificDataType() : void {
  $table_specification = [
    'description' => 'Schema table description.',
    'fields' => [
      'timestamp' => [
        'sqlite_type' => 'datetime',
        'not null' => FALSE,
        'default' => NULL,
      ],
    ],
  ];
  $this->schema
    ->createTable('test_timestamp', $table_specification);
  $this->assertTrue($this->schema
    ->tableExists('test_timestamp'));
}

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