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

DDC-3123 - using assertAttributeEmpty (with message) instead of explicit reflection

This commit is contained in:
Marco Pivetta 2014-05-15 17:37:41 +02:00
parent 5c828fc6c8
commit 65e55a0c49

View File

@ -28,17 +28,13 @@ class DDC3123Test extends \Doctrine\Tests\OrmFunctionalTestCase
$this->_em->persist($user);
$uow->scheduleExtraUpdate($user, array('name' => 'changed name'));
$listener = $this->getMock('stdClass', array('postFlush'));
$listener = $this->getMock('stdClass', array(Events::postFlush));
$listener
->expects($this->once())
->method('postFlush')
->method(Events::postFlush)
->will($this->returnCallback(function () use ($uow, $test) {
$extraUpdatesReflection = new \ReflectionProperty($uow, 'extraUpdates');
$extraUpdatesReflection->setAccessible(true);
$test->assertEmpty($extraUpdatesReflection->getValue($uow));
$test->assertAttributeEmpty('extraUpdates', $uow, 'ExtraUpdates are reset before postFlush');
}));
$this->_em->getEventManager()->addEventListener(Events::postFlush, $listener);