|
@@ 1279-1290 (lines=12) @@
|
| 1276 |
|
* @expectedException \Doctrine\ORM\Mapping\MappingException |
| 1277 |
|
* @expectedExceptionMessage You have specified invalid cascade options for Doctrine\Tests\Models\CMS\CmsUser::$address: 'invalid'; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach' |
| 1278 |
|
*/ |
| 1279 |
|
public function testInvalidCascade() |
| 1280 |
|
{ |
| 1281 |
|
$cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext); |
| 1282 |
|
$cm->initializeReflection(new RuntimeReflectionService()); |
| 1283 |
|
|
| 1284 |
|
$association = new Mapping\ManyToOneAssociationMetadata('address'); |
| 1285 |
|
|
| 1286 |
|
$association->setTargetEntity('UnknownClass'); |
| 1287 |
|
$association->setCascade(['invalid']); |
| 1288 |
|
|
| 1289 |
|
$cm->addProperty($association); |
| 1290 |
|
} |
| 1291 |
|
|
| 1292 |
|
/** |
| 1293 |
|
* @group DDC-964 |
|
@@ 1297-1309 (lines=13) @@
|
| 1294 |
|
* @expectedException \Doctrine\ORM\Mapping\MappingException |
| 1295 |
|
* @expectedExceptionMessage Invalid field override named 'invalidPropertyName' for class 'Doctrine\Tests\Models\DDC964\DDC964Admin' |
| 1296 |
|
*/ |
| 1297 |
|
public function testInvalidPropertyAssociationOverrideNameException() |
| 1298 |
|
{ |
| 1299 |
|
$cm = new ClassMetadata(DDC964Admin::class, $this->metadataBuildingContext); |
| 1300 |
|
$cm->initializeReflection(new RuntimeReflectionService()); |
| 1301 |
|
|
| 1302 |
|
$association = new Mapping\ManyToOneAssociationMetadata('address'); |
| 1303 |
|
|
| 1304 |
|
$association->setTargetEntity(DDC964Address::class); |
| 1305 |
|
|
| 1306 |
|
$cm->addProperty($association); |
| 1307 |
|
|
| 1308 |
|
$cm->setPropertyOverride(new Mapping\ManyToOneAssociationMetadata('invalidPropertyName')); |
| 1309 |
|
} |
| 1310 |
|
|
| 1311 |
|
/** |
| 1312 |
|
* @group DDC-964 |