From c1038096e0fdda78e68144849ebbdf088581f9e4 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sun, 27 Nov 2016 18:17:30 +0100 Subject: [PATCH] #6017 requesting `clear('nonExistingEntityName')` should raise a `MappingException` --- tests/Doctrine/Tests/ORM/UnitOfWorkTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php b/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php index 61957aa1e..a90b6d191 100644 --- a/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php +++ b/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php @@ -4,6 +4,7 @@ namespace Doctrine\Tests\ORM; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\NotifyPropertyChanged; +use Doctrine\Common\Persistence\Mapping\MappingException; use Doctrine\Common\PropertyChangedListener; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\ORMInvalidArgumentException; @@ -362,6 +363,16 @@ class UnitOfWorkTest extends OrmTestCase $this->_unitOfWork->clear($entity); } + /** + * @group 6017 + */ + public function testClearManagerWithUnknownEntityName() + { + $this->expectException(MappingException::class); + + $this->_unitOfWork->clear(uniqid('nonExisting', true)); + } + /** * @group 6017 */