#1240 DDC-3479 - Basic coverage for EntityNotFoundException
This commit is contained in:
parent
fc72b41953
commit
1bfa7ea754
@ -37,7 +37,6 @@ class EntityNotFoundException extends ORMException
|
|||||||
*/
|
*/
|
||||||
public static function fromClassNameAndIdentifier($className, array $id)
|
public static function fromClassNameAndIdentifier($className, array $id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$ids = array();
|
$ids = array();
|
||||||
|
|
||||||
foreach ($id as $key => $value) {
|
foreach ($id as $key => $value) {
|
||||||
|
33
tests/Doctrine/Tests/ORM/EntityNotFoundExceptionTest.php
Normal file
33
tests/Doctrine/Tests/ORM/EntityNotFoundExceptionTest.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Doctrine\Tests\ORM;
|
||||||
|
|
||||||
|
use Doctrine\ORM\EntityNotFoundException;
|
||||||
|
use PHPUnit_Framework_TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for {@see \Doctrine\ORM\EntityNotFoundException}
|
||||||
|
*
|
||||||
|
* @covers \Doctrine\ORM\EntityNotFoundException
|
||||||
|
*/
|
||||||
|
class EntityNotFoundExceptionTest extends PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
public function testFromClassNameAndIdentifier()
|
||||||
|
{
|
||||||
|
$exception = EntityNotFoundException::fromClassNameAndIdentifier(
|
||||||
|
'foo',
|
||||||
|
array('foo' => '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());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user