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

Add missing methods to the mock

This commit is contained in:
Michaël Gallego 2014-01-04 19:11:55 +01:00 committed by Marco Pivetta
parent 7551b1ad00
commit 632382b069
3 changed files with 15 additions and 3 deletions

View File

@ -161,7 +161,7 @@ abstract class AbstractEntityPersister implements CachedEntityPersister
*/
public function getCountSQL($criteria = array())
{
return $this->persister->count($criteria);
return $this->persister->getCountSQL($criteria);
}
/**

View File

@ -23,6 +23,7 @@ use Closure;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\Selectable;
use Doctrine\ORM\Persisters\BasicEntityPersister;
/**
@ -31,7 +32,7 @@ use Doctrine\ORM\Persisters\BasicEntityPersister;
* @since 2.5
* @author Michaël Gallego <mic.gallego@gmail.com>
*/
class LazyCriteriaCollection implements Collection
class LazyCriteriaCollection implements Collection, Selectable
{
/**
* @var BasicEntityPersister
@ -354,4 +355,13 @@ class LazyCriteriaCollection implements Collection
$this->collection = new ArrayCollection($elements);
$this->initialized = true;
}
/**
* {@inheritDoc}
*/
function matching(Criteria $criteria)
{
$this->initialize();
return $this->collection->matching($criteria);
}
}

View File

@ -55,6 +55,7 @@ abstract class AbstractEntityPersisterTest extends OrmTestCase
'getInserts',
'getInsertSQL',
'getSelectSQL',
'getCountSQL',
'expandParameters',
'expandCriteriaParameters',
'getSelectConditionStatementSQL',
@ -66,6 +67,7 @@ abstract class AbstractEntityPersisterTest extends OrmTestCase
'load',
'loadById',
'loadOneToOneEntity',
'count',
'refresh',
'loadCriteria',
'loadAll',
@ -435,4 +437,4 @@ abstract class AbstractEntityPersisterTest extends OrmTestCase
$this->assertNull($persister->exists($entity, array()));
}
}
}