Merge branch 'hotfix/DDC-3123-test-assertion-simplification'
This commit is contained in:
commit
91df8f5649
@ -28,17 +28,13 @@ class DDC3123Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
$this->_em->persist($user);
|
$this->_em->persist($user);
|
||||||
$uow->scheduleExtraUpdate($user, array('name' => 'changed name'));
|
$uow->scheduleExtraUpdate($user, array('name' => 'changed name'));
|
||||||
|
|
||||||
$listener = $this->getMock('stdClass', array('postFlush'));
|
$listener = $this->getMock('stdClass', array(Events::postFlush));
|
||||||
|
|
||||||
$listener
|
$listener
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('postFlush')
|
->method(Events::postFlush)
|
||||||
->will($this->returnCallback(function () use ($uow, $test) {
|
->will($this->returnCallback(function () use ($uow, $test) {
|
||||||
$extraUpdatesReflection = new \ReflectionProperty($uow, 'extraUpdates');
|
$test->assertAttributeEmpty('extraUpdates', $uow, 'ExtraUpdates are reset before postFlush');
|
||||||
|
|
||||||
$extraUpdatesReflection->setAccessible(true);
|
|
||||||
|
|
||||||
$test->assertEmpty($extraUpdatesReflection->getValue($uow));
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
$this->_em->getEventManager()->addEventListener(Events::postFlush, $listener);
|
$this->_em->getEventManager()->addEventListener(Events::postFlush, $listener);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user