Skip to content

Commit 83144b1

Browse files
committed
Rebase and fix tests
1 parent 43e3354 commit 83144b1

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tests/Functional/Schema/SchemaManagerTest.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public function testIntrospectTableWithDotInName(): void
270270
public function testIntrospectTableWithDotInIndexNames(): void
271271
{
272272
$table = Table::editor()
273-
->setQuotedName('test_user')
273+
->setUnquotedName('test_user')
274274
->setColumns(
275275
Column::editor()
276276
->setUnquotedName('id')
@@ -308,21 +308,30 @@ public function testIntrospectTableWithDotInIndexNames(): void
308308
->setUnquotedReferencingColumnNames('user_id')
309309
->setUnquotedReferencedTableName('test_user')
310310
->setUnquotedReferencedColumnNames('id')
311-
->setQuotedName('fk.example.user_id')
311+
->setUnquotedName('fk.example.user_id')
312312
->create(),
313313
)
314314
->setIndexes(
315315
Index::editor()
316-
->setQuotedName('idx.example.id')
316+
->setUnquotedName('idx.example.id')
317317
->setUnquotedColumnNames('id', 'user_id')
318318
->create(),
319319
)
320320
->create();
321321
$this->dropAndCreateTable($tableTo);
322322

323-
$table = $this->schemaManager->introspectTable('example');
323+
$table = $this->schemaManager->introspectTableByUnquotedName('example');
324+
324325
self::assertCount(2, $table->getColumns());
325-
self::assertSame('fk.example.user_id', $table->getForeignKey('fk.example.user_id')->getName());
326-
self::assertSame('idx.example.id', $table->getIndex('idx.example.id')->getName());
326+
327+
self::assertUnqualifiedNameEquals(
328+
UnqualifiedName::unquoted('fk.example.user_id'),
329+
$table->getForeignKey('"fk.example.user_id"')->getObjectName(),
330+
);
331+
332+
self::assertUnqualifiedNameEquals(
333+
UnqualifiedName::unquoted('idx.example.id'),
334+
$table->getIndex('"idx.example.id"')->getObjectName(),
335+
);
327336
}
328337
}

0 commit comments

Comments
 (0)