|
@@ 212-223 (lines=12) @@
|
| 209 |
|
self::assertEquals("bar", $table->getOption("foo")); |
| 210 |
|
} |
| 211 |
|
|
| 212 |
|
public function testBuilderSetPrimaryKey() |
| 213 |
|
{ |
| 214 |
|
$table = new Table("foo"); |
| 215 |
|
|
| 216 |
|
$table->addColumn("bar", 'integer'); |
| 217 |
|
$table->setPrimaryKey(array("bar")); |
| 218 |
|
|
| 219 |
|
self::assertTrue($table->hasIndex("primary")); |
| 220 |
|
self::assertInstanceOf('Doctrine\DBAL\Schema\Index', $table->getPrimaryKey()); |
| 221 |
|
self::assertTrue($table->getIndex("primary")->isUnique()); |
| 222 |
|
self::assertTrue($table->getIndex("primary")->isPrimary()); |
| 223 |
|
} |
| 224 |
|
|
| 225 |
|
public function testBuilderAddUniqueIndex() |
| 226 |
|
{ |
|
@@ 225-235 (lines=11) @@
|
| 222 |
|
self::assertTrue($table->getIndex("primary")->isPrimary()); |
| 223 |
|
} |
| 224 |
|
|
| 225 |
|
public function testBuilderAddUniqueIndex() |
| 226 |
|
{ |
| 227 |
|
$table = new Table("foo"); |
| 228 |
|
|
| 229 |
|
$table->addColumn("bar", 'integer'); |
| 230 |
|
$table->addUniqueIndex(array("bar"), "my_idx"); |
| 231 |
|
|
| 232 |
|
self::assertTrue($table->hasIndex("my_idx")); |
| 233 |
|
self::assertTrue($table->getIndex("my_idx")->isUnique()); |
| 234 |
|
self::assertFalse($table->getIndex("my_idx")->isPrimary()); |
| 235 |
|
} |
| 236 |
|
|
| 237 |
|
public function testBuilderAddIndex() |
| 238 |
|
{ |
|
@@ 237-247 (lines=11) @@
|
| 234 |
|
self::assertFalse($table->getIndex("my_idx")->isPrimary()); |
| 235 |
|
} |
| 236 |
|
|
| 237 |
|
public function testBuilderAddIndex() |
| 238 |
|
{ |
| 239 |
|
$table = new Table("foo"); |
| 240 |
|
|
| 241 |
|
$table->addColumn("bar", 'integer'); |
| 242 |
|
$table->addIndex(array("bar"), "my_idx"); |
| 243 |
|
|
| 244 |
|
self::assertTrue($table->hasIndex("my_idx")); |
| 245 |
|
self::assertFalse($table->getIndex("my_idx")->isUnique()); |
| 246 |
|
self::assertFalse($table->getIndex("my_idx")->isPrimary()); |
| 247 |
|
} |
| 248 |
|
|
| 249 |
|
public function testBuilderAddIndexWithInvalidNameThrowsException() |
| 250 |
|
{ |