public function setRetries($count, $delay = 0) { $count = intval($count); $delay = intval($delay); if ($count < 0) { throw new \InvalidArgumentException('Retry count cannot be negative.'); } if ($delay < 0) { throw new \InvalidArgumentException('Retry delay cannot be negative.'); } $this->retrycount = $count; $this->retrydelay = $delay; return $this; }
public function testSetRetries() { $sphinx = new SphinxClient(); $sphinx->setRetries(3, 10); $this->assertSame($sphinx->retrycount, 3); $this->assertSame($sphinx->retrydelay, 10); }