1
0
mirror of synced 2025-02-20 22:23:14 +03:00

#1001 DDC-3005 - Testing HydrationCompleteHandler when no events should be triggered

This commit is contained in:
Marco Pivetta 2015-01-13 00:36:17 +01:00
parent 7b81cfb6ea
commit 833058fd2e

View File

@ -90,4 +90,24 @@ class HydrationCompleteHandlerTest extends PHPUnit_Framework_TestCase
$this->handler->hydrationComplete();
}
public function testSkipsDeferredPostLoadOfMetadataWithNoInvokedListeners()
{
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */
$metadata = $this->getMock('Doctrine\ORM\Mapping\ClassMetadata', array(), array(), '', false);
$entity = new stdClass();
$this
->listenersInvoker
->expects($this->any())
->method('getSubscribedSystems')
->with($metadata)
->will($this->returnValue(ListenersInvoker::INVOKE_NONE));
$this->handler->deferPostLoadInvoking($metadata, $entity);
$this->listenersInvoker->expects($this->never())->method('invoke');
$this->handler->hydrationComplete();
}
}