diff --git a/lib/Doctrine/ORM/EntityNotFoundException.php b/lib/Doctrine/ORM/EntityNotFoundException.php index e4ace3dc0..afe2f2242 100644 --- a/lib/Doctrine/ORM/EntityNotFoundException.php +++ b/lib/Doctrine/ORM/EntityNotFoundException.php @@ -37,7 +37,6 @@ class EntityNotFoundException extends ORMException */ public static function fromClassNameAndIdentifier($className, array $id) { - $ids = array(); foreach ($id as $key => $value) { diff --git a/tests/Doctrine/Tests/ORM/EntityNotFoundExceptionTest.php b/tests/Doctrine/Tests/ORM/EntityNotFoundExceptionTest.php new file mode 100644 index 000000000..7dce1b171 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/EntityNotFoundExceptionTest.php @@ -0,0 +1,33 @@ + 'bar') + ); + + $this->assertInstanceOf('Doctrine\ORM\EntityNotFoundException', $exception); + $this->assertSame('Entity of type \'foo\' for IDs foo(bar) was not found', $exception->getMessage()); + + $exception = EntityNotFoundException::fromClassNameAndIdentifier( + 'foo', + array() + ); + + $this->assertInstanceOf('Doctrine\ORM\EntityNotFoundException', $exception); + $this->assertSame('Entity of type \'foo\' was not found', $exception->getMessage()); + } +}