Update test case for MappingException::invalidCascadeOption()
This commit is contained in:
parent
3403305b3d
commit
37ce0f15d6
@ -426,7 +426,7 @@ class MappingException extends \Doctrine\ORM\ORMException
|
|||||||
{
|
{
|
||||||
$cascades = implode(", ", array_map(function ($e) { return "'" . $e . "'"; }, $cascades));
|
$cascades = implode(", ", array_map(function ($e) { return "'" . $e . "'"; }, $cascades));
|
||||||
return new self(sprintf(
|
return new self(sprintf(
|
||||||
'You have specified invalid cascade options for %s::$%s: %s; available options: "remove", "persist", "refresh", "merge", and "detach"',
|
"You have specified invalid cascade options for %s::$%s: %s; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach'",
|
||||||
$className,
|
$className,
|
||||||
$propertyName,
|
$propertyName,
|
||||||
$cascades
|
$cascades
|
||||||
|
@ -930,7 +930,9 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
$cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser');
|
$cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser');
|
||||||
$cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService);
|
$cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService);
|
||||||
|
|
||||||
$this->setExpectedException("Doctrine\ORM\Mapping\MappingException", "Invalid cascade option(s) specified: 'invalid'. Only 'remove', 'persist', 'refresh', 'merge' and 'detach' are allowed.");
|
$this->setExpectedException("Doctrine\ORM\Mapping\MappingException", "You have specified invalid cascade options for Doctrine\Tests\Models\CMS\CmsUser::\$address: 'invalid'; available options: 'remove', 'persist', 'refresh', 'merge', and 'detach'");
|
||||||
|
|
||||||
|
|
||||||
$cm->mapManyToOne(array('fieldName' => 'address', 'targetEntity' => 'UnknownClass', 'cascade' => array('invalid')));
|
$cm->mapManyToOne(array('fieldName' => 'address', 'targetEntity' => 'UnknownClass', 'cascade' => array('invalid')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user