Functional test
This commit is contained in:
parent
0d5de64c0f
commit
f03f991a25
@ -591,7 +591,8 @@ class ManyToManyPersister extends AbstractCollectionPersister
|
||||
|
||||
$rsm = new Query\ResultSetMapping();
|
||||
$rsm->addEntityResult($mapping['targetEntity'], 'r');
|
||||
|
||||
$result = $hydrator->hydrateAll($stmt, $rsm);
|
||||
var_dump($result);
|
||||
return $hydrator->hydrateAll($stmt, $rsm);
|
||||
}
|
||||
|
||||
@ -601,14 +602,14 @@ class ManyToManyPersister extends AbstractCollectionPersister
|
||||
*
|
||||
* @param \Doctrine\Common\Collections\Criteria $criteria
|
||||
*
|
||||
* @return array(array(), array())
|
||||
* @return array
|
||||
*/
|
||||
private function expandCriteriaParameters(Criteria $criteria)
|
||||
{
|
||||
$expression = $criteria->getWhereExpression();
|
||||
|
||||
if ($expression === null) {
|
||||
return array(array(), array());
|
||||
return array();
|
||||
}
|
||||
|
||||
$valueVisitor = new SqlValueVisitor();
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser,
|
||||
Doctrine\Tests\Models\CMS\CmsGroup,
|
||||
Doctrine\Common\Collections\ArrayCollection;
|
||||
@ -377,4 +378,20 @@ class ManyToManyBasicAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCa
|
||||
$user = $this->_em->find(get_class($user), $user->id);
|
||||
$this->assertEquals(0, count($user->groups));
|
||||
}
|
||||
|
||||
public function testMatching()
|
||||
{
|
||||
$user = $this->addCmsUserGblancoWithGroups(2);
|
||||
$this->_em->clear();
|
||||
|
||||
$user = $this->_em->find(get_class($user), $user->id);
|
||||
|
||||
$groups = $user->groups;
|
||||
$this->assertFalse($user->groups->isInitialized(), "Pre-condition: lazy collection");
|
||||
|
||||
$criteria = Criteria::create();//->where(Criteria::expr()->eq('name', (string) 'Developers_0'));
|
||||
$result = $groups->matching($criteria);
|
||||
|
||||
//$this->assertCount(1, $result);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user