function SchemaTest::testUpperCaseTableName

Tests handling of uppercase table names.

File

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

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');
}

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