Functional test
This commit is contained in:
parent
0d5de64c0f
commit
f03f991a25
@ -591,7 +591,8 @@ class ManyToManyPersister extends AbstractCollectionPersister
|
|||||||
|
|
||||||
$rsm = new Query\ResultSetMapping();
|
$rsm = new Query\ResultSetMapping();
|
||||||
$rsm->addEntityResult($mapping['targetEntity'], 'r');
|
$rsm->addEntityResult($mapping['targetEntity'], 'r');
|
||||||
|
$result = $hydrator->hydrateAll($stmt, $rsm);
|
||||||
|
var_dump($result);
|
||||||
return $hydrator->hydrateAll($stmt, $rsm);
|
return $hydrator->hydrateAll($stmt, $rsm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -601,14 +602,14 @@ class ManyToManyPersister extends AbstractCollectionPersister
|
|||||||
*
|
*
|
||||||
* @param \Doctrine\Common\Collections\Criteria $criteria
|
* @param \Doctrine\Common\Collections\Criteria $criteria
|
||||||
*
|
*
|
||||||
* @return array(array(), array())
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function expandCriteriaParameters(Criteria $criteria)
|
private function expandCriteriaParameters(Criteria $criteria)
|
||||||
{
|
{
|
||||||
$expression = $criteria->getWhereExpression();
|
$expression = $criteria->getWhereExpression();
|
||||||
|
|
||||||
if ($expression === null) {
|
if ($expression === null) {
|
||||||
return array(array(), array());
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$valueVisitor = new SqlValueVisitor();
|
$valueVisitor = new SqlValueVisitor();
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Doctrine\Tests\ORM\Functional;
|
namespace Doctrine\Tests\ORM\Functional;
|
||||||
|
|
||||||
|
use Doctrine\Common\Collections\Criteria;
|
||||||
use Doctrine\Tests\Models\CMS\CmsUser,
|
use Doctrine\Tests\Models\CMS\CmsUser,
|
||||||
Doctrine\Tests\Models\CMS\CmsGroup,
|
Doctrine\Tests\Models\CMS\CmsGroup,
|
||||||
Doctrine\Common\Collections\ArrayCollection;
|
Doctrine\Common\Collections\ArrayCollection;
|
||||||
@ -377,4 +378,20 @@ class ManyToManyBasicAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCa
|
|||||||
$user = $this->_em->find(get_class($user), $user->id);
|
$user = $this->_em->find(get_class($user), $user->id);
|
||||||
$this->assertEquals(0, count($user->groups));
|
$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