Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 982-999 (lines=18) @@
979
    /**
980
     * @group DDC-1657
981
     */
982
    public function testAutoIncrementSequences()
983
    {
984
        $oldSchema = new Schema();
985
        $table     = $oldSchema->createTable("foo");
986
        $table->addColumn("id", "integer", array("autoincrement" => true));
987
        $table->setPrimaryKey(array("id"));
988
        $oldSchema->createSequence("foo_id_seq");
989
990
        $newSchema = new Schema();
991
        $table     = $newSchema->createTable("foo");
992
        $table->addColumn("id", "integer", array("autoincrement" => true));
993
        $table->setPrimaryKey(array("id"));
994
995
        $c    = new Comparator();
996
        $diff = $c->compare($oldSchema, $newSchema);
997
998
        self::assertCount(0, $diff->removedSequences);
999
    }
1000
1001
1002
    /**
@@ 1006-1023 (lines=18) @@
1003
     * Check that added autoincrement sequence is not populated in newSequences
1004
     * @group DBAL-562
1005
     */
1006
    public function testAutoIncrementNoSequences()
1007
    {
1008
        $oldSchema = new Schema();
1009
        $table     = $oldSchema->createTable("foo");
1010
        $table->addColumn("id", "integer", array("autoincrement" => true));
1011
        $table->setPrimaryKey(array("id"));
1012
1013
        $newSchema = new Schema();
1014
        $table     = $newSchema->createTable("foo");
1015
        $table->addColumn("id", "integer", array("autoincrement" => true));
1016
        $table->setPrimaryKey(array("id"));
1017
        $newSchema->createSequence("foo_id_seq");
1018
1019
        $c    = new Comparator();
1020
        $diff = $c->compare($oldSchema, $newSchema);
1021
1022
        self::assertCount(0, $diff->newSequences);
1023
    }
1024
    /**
1025
     * You can get multiple drops for a FK when a table referenced by a foreign
1026
     * key is deleted, as this FK is referenced twice, once on the orphanedForeignKeys