function DriverSpecificSchemaTestBase::testUpperCaseTableName

Same name and namespace in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php \Drupal\KernelTests\Core\Database\DriverSpecificSchemaTestBase::testUpperCaseTableName()

Tests handling of uppercase table names.

File

core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php, line 1126

Class

DriverSpecificSchemaTestBase
Tests table creation and modification via the schema API.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testUpperCaseTableName() : void {
    $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.