@@ 92-104 (lines=13) @@ | ||
89 | self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) ); |
|
90 | } |
|
91 | ||
92 | public function testCompareMissingTable() |
|
93 | { |
|
94 | $schemaConfig = new \Doctrine\DBAL\Schema\SchemaConfig; |
|
95 | $table = new Table('bugdb', array ('integerfield1' => new Column('integerfield1', Type::getType('integer')))); |
|
96 | $table->setSchemaConfig($schemaConfig); |
|
97 | ||
98 | $schema1 = new Schema( array($table), array(), $schemaConfig ); |
|
99 | $schema2 = new Schema( array(), array(), $schemaConfig ); |
|
100 | ||
101 | $expected = new SchemaDiff( array(), array(), array('bugdb' => $table), $schema1 ); |
|
102 | ||
103 | self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) ); |
|
104 | } |
|
105 | ||
106 | public function testCompareNewTable() |
|
107 | { |
|
@@ 106-118 (lines=13) @@ | ||
103 | self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) ); |
|
104 | } |
|
105 | ||
106 | public function testCompareNewTable() |
|
107 | { |
|
108 | $schemaConfig = new \Doctrine\DBAL\Schema\SchemaConfig; |
|
109 | $table = new Table('bugdb', array ('integerfield1' => new Column('integerfield1', Type::getType('integer')))); |
|
110 | $table->setSchemaConfig($schemaConfig); |
|
111 | ||
112 | $schema1 = new Schema( array(), array(), $schemaConfig ); |
|
113 | $schema2 = new Schema( array($table), array(), $schemaConfig ); |
|
114 | ||
115 | $expected = new SchemaDiff( array('bugdb' => $table), array(), array(), $schema1 ); |
|
116 | ||
117 | self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) ); |
|
118 | } |
|
119 | ||
120 | public function testCompareOnlyAutoincrementChanged() |
|
121 | { |