#470 DDC-54 DDC-3005 - simple-object hydration should also trigger postLoad
events when iterating over single results
This commit is contained in:
parent
5cd73f0d12
commit
0ffc752f6f
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
use Doctrine\ORM\Event\PreUpdateEventArgs;
|
||||
use Doctrine\ORM\Query;
|
||||
|
||||
class LifecycleCallbackTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
{
|
||||
@ -235,6 +236,30 @@ DQL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @group DDC-54
|
||||
* @group DDC-3005
|
||||
*/
|
||||
public function testCascadedEntitiesNotLoadedInPostLoadDuringIterationWithSimpleObjectHydrator()
|
||||
{
|
||||
$this->_em->persist(new LifecycleCallbackTestEntity());
|
||||
$this->_em->persist(new LifecycleCallbackTestEntity());
|
||||
|
||||
$this->_em->flush();
|
||||
$this->_em->clear();
|
||||
|
||||
$result = $this
|
||||
->_em
|
||||
->createQuery('SELECT e FROM Doctrine\Tests\ORM\Functional\LifecycleCallbackTestEntity AS e')
|
||||
->iterate(null, Query::HYDRATE_SIMPLEOBJECT);
|
||||
|
||||
foreach ($result as $entity) {
|
||||
$this->assertTrue($entity[0]->postLoadCallbackInvoked);
|
||||
$this->assertFalse($entity[0]->postLoadCascaderNotNull);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function testLifecycleCallbacksGetInherited()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user