/** * @param int $maxPerPage */ public function setMaxPerPage($maxPerPage) { if ($maxPerPage > 0) { $this->maxPerPage = $maxPerPage; $this->query->setMaxResults($maxPerPage); } else { $this->maxPerPage = 0; $this->query->setMaxResults(Query::INFINITY); } $this->calculateFirstResult(); }
public function testSetMaxResults() { $this->searchQuery->expects($this->once())->method('setMaxResults')->with(self::TEST_VALUE); $this->query->setMaxResults(self::TEST_VALUE); }