1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Merge branch 'DBAL-171'

This commit is contained in:
Benjamin Eberlei 2011-11-18 17:30:26 +01:00
commit ab4d3c3a09
3 changed files with 121 additions and 73 deletions

View File

@ -44,28 +44,28 @@ final class Query extends AbstractQuery
* is called. * is called.
*/ */
const STATE_DIRTY = 2; const STATE_DIRTY = 2;
/* Query HINTS */ /* Query HINTS */
/** /**
* The refresh hint turns any query into a refresh query with the result that * The refresh hint turns any query into a refresh query with the result that
* any local changes in entities are overridden with the fetched values. * any local changes in entities are overridden with the fetched values.
* *
* @var string * @var string
*/ */
const HINT_REFRESH = 'doctrine.refresh'; const HINT_REFRESH = 'doctrine.refresh';
/** /**
* Internal hint: is set to the proxy entity that is currently triggered for loading * Internal hint: is set to the proxy entity that is currently triggered for loading
* *
* @var string * @var string
*/ */
const HINT_REFRESH_ENTITY = 'doctrine.refresh.entity'; const HINT_REFRESH_ENTITY = 'doctrine.refresh.entity';
/** /**
* The forcePartialLoad query hint forces a particular query to return * The forcePartialLoad query hint forces a particular query to return
* partial objects. * partial objects.
* *
* @var string * @var string
* @todo Rename: HINT_OPTIMIZE * @todo Rename: HINT_OPTIMIZE
*/ */
@ -73,9 +73,9 @@ final class Query extends AbstractQuery
/** /**
* The includeMetaColumns query hint causes meta columns like foreign keys and * The includeMetaColumns query hint causes meta columns like foreign keys and
* discriminator columns to be selected and returned as part of the query result. * discriminator columns to be selected and returned as part of the query result.
* *
* This hint does only apply to non-object queries. * This hint does only apply to non-object queries.
* *
* @var string * @var string
*/ */
const HINT_INCLUDE_META_COLUMNS = 'doctrine.includeMetaColumns'; const HINT_INCLUDE_META_COLUMNS = 'doctrine.includeMetaColumns';
@ -122,12 +122,12 @@ final class Query extends AbstractQuery
* @var Doctrine\ORM\Query\ParserResult The parser result that holds DQL => SQL information. * @var Doctrine\ORM\Query\ParserResult The parser result that holds DQL => SQL information.
*/ */
private $_parserResult; private $_parserResult;
/** /**
* @var integer The first result to return (the "offset"). * @var integer The first result to return (the "offset").
*/ */
private $_firstResult = null; private $_firstResult = null;
/** /**
* @var integer The maximum number of results to return (the "limit"). * @var integer The maximum number of results to return (the "limit").
*/ */
@ -147,7 +147,7 @@ final class Query extends AbstractQuery
* @var int Query Cache lifetime. * @var int Query Cache lifetime.
*/ */
private $_queryCacheTTL; private $_queryCacheTTL;
/** /**
* @var boolean Whether to use a query cache, if available. Defaults to TRUE. * @var boolean Whether to use a query cache, if available. Defaults to TRUE.
*/ */
@ -191,7 +191,7 @@ final class Query extends AbstractQuery
/** /**
* Parses the DQL query, if necessary, and stores the parser result. * Parses the DQL query, if necessary, and stores the parser result.
* *
* Note: Populates $this->_parserResult as a side-effect. * Note: Populates $this->_parserResult as a side-effect.
* *
* @return Doctrine\ORM\Query\ParserResult * @return Doctrine\ORM\Query\ParserResult
@ -201,12 +201,12 @@ final class Query extends AbstractQuery
if ($this->_state === self::STATE_CLEAN) { if ($this->_state === self::STATE_CLEAN) {
return $this->_parserResult; return $this->_parserResult;
} }
// Check query cache. // Check query cache.
if ($this->_useQueryCache && ($queryCache = $this->getQueryCacheDriver())) { if ($this->_useQueryCache && ($queryCache = $this->getQueryCacheDriver())) {
$hash = $this->_getQueryCacheId(); $hash = $this->_getQueryCacheId();
$cached = $this->_expireQueryCache ? false : $queryCache->fetch($hash); $cached = $this->_expireQueryCache ? false : $queryCache->fetch($hash);
if ($cached === false) { if ($cached === false) {
// Cache miss. // Cache miss.
$parser = new Parser($this); $parser = new Parser($this);
@ -220,9 +220,9 @@ final class Query extends AbstractQuery
$parser = new Parser($this); $parser = new Parser($this);
$this->_parserResult = $parser->parse(); $this->_parserResult = $parser->parse();
} }
$this->_state = self::STATE_CLEAN; $this->_state = self::STATE_CLEAN;
return $this->_parserResult; return $this->_parserResult;
} }
@ -244,55 +244,62 @@ final class Query extends AbstractQuery
} }
list($sqlParams, $types) = $this->processParameterMappings($paramMappings); list($sqlParams, $types) = $this->processParameterMappings($paramMappings);
if ($this->_resultSetMapping === null) { if ($this->_resultSetMapping === null) {
$this->_resultSetMapping = $this->_parserResult->getResultSetMapping(); $this->_resultSetMapping = $this->_parserResult->getResultSetMapping();
} }
return $executor->execute($this->_em->getConnection(), $sqlParams, $types); return $executor->execute($this->_em->getConnection(), $sqlParams, $types);
} }
/** /**
* Processes query parameter mappings * Processes query parameter mappings
* *
* @param array $paramMappings * @param array $paramMappings
* @return array * @return array
*/ */
private function processParameterMappings($paramMappings) private function processParameterMappings($paramMappings)
{ {
$sqlParams = $types = array(); $sqlParams = $types = array();
foreach ($this->_params as $key => $value) { foreach ($this->_params as $key => $value) {
if ( ! isset($paramMappings[$key])) { if ( ! isset($paramMappings[$key])) {
throw QueryException::unknownParameter($key); throw QueryException::unknownParameter($key);
} }
if (isset($this->_paramTypes[$key])) { if (isset($this->_paramTypes[$key])) {
foreach ($paramMappings[$key] as $position) { foreach ($paramMappings[$key] as $position) {
$types[$position] = $this->_paramTypes[$key]; $types[$position] = $this->_paramTypes[$key];
} }
} }
$sqlPositions = $paramMappings[$key]; $sqlPositions = $paramMappings[$key];
$value = array_values($this->processParameterValue($value)); $value = array_values($this->processParameterValue($value));
$countValue = count($value); $countValue = count($value);
for ($i = 0, $l = count($sqlPositions); $i < $l; $i++) { for ($i = 0, $l = count($sqlPositions); $i < $l; $i++) {
$sqlParams[$sqlPositions[$i]] = $value[($i % $countValue)]; $sqlParams[$sqlPositions[$i]] = $value[($i % $countValue)];
} }
} }
if (count($sqlParams) != count($types)) {
throw QueryException::parameterTypeMissmatch();
}
if ($sqlParams) { if ($sqlParams) {
ksort($sqlParams); ksort($sqlParams);
$sqlParams = array_values($sqlParams); $sqlParams = array_values($sqlParams);
ksort($types);
$types = array_values($types);
} }
return array($sqlParams, $types); return array($sqlParams, $types);
} }
/** /**
* Process an individual parameter value * Process an individual parameter value
* *
* @param mixed $value * @param mixed $value
* @return array * @return array
*/ */
@ -308,7 +315,7 @@ final class Query extends AbstractQuery
} }
return array($value); return array($value);
case is_object($value) && $this->_em->getMetadataFactory()->hasMetadataFor(get_class($value)): case is_object($value) && $this->_em->getMetadataFactory()->hasMetadataFor(get_class($value)):
if ($this->_em->getUnitOfWork()->getEntityState($value) === UnitOfWork::STATE_MANAGED) { if ($this->_em->getUnitOfWork()->getEntityState($value) === UnitOfWork::STATE_MANAGED) {
return array_values($this->_em->getUnitOfWork()->getEntityIdentifier($value)); return array_values($this->_em->getUnitOfWork()->getEntityIdentifier($value));
@ -317,7 +324,7 @@ final class Query extends AbstractQuery
$class = $this->_em->getClassMetadata(get_class($value)); $class = $this->_em->getClassMetadata(get_class($value));
return array_values($class->getIdentifierValues($value)); return array_values($class->getIdentifierValues($value));
default: default:
return array($value); return array($value);
} }
@ -334,10 +341,10 @@ final class Query extends AbstractQuery
$this->_queryCache = $queryCache; $this->_queryCache = $queryCache;
return $this; return $this;
} }
/** /**
* Defines whether the query should make use of a query cache, if available. * Defines whether the query should make use of a query cache, if available.
* *
* @param boolean $bool * @param boolean $bool
* @return @return Query This query instance. * @return @return Query This query instance.
*/ */
@ -471,7 +478,7 @@ final class Query extends AbstractQuery
{ {
return stripos($this->getDQL(), $dql) === false ? false : true; return stripos($this->getDQL(), $dql) === false ? false : true;
} }
/** /**
* Sets the position of the first result to retrieve (the "offset"). * Sets the position of the first result to retrieve (the "offset").
* *
@ -484,21 +491,21 @@ final class Query extends AbstractQuery
$this->_state = self::STATE_DIRTY; $this->_state = self::STATE_DIRTY;
return $this; return $this;
} }
/** /**
* Gets the position of the first result the query object was set to retrieve (the "offset"). * Gets the position of the first result the query object was set to retrieve (the "offset").
* Returns NULL if {@link setFirstResult} was not applied to this query. * Returns NULL if {@link setFirstResult} was not applied to this query.
* *
* @return integer The position of the first result. * @return integer The position of the first result.
*/ */
public function getFirstResult() public function getFirstResult()
{ {
return $this->_firstResult; return $this->_firstResult;
} }
/** /**
* Sets the maximum number of results to retrieve (the "limit"). * Sets the maximum number of results to retrieve (the "limit").
* *
* @param integer $maxResults * @param integer $maxResults
* @return Query This query object. * @return Query This query object.
*/ */
@ -508,11 +515,11 @@ final class Query extends AbstractQuery
$this->_state = self::STATE_DIRTY; $this->_state = self::STATE_DIRTY;
return $this; return $this;
} }
/** /**
* Gets the maximum number of results the query object was set to retrieve (the "limit"). * Gets the maximum number of results the query object was set to retrieve (the "limit").
* Returns NULL if {@link setMaxResults} was not applied to this query. * Returns NULL if {@link setMaxResults} was not applied to this query.
* *
* @return integer Maximum number of results. * @return integer Maximum number of results.
*/ */
public function getMaxResults() public function getMaxResults()
@ -533,7 +540,7 @@ final class Query extends AbstractQuery
$this->setHint(self::HINT_INTERNAL_ITERATION, true); $this->setHint(self::HINT_INTERNAL_ITERATION, true);
return parent::iterate($params, $hydrationMode); return parent::iterate($params, $hydrationMode);
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
@ -542,7 +549,7 @@ final class Query extends AbstractQuery
$this->_state = self::STATE_DIRTY; $this->_state = self::STATE_DIRTY;
return parent::setHint($name, $value); return parent::setHint($name, $value);
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
@ -597,7 +604,7 @@ final class Query extends AbstractQuery
ksort($this->_hints); ksort($this->_hints);
return md5( return md5(
$this->getDql() . var_export($this->_hints, true) . $this->getDql() . var_export($this->_hints, true) .
'&firstResult=' . $this->_firstResult . '&maxResult=' . $this->_maxResults . '&firstResult=' . $this->_firstResult . '&maxResult=' . $this->_maxResults .
'&hydrationMode='.$this->_hydrationMode.'DOCTRINE_QUERY_CACHE_SALT' '&hydrationMode='.$this->_hydrationMode.'DOCTRINE_QUERY_CACHE_SALT'
); );

View File

@ -77,6 +77,11 @@ class QueryException extends \Doctrine\ORM\ORMException
return new self("Invalid parameter: token ".$key." is not defined in the query."); return new self("Invalid parameter: token ".$key." is not defined in the query.");
} }
public static function parameterTypeMissmatch()
{
return new self("DQL Query parameter and type numbers missmatch, but have to be exactly equal.");
}
public static function invalidPathExpression($pathExpr) public static function invalidPathExpression($pathExpr)
{ {
return new self( return new self(
@ -140,7 +145,7 @@ class QueryException extends \Doctrine\ORM\ORMException
"in the query." "in the query."
); );
} }
public static function instanceOfUnrelatedClass($className, $rootClass) public static function instanceOfUnrelatedClass($className, $rootClass)
{ {
return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " . return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " .

View File

@ -34,9 +34,9 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->_em->clear(); $this->_em->clear();
$query = $this->_em->createQuery("select u, upper(u.name) from Doctrine\Tests\Models\CMS\CmsUser u where u.username = 'gblanco'"); $query = $this->_em->createQuery("select u, upper(u.name) from Doctrine\Tests\Models\CMS\CmsUser u where u.username = 'gblanco'");
$result = $query->getResult(); $result = $query->getResult();
$this->assertEquals(1, count($result)); $this->assertEquals(1, count($result));
$this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][0]); $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $result[0][0]);
$this->assertEquals('Guilherme', $result[0][0]->name); $this->assertEquals('Guilherme', $result[0][0]->name);
@ -109,7 +109,7 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$q = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = ?0'); $q = $this->_em->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username = ?0');
$q->setParameter(0, 'jwage'); $q->setParameter(0, 'jwage');
$user = $q->getSingleResult(); $user = $q->getSingleResult();
$this->assertNotNull($user); $this->assertNotNull($user);
} }
@ -216,7 +216,7 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$identityMap = $this->_em->getUnitOfWork()->getIdentityMap(); $identityMap = $this->_em->getUnitOfWork()->getIdentityMap();
$identityMapCount = count($identityMap['Doctrine\Tests\Models\CMS\CmsArticle']); $identityMapCount = count($identityMap['Doctrine\Tests\Models\CMS\CmsArticle']);
$this->assertTrue($identityMapCount>$iteratedCount); $this->assertTrue($identityMapCount>$iteratedCount);
$iteratedCount++; $iteratedCount++;
} }
@ -235,7 +235,7 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query = $this->_em->createQuery("SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.articles a"); $query = $this->_em->createQuery("SELECT u, a FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.articles a");
$articles = $query->iterate(); $articles = $query->iterate();
} }
/** /**
* @expectedException Doctrine\ORM\NoResultException * @expectedException Doctrine\ORM\NoResultException
*/ */
@ -366,7 +366,7 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $result[0]->user); $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $result[0]->user);
$this->assertFalse($result[0]->user->__isInitialized__); $this->assertFalse($result[0]->user->__isInitialized__);
} }
/** /**
* @group DDC-952 * @group DDC-952
*/ */
@ -386,11 +386,11 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
} }
$this->_em->flush(); $this->_em->flush();
$this->_em->clear(); $this->_em->clear();
$articles = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a') $articles = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a')
->setFetchMode('Doctrine\Tests\Models\CMS\CmsArticle', 'user', ClassMetadata::FETCH_EAGER) ->setFetchMode('Doctrine\Tests\Models\CMS\CmsArticle', 'user', ClassMetadata::FETCH_EAGER)
->getResult(); ->getResult();
$this->assertEquals(10, count($articles)); $this->assertEquals(10, count($articles));
foreach ($articles AS $article) { foreach ($articles AS $article) {
$this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $article); $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $article);
@ -456,7 +456,43 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$query = $this->_em->createQuery("select u.username from Doctrine\Tests\Models\CMS\CmsUser u where u.username = 'gblanco'"); $query = $this->_em->createQuery("select u.username from Doctrine\Tests\Models\CMS\CmsUser u where u.username = 'gblanco'");
$this->assertNull($query->getOneOrNullResult(Query::HYDRATE_SCALAR)); $this->assertNull($query->getOneOrNullResult(Query::HYDRATE_SCALAR));
} }
/**
* @group DBAL-171
*/
public function testParameterOrder()
{
$user = new CmsUser;
$user->name = 'Benjamin';
$user->username = 'beberlei';
$user->status = 'developer';
$this->_em->persist($user);
$user = new CmsUser;
$user->name = 'Roman';
$user->username = 'romanb';
$user->status = 'developer';
$this->_em->persist($user);
$user = new CmsUser;
$user->name = 'Jonathan';
$user->username = 'jwage';
$user->status = 'developer';
$this->_em->persist($user);
$this->_em->flush();
$this->_em->clear();
$query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.status = :a AND u.id IN (:b)");
$query->setParameters(array(
'b' => array(1,2,3),
'a' => 'developer',
));
$result = $query->getResult();
$this->assertEquals(3, count($result));
}
public function testDqlWithAutoInferOfParameters() public function testDqlWithAutoInferOfParameters()
{ {
$user = new CmsUser; $user = new CmsUser;
@ -464,30 +500,30 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$user->username = 'beberlei'; $user->username = 'beberlei';
$user->status = 'developer'; $user->status = 'developer';
$this->_em->persist($user); $this->_em->persist($user);
$user = new CmsUser; $user = new CmsUser;
$user->name = 'Roman'; $user->name = 'Roman';
$user->username = 'romanb'; $user->username = 'romanb';
$user->status = 'developer'; $user->status = 'developer';
$this->_em->persist($user); $this->_em->persist($user);
$user = new CmsUser; $user = new CmsUser;
$user->name = 'Jonathan'; $user->name = 'Jonathan';
$user->username = 'jwage'; $user->username = 'jwage';
$user->status = 'developer'; $user->status = 'developer';
$this->_em->persist($user); $this->_em->persist($user);
$this->_em->flush(); $this->_em->flush();
$this->_em->clear(); $this->_em->clear();
$query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username IN (?0)"); $query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.username IN (?0)");
$query->setParameter(0, array('beberlei', 'jwage')); $query->setParameter(0, array('beberlei', 'jwage'));
$users = $query->execute(); $users = $query->execute();
$this->assertEquals(2, count($users)); $this->assertEquals(2, count($users));
} }
public function testQueryBuilderWithStringWhereClauseContainingOrAndConditionalPrimary() public function testQueryBuilderWithStringWhereClauseContainingOrAndConditionalPrimary()
{ {
$qb = $this->_em->createQueryBuilder(); $qb = $this->_em->createQueryBuilder();
@ -495,13 +531,13 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u')
->innerJoin('u.articles', 'a') ->innerJoin('u.articles', 'a')
->where('(u.id = 0) OR (u.id IS NULL)'); ->where('(u.id = 0) OR (u.id IS NULL)');
$query = $qb->getQuery(); $query = $qb->getQuery();
$users = $query->execute(); $users = $query->execute();
$this->assertEquals(0, count($users)); $this->assertEquals(0, count($users));
} }
public function testQueryWithArrayOfEntitiesAsParameter() public function testQueryWithArrayOfEntitiesAsParameter()
{ {
$userA = new CmsUser; $userA = new CmsUser;
@ -509,31 +545,31 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$userA->username = 'beberlei'; $userA->username = 'beberlei';
$userA->status = 'developer'; $userA->status = 'developer';
$this->_em->persist($userA); $this->_em->persist($userA);
$userB = new CmsUser; $userB = new CmsUser;
$userB->name = 'Roman'; $userB->name = 'Roman';
$userB->username = 'romanb'; $userB->username = 'romanb';
$userB->status = 'developer'; $userB->status = 'developer';
$this->_em->persist($userB); $this->_em->persist($userB);
$userC = new CmsUser; $userC = new CmsUser;
$userC->name = 'Jonathan'; $userC->name = 'Jonathan';
$userC->username = 'jwage'; $userC->username = 'jwage';
$userC->status = 'developer'; $userC->status = 'developer';
$this->_em->persist($userC); $this->_em->persist($userC);
$this->_em->flush(); $this->_em->flush();
$this->_em->clear(); $this->_em->clear();
$query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u IN (?0) OR u.username = ?1"); $query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u IN (?0) OR u.username = ?1");
$query->setParameter(0, array($userA, $userC)); $query->setParameter(0, array($userA, $userC));
$query->setParameter(1, 'beberlei'); $query->setParameter(1, 'beberlei');
$users = $query->execute(); $users = $query->execute();
$this->assertEquals(2, count($users)); $this->assertEquals(2, count($users));
} }
public function testQueryWithHiddenAsSelectExpression() public function testQueryWithHiddenAsSelectExpression()
{ {
$userA = new CmsUser; $userA = new CmsUser;
@ -541,25 +577,25 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$userA->username = 'beberlei'; $userA->username = 'beberlei';
$userA->status = 'developer'; $userA->status = 'developer';
$this->_em->persist($userA); $this->_em->persist($userA);
$userB = new CmsUser; $userB = new CmsUser;
$userB->name = 'Roman'; $userB->name = 'Roman';
$userB->username = 'romanb'; $userB->username = 'romanb';
$userB->status = 'developer'; $userB->status = 'developer';
$this->_em->persist($userB); $this->_em->persist($userB);
$userC = new CmsUser; $userC = new CmsUser;
$userC->name = 'Jonathan'; $userC->name = 'Jonathan';
$userC->username = 'jwage'; $userC->username = 'jwage';
$userC->status = 'developer'; $userC->status = 'developer';
$this->_em->persist($userC); $this->_em->persist($userC);
$this->_em->flush(); $this->_em->flush();
$this->_em->clear(); $this->_em->clear();
$query = $this->_em->createQuery("SELECT u, (SELECT COUNT(u2.id) FROM Doctrine\Tests\Models\CMS\CmsUser u2) AS HIDDEN total FROM Doctrine\Tests\Models\CMS\CmsUser u"); $query = $this->_em->createQuery("SELECT u, (SELECT COUNT(u2.id) FROM Doctrine\Tests\Models\CMS\CmsUser u2) AS HIDDEN total FROM Doctrine\Tests\Models\CMS\CmsUser u");
$users = $query->execute(); $users = $query->execute();
$this->assertEquals(3, count($users)); $this->assertEquals(3, count($users));
$this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $users[0]); $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUser', $users[0]);
} }