public function setLimit($limit) { if ($limit < 1 || !is_int($limit)) { throw new \InvalidArgumentException('setLimit() accepts only integers greater 0.', 1263387249); } $this->limit = $limit; return $this; }
/** * @test * @expectedException \InvalidArgumentException */ public function setLimitRejectsIntegersLessThanOne() { $this->query->setLimit(0); }