Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 929-946 (lines=18) @@
926
    /**
927
     * @group DDC-1657
928
     */
929
    public function testAutoIncrementSequences()
930
    {
931
        $oldSchema = new Schema();
932
        $table = $oldSchema->createTable("foo");
933
        $table->addColumn("id", "integer", array("autoincrement" => true));
934
        $table->setPrimaryKey(array("id"));
935
        $oldSchema->createSequence("foo_id_seq");
936
937
        $newSchema = new Schema();
938
        $table = $newSchema->createTable("foo");
939
        $table->addColumn("id", "integer", array("autoincrement" => true));
940
        $table->setPrimaryKey(array("id"));
941
942
        $c = new Comparator();
943
        $diff = $c->compare($oldSchema, $newSchema);
944
945
        self::assertCount(0, $diff->removedSequences);
946
    }
947
948
949
    /**
@@ 953-970 (lines=18) @@
950
     * Check that added autoincrement sequence is not populated in newSequences
951
     * @group DBAL-562
952
     */
953
    public function testAutoIncrementNoSequences()
954
    {
955
        $oldSchema = new Schema();
956
        $table = $oldSchema->createTable("foo");
957
        $table->addColumn("id", "integer", array("autoincrement" => true));
958
        $table->setPrimaryKey(array("id"));
959
960
        $newSchema = new Schema();
961
        $table = $newSchema->createTable("foo");
962
        $table->addColumn("id", "integer", array("autoincrement" => true));
963
        $table->setPrimaryKey(array("id"));
964
        $newSchema->createSequence("foo_id_seq");
965
966
        $c = new Comparator();
967
        $diff = $c->compare($oldSchema, $newSchema);
968
969
        self::assertCount(0, $diff->newSequences);
970
    }
971
    /**
972
     * You can get multiple drops for a FK when a table referenced by a foreign
973
     * key is deleted, as this FK is referenced twice, once on the orphanedForeignKeys