|
@@ 274-285 (lines=12) @@
|
| 271 |
|
self::assertEquals("bar", $table->getOption("foo")); |
| 272 |
|
} |
| 273 |
|
|
| 274 |
|
public function testAddForeignKeyConstraintThrowsExceptionWhenUnknownLocalColumnIsGiven() |
| 275 |
|
{ |
| 276 |
|
$this->expectException("Doctrine\DBAL\Schema\SchemaException"); |
| 277 |
|
|
| 278 |
|
$table = new Table("foo"); |
| 279 |
|
$table->addColumn("id", 'integer'); |
| 280 |
|
|
| 281 |
|
$foreignTable = new Table("bar"); |
| 282 |
|
$foreignTable->addColumn("id", 'integer'); |
| 283 |
|
|
| 284 |
|
$table->addForeignKeyConstraint($foreignTable, array("foo"), array("id")); |
| 285 |
|
} |
| 286 |
|
|
| 287 |
|
public function testAddForeignKeyConstraintThrowsExceptionWhenUnknownForeignColumnIsGiven() |
| 288 |
|
{ |
|
@@ 287-298 (lines=12) @@
|
| 284 |
|
$table->addForeignKeyConstraint($foreignTable, array("foo"), array("id")); |
| 285 |
|
} |
| 286 |
|
|
| 287 |
|
public function testAddForeignKeyConstraintThrowsExceptionWhenUnknownForeignColumnIsGiven() |
| 288 |
|
{ |
| 289 |
|
$this->expectException("Doctrine\DBAL\Schema\SchemaException"); |
| 290 |
|
|
| 291 |
|
$table = new Table("foo"); |
| 292 |
|
$table->addColumn("id", 'integer'); |
| 293 |
|
|
| 294 |
|
$foreignTable = new Table("bar"); |
| 295 |
|
$foreignTable->addColumn("id", 'integer'); |
| 296 |
|
|
| 297 |
|
$table->addForeignKeyConstraint($foreignTable, array("id"), array("foo")); |
| 298 |
|
} |
| 299 |
|
|
| 300 |
|
public function testAddForeignKeyConstraint() |
| 301 |
|
{ |
|
@@ 614-622 (lines=9) @@
|
| 611 |
|
/** |
| 612 |
|
* @group DBAL-91 |
| 613 |
|
*/ |
| 614 |
|
public function testAddForeignKeyWithQuotedColumnsAndTable() |
| 615 |
|
{ |
| 616 |
|
$table = new Table("test"); |
| 617 |
|
$table->addColumn('"foo"', 'integer'); |
| 618 |
|
$table->addColumn('bar', 'integer'); |
| 619 |
|
$table->addForeignKeyConstraint('"boing"', ['"foo"', '"bar"'], ["id"]); |
| 620 |
|
|
| 621 |
|
self::assertCount(1, $table->getForeignKeys()); |
| 622 |
|
} |
| 623 |
|
|
| 624 |
|
/** |
| 625 |
|
* @group DBAL-177 |