|
@@ 1204-1215 (lines=12) @@
|
| 1201 |
|
* @expectedException \Doctrine\ORM\Mapping\MappingException |
| 1202 |
|
* @expectedExceptionMessage You have specified invalid cascade options for Doctrine\Tests\Models\CMS\CmsUser::$address: 'invalid'; available options: 'remove', 'persist', and 'refresh' |
| 1203 |
|
*/ |
| 1204 |
|
public function testInvalidCascade() |
| 1205 |
|
{ |
| 1206 |
|
$cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext); |
| 1207 |
|
$cm->setTable(new Mapping\TableMetadata('cms_users')); |
| 1208 |
|
|
| 1209 |
|
$association = new Mapping\ManyToOneAssociationMetadata('address'); |
| 1210 |
|
|
| 1211 |
|
$association->setTargetEntity('UnknownClass'); |
| 1212 |
|
$association->setCascade(['invalid']); |
| 1213 |
|
|
| 1214 |
|
$cm->addProperty($association); |
| 1215 |
|
} |
| 1216 |
|
|
| 1217 |
|
/** |
| 1218 |
|
* @group DDC-964 |
|
@@ 1222-1234 (lines=13) @@
|
| 1219 |
|
* @expectedException \Doctrine\ORM\Mapping\MappingException |
| 1220 |
|
* @expectedExceptionMessage Invalid field override named 'invalidPropertyName' for class 'Doctrine\Tests\Models\DDC964\DDC964Admin' |
| 1221 |
|
*/ |
| 1222 |
|
public function testInvalidPropertyAssociationOverrideNameException() |
| 1223 |
|
{ |
| 1224 |
|
$cm = new ClassMetadata(DDC964Admin::class, $this->metadataBuildingContext); |
| 1225 |
|
$cm->setTable(new Mapping\TableMetadata("ddc964_admin")); |
| 1226 |
|
|
| 1227 |
|
$association = new Mapping\ManyToOneAssociationMetadata('address'); |
| 1228 |
|
|
| 1229 |
|
$association->setTargetEntity(DDC964Address::class); |
| 1230 |
|
|
| 1231 |
|
$cm->addProperty($association); |
| 1232 |
|
|
| 1233 |
|
$cm->setPropertyOverride(new Mapping\ManyToOneAssociationMetadata('invalidPropertyName')); |
| 1234 |
|
} |
| 1235 |
|
|
| 1236 |
|
/** |
| 1237 |
|
* @group DDC-964 |