Add test
This commit is contained in:
parent
f03f991a25
commit
6cbd643d4b
@ -587,12 +587,11 @@ class ManyToManyPersister extends AbstractCollectionPersister
|
||||
. ' WHERE ' . implode(' AND ', $whereClauses);
|
||||
|
||||
$stmt = $this->conn->executeQuery($sql, $params);
|
||||
$hydrator = $this->em->newHydrator(Query::HYDRATE_ARRAY);
|
||||
$hydrator = $this->em->newHydrator(Query::HYDRATE_OBJECT);
|
||||
|
||||
$rsm = new Query\ResultSetMapping();
|
||||
$rsm->addEntityResult($mapping['targetEntity'], 'r');
|
||||
$result = $hydrator->hydrateAll($stmt, $rsm);
|
||||
var_dump($result);
|
||||
|
||||
return $hydrator->hydrateAll($stmt, $rsm);
|
||||
}
|
||||
|
||||
|
@ -389,9 +389,14 @@ class ManyToManyBasicAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCa
|
||||
$groups = $user->groups;
|
||||
$this->assertFalse($user->groups->isInitialized(), "Pre-condition: lazy collection");
|
||||
|
||||
$criteria = Criteria::create();//->where(Criteria::expr()->eq('name', (string) 'Developers_0'));
|
||||
$criteria = Criteria::create()->where(Criteria::expr()->eq('name', (string) 'Developers_0'));
|
||||
$result = $groups->matching($criteria);
|
||||
|
||||
//$this->assertCount(1, $result);
|
||||
$this->assertCount(1, $result);
|
||||
|
||||
$firstGroup = $result->first();
|
||||
$this->assertEquals('Developers_0', $firstGroup->name);
|
||||
|
||||
$this->assertFalse($user->groups->isInitialized(), "Post-condition: matching does not initialize collection");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user