|
@@ 1333-1344 (lines=12) @@
|
| 1330 |
|
* @expectedException \Doctrine\ORM\Mapping\MappingException |
| 1331 |
|
* @expectedExceptionMessage You have specified invalid cascade options for Doctrine\Tests\Models\CMS\CmsUser::$address: 'invalid'; available options: 'remove', 'persist', and 'refresh' |
| 1332 |
|
*/ |
| 1333 |
|
public function testInvalidCascade() |
| 1334 |
|
{ |
| 1335 |
|
$cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext); |
| 1336 |
|
$cm->setTable(new Mapping\TableMetadata('cms_users')); |
| 1337 |
|
|
| 1338 |
|
$association = new Mapping\ManyToOneAssociationMetadata('address'); |
| 1339 |
|
|
| 1340 |
|
$association->setTargetEntity('UnknownClass'); |
| 1341 |
|
$association->setCascade(['invalid']); |
| 1342 |
|
|
| 1343 |
|
$cm->addProperty($association); |
| 1344 |
|
} |
| 1345 |
|
|
| 1346 |
|
/** |
| 1347 |
|
* @group DDC-964 |
|
@@ 1351-1363 (lines=13) @@
|
| 1348 |
|
* @expectedException \Doctrine\ORM\Mapping\MappingException |
| 1349 |
|
* @expectedExceptionMessage Invalid field override named 'invalidPropertyName' for class 'Doctrine\Tests\Models\DDC964\DDC964Admin' |
| 1350 |
|
*/ |
| 1351 |
|
public function testInvalidPropertyAssociationOverrideNameException() |
| 1352 |
|
{ |
| 1353 |
|
$cm = new ClassMetadata(DDC964Admin::class, $this->metadataBuildingContext); |
| 1354 |
|
$cm->setTable(new Mapping\TableMetadata("ddc964_admin")); |
| 1355 |
|
|
| 1356 |
|
$association = new Mapping\ManyToOneAssociationMetadata('address'); |
| 1357 |
|
|
| 1358 |
|
$association->setTargetEntity(DDC964Address::class); |
| 1359 |
|
|
| 1360 |
|
$cm->addProperty($association); |
| 1361 |
|
|
| 1362 |
|
$cm->setPropertyOverride(new Mapping\ManyToOneAssociationMetadata('invalidPropertyName')); |
| 1363 |
|
} |
| 1364 |
|
|
| 1365 |
|
/** |
| 1366 |
|
* @group DDC-964 |