1
0
mirror of synced 2025-02-20 06:03:15 +03:00

Update test case for MappingException::invalidCascadeOption()

This commit is contained in:
Alexander 2012-05-04 18:26:17 +02:00
parent 3403305b3d
commit 37ce0f15d6
2 changed files with 4 additions and 2 deletions

View File

@ -426,7 +426,7 @@ class MappingException extends \Doctrine\ORM\ORMException
{
$cascades = implode(", ", array_map(function ($e) { return "'" . $e . "'"; }, $cascades));
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,
$propertyName,
$cascades

View File

@ -930,7 +930,9 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
$cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser');
$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')));
}