public function testCountQuery_RemovesLimits() { $query = $this->entityManager->createQuery('SELECT p, c, a FROM DoctrineExtensions\\Paginate\\BlogPost p JOIN p.category c JOIN p.author a'); $countQuery = Paginate::createCountQuery($query); $this->assertEquals("SELECT count(DISTINCT b0_.id) AS sclr0 FROM BlogPost b0_ INNER JOIN Category c1_ ON b0_.category_id = c1_.id INNER JOIN Author a2_ ON b0_.author_id = a2_.id", $countQuery->getSql()); }
/** * @return Query */ protected function createCountQuery() { return Paginate::createCountQuery($this->query); }