@@ -499,17 +499,10 @@ public function testListTableIndexes(): void
499499
500500 $ this ->dropAndCreateTable ($ table );
501501
502- $ this ->assertIndexListEquals ([
503- Index::editor ()
504- ->setUnquotedName ('test_index_name ' )
505- ->setUnquotedColumnNames ('test ' )
506- ->setType (IndexType::UNIQUE )
507- ->create (),
508- Index::editor ()
509- ->setUnquotedName ('test_composite_idx ' )
510- ->setUnquotedColumnNames ('id ' , 'test ' )
511- ->create (),
512- ], $ this ->schemaManager ->introspectTableIndexesByUnquotedName ('list_table_indexes_test ' ));
502+ $ this ->assertIndexListContainsAll (
503+ $ table ->getIndexes (),
504+ $ this ->schemaManager ->introspectTableIndexesByUnquotedName ('list_table_indexes_test ' ),
505+ );
513506 }
514507
515508 public function testDropAndCreateIndex (): void
@@ -540,13 +533,10 @@ public function testDropAndCreateIndex(): void
540533 $ table ->getObjectName ()->toSQL ($ platform ),
541534 );
542535
543- $ this ->assertIndexListEquals ([
544- Index::editor ()
545- ->setUnquotedName ('test ' )
546- ->setUnquotedColumnNames ('test ' )
547- ->setType (IndexType::UNIQUE )
548- ->create (),
549- ], $ this ->schemaManager ->introspectTableIndexesByUnquotedName ('test_create_index ' ));
536+ $ this ->assertIndexListContainsAll (
537+ $ table ->getIndexes (),
538+ $ this ->schemaManager ->introspectTableIndexesByUnquotedName ('test_create_index ' ),
539+ );
550540 }
551541
552542 public function testDropAndCreateUniqueConstraint (): void
@@ -677,8 +667,6 @@ public function testAlterTableScenario(): void
677667 self ::assertTrue ($ table ->hasColumn ('test ' ));
678668 self ::assertTrue ($ table ->hasColumn ('foreign_key_test ' ));
679669 self ::assertCount (0 , $ table ->getForeignKeys ());
680- self ::assertCount (0 , $ table ->getIndexes ());
681-
682670 $ newTable = $ table ->edit ()
683671 ->addColumn (
684672 Column::editor ()
@@ -713,9 +701,6 @@ public function testAlterTableScenario(): void
713701 $ this ->schemaManager ->alterTable ($ diff );
714702
715703 $ table = $ this ->schemaManager ->introspectTableByUnquotedName ('alter_table ' );
716- self ::assertCount (1 , $ table ->getIndexes ());
717- self ::assertTrue ($ table ->hasIndex ('foo_idx ' ));
718-
719704 $ this ->assertIndexEquals (
720705 Index::editor ()
721706 ->setUnquotedName ('foo_idx ' )
@@ -739,9 +724,6 @@ public function testAlterTableScenario(): void
739724 $ this ->schemaManager ->alterTable ($ diff );
740725
741726 $ table = $ this ->schemaManager ->introspectTableByUnquotedName ('alter_table ' );
742- self ::assertCount (1 , $ table ->getIndexes ());
743- self ::assertTrue ($ table ->hasIndex ('foo_idx ' ));
744-
745727 $ this ->assertIndexEquals ($ fooIndex , $ table ->getIndex ('foo_idx ' ));
746728
747729 $ barIndex = Index::editor ()
@@ -759,11 +741,8 @@ public function testAlterTableScenario(): void
759741 $ this ->schemaManager ->alterTable ($ diff );
760742
761743 $ table = $ this ->schemaManager ->introspectTableByUnquotedName ('alter_table ' );
762- self ::assertCount (1 , $ table ->getIndexes ());
763- self ::assertTrue ($ table ->hasIndex ('bar_idx ' ));
764- self ::assertFalse ($ table ->hasIndex ('foo_idx ' ));
765-
766744 $ this ->assertIndexEquals ($ barIndex , $ table ->getIndex ('bar_idx ' ));
745+ self ::assertFalse ($ table ->hasIndex ('foo_idx ' ));
767746
768747 $ newTable = $ table ->edit ()
769748 ->dropIndexByUnquotedName ('bar_idx ' )
@@ -782,7 +761,6 @@ public function testAlterTableScenario(): void
782761
783762 $ table = $ this ->schemaManager ->introspectTableByUnquotedName ('alter_table ' );
784763
785- // don't check for index size here, some platforms automatically add indexes for foreign keys.
786764 self ::assertFalse ($ table ->hasIndex ('bar_idx ' ));
787765
788766 /** @var list<ForeignKeyConstraint> $fks */
@@ -1891,12 +1869,13 @@ public function testQuotedIdentifiers(): void
18911869 $ artists ->getColumn ('"Name" ' )->getObjectName (),
18921870 );
18931871
1894- $ this ->assertIndexListEquals ([
1872+ $ this ->assertIndexEquals (
18951873 Index::editor ()
18961874 ->setQuotedName ('Idx_Artist_Name ' )
18971875 ->setQuotedColumnNames ('Name ' )
18981876 ->create (),
1899- ], $ artists ->getIndexes ());
1877+ $ artists ->getIndex ('"Idx_Artist_Name" ' ),
1878+ );
19001879
19011880 $ primaryKey = $ artists ->getPrimaryKeyConstraint ();
19021881 self ::assertNotNull ($ primaryKey );
0 commit comments