@@ 165-176 (lines=12) @@ | ||
162 | $table->getIndex("unknownIndex"); |
|
163 | } |
|
164 | ||
165 | public function testAddTwoPrimaryThrowsException() |
|
166 | { |
|
167 | $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); |
|
168 | ||
169 | $type = \Doctrine\DBAL\Types\Type::getType('integer'); |
|
170 | $columns = array(new Column("foo", $type), new Column("bar", $type)); |
|
171 | $indexes = array( |
|
172 | new Index("the_primary", array("foo"), true, true), |
|
173 | new Index("other_primary", array("bar"), true, true), |
|
174 | ); |
|
175 | $table = new Table("foo", $columns, $indexes, array()); |
|
176 | } |
|
177 | ||
178 | public function testAddTwoIndexesWithSameNameThrowsException() |
|
179 | { |
|
@@ 178-189 (lines=12) @@ | ||
175 | $table = new Table("foo", $columns, $indexes, array()); |
|
176 | } |
|
177 | ||
178 | public function testAddTwoIndexesWithSameNameThrowsException() |
|
179 | { |
|
180 | $this->setExpectedException("Doctrine\DBAL\Schema\SchemaException"); |
|
181 | ||
182 | $type = \Doctrine\DBAL\Types\Type::getType('integer'); |
|
183 | $columns = array(new Column("foo", $type), new Column("bar", $type)); |
|
184 | $indexes = array( |
|
185 | new Index("an_idx", array("foo"), false, false), |
|
186 | new Index("an_idx", array("bar"), false, false), |
|
187 | ); |
|
188 | $table = new Table("foo", $columns, $indexes, array()); |
|
189 | } |
|
190 | ||
191 | public function testConstraints() |
|
192 | { |