1
0
mirror of synced 2025-02-03 13:59:27 +03:00
doctrine2/tests/Doctrine/Tests/ORM/EntityNotFoundExceptionTest.php

34 lines
963 B
PHP
Raw Normal View History

<?php
namespace Doctrine\Tests\ORM;
use Doctrine\ORM\EntityNotFoundException;
2017-03-31 17:20:10 +01:00
use PHPUnit\Framework\TestCase;
/**
* Tests for {@see \Doctrine\ORM\EntityNotFoundException}
*
* @covers \Doctrine\ORM\EntityNotFoundException
*/
2017-03-31 17:20:10 +01:00
class EntityNotFoundExceptionTest extends TestCase
{
public function testFromClassNameAndIdentifier()
{
$exception = EntityNotFoundException::fromClassNameAndIdentifier(
'foo',
['foo' => 'bar']
);
$this->assertInstanceOf(EntityNotFoundException::class, $exception);
$this->assertSame('Entity of type \'foo\' for IDs foo(bar) was not found', $exception->getMessage());
$exception = EntityNotFoundException::fromClassNameAndIdentifier(
'foo',
[]
);
$this->assertInstanceOf(EntityNotFoundException::class, $exception);
$this->assertSame('Entity of type \'foo\' was not found', $exception->getMessage());
}
}