Code Duplication    Length = 10-12 lines in 2 locations

tests/Doctrine/Tests/DBAL/Schema/TableTest.php 2 locations

@@ 780-789 (lines=10) @@
777
    /**
778
     * @group DBAL-2508
779
     */
780
    public function testKeepsIndexOptionsOnRenamingUniqueIndex() : void
781
    {
782
        $table = new Table('foo');
783
        $table->addColumn('id', 'integer');
784
        $table->addUniqueIndex(['id'], 'idx_bar', ['where' => '1 = 1']);
785
786
        $table->renameIndex('idx_bar', 'idx_baz');
787
788
        self::assertSame(['where' => '1 = 1'], $table->getIndex('idx_baz')->getOptions());
789
    }
790
791
    /**
792
     * @group DBAL-234
@@ 808-819 (lines=12) @@
805
    /**
806
     * @group DBAL-234
807
     */
808
    public function testThrowsExceptionOnRenamingToAlreadyExistingIndex() : void
809
    {
810
        $table = new Table('test');
811
        $table->addColumn('id', 'integer');
812
        $table->addColumn('foo', 'integer');
813
        $table->addIndex(['id'], 'idx_id');
814
        $table->addIndex(['foo'], 'idx_foo');
815
816
        $this->expectException(SchemaException::class);
817
818
        $table->renameIndex('idx_id', 'idx_foo');
819
    }
820
821
    /**
822
     * @dataProvider getNormalizesAssetNames