|
@@ 287-298 (lines=12) @@
|
| 284 |
|
self::assertEquals('bar', $table->getOption('foo')); |
| 285 |
|
} |
| 286 |
|
|
| 287 |
|
public function testAddForeignKeyConstraintUnknownLocalColumnThrowsException() : void |
| 288 |
|
{ |
| 289 |
|
$this->expectException(SchemaException::class); |
| 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, ['foo'], ['id']); |
| 298 |
|
} |
| 299 |
|
|
| 300 |
|
public function testAddForeignKeyConstraintUnknownForeignColumnThrowsException() : void |
| 301 |
|
{ |
|
@@ 300-311 (lines=12) @@
|
| 297 |
|
$table->addForeignKeyConstraint($foreignTable, ['foo'], ['id']); |
| 298 |
|
} |
| 299 |
|
|
| 300 |
|
public function testAddForeignKeyConstraintUnknownForeignColumnThrowsException() : void |
| 301 |
|
{ |
| 302 |
|
$this->expectException(SchemaException::class); |
| 303 |
|
|
| 304 |
|
$table = new Table('foo'); |
| 305 |
|
$table->addColumn('id', 'integer'); |
| 306 |
|
|
| 307 |
|
$foreignTable = new Table('bar'); |
| 308 |
|
$foreignTable->addColumn('id', 'integer'); |
| 309 |
|
|
| 310 |
|
$table->addForeignKeyConstraint($foreignTable, ['id'], ['foo']); |
| 311 |
|
} |
| 312 |
|
|
| 313 |
|
public function testAddForeignKeyConstraint() : void |
| 314 |
|
{ |