Doctrine\Tests\ODM\PHPCR\DocumentManagerTest::testFindTranslation PHP Method

testFindTranslation() public method

public testFindTranslation ( )
    public function testFindTranslation()
    {
        $fakeUuid = \PHPCR\Util\UUIDHelper::generateUUID();
        $session = $this->getMockForAbstractClass('PHPCR\\SessionInterface', array('getNodeByIdentifier'));
        $session->expects($this->once())->method('getNodeByIdentifier')->will($this->throwException(new \PHPCR\ItemNotFoundException(sprintf('403: %s', $fakeUuid))));
        $config = new \Doctrine\ODM\PHPCR\Configuration();
        $dm = DocumentManager::create($session, $config);
        $nonExistent = $dm->findTranslation(null, $fakeUuid, 'en');
        $this->assertNull($nonExistent);
    }