You are here

public function SchemaTest::testUpperCaseTableName in Drupal 9

Tests handling of uppercase table names.

File

core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php, line 1259

Class

SchemaTest
Tests table creation and modification via the schema API.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testUpperCaseTableName() {
  $table_name = 'A_UPPER_CASE_TABLE_NAME';

  // Create the tables.
  $table_specification = [
    'description' => 'Test table.',
    'fields' => [
      'id' => [
        'type' => 'int',
        'default' => NULL,
      ],
    ],
  ];
  $this->schema
    ->createTable($table_name, $table_specification);
  $this
    ->assertTrue($this->schema
    ->tableExists($table_name), 'Table with uppercase table name exists');
  $this
    ->assertContains($table_name, $this->schema
    ->findTables('%'));
  $this
    ->assertTrue($this->schema
    ->dropTable($table_name), 'Table with uppercase table name dropped');
}