From 641264e0346e86d3018840e326ffeb347d3bcd3e Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Wed, 10 Aug 2022 10:51:17 -0700 Subject: [PATCH] Add a test for quoting table names in schema --- .../Schema/OracleSchemaManagerTest.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/Functional/Schema/OracleSchemaManagerTest.php b/tests/Functional/Schema/OracleSchemaManagerTest.php index 06243cee9a8..ffd45769174 100644 --- a/tests/Functional/Schema/OracleSchemaManagerTest.php +++ b/tests/Functional/Schema/OracleSchemaManagerTest.php @@ -264,4 +264,27 @@ public function testCreateAndListSequences(): void "Skipped for uppercase letters are contained in sequences' names. Fix the schema manager in 3.0." ); } + + public function testQuotedTableNameRemainsQuotedInSchema(): void + { + $table = new Table('"tester"'); + $table->addColumn('"id"', Types::INTEGER); + $table->addColumn('"name"', Types::STRING); + + $this->dropAndCreateTable($table); + + $schemaManager = $this->connection->createSchemaManager(); + + $fromSchema = $schemaManager->createSchema(); + $toSchema = clone $fromSchema; + + $toSchema->getTable('"tester"')->dropColumn('"name"'); + $diff = $schemaManager->createComparator() + ->compareSchemas($fromSchema, $toSchema); + + $schemaManager->alterSchema($diff); + + $columns = $schemaManager->listTableColumns('"tester"'); + self::assertCount(1, $columns); + } }