/** * @throws \UnderflowException * @return \NetBox\ProxyManager\Proxy\Proxy */ public function select() { $proxy = parent::select(); if (!is_null($proxy->getUsedAt())) { $delta = time() - $proxy->getUsedAt(); if ($delta < $this->timeout) { $sleepSeconds = (int) ($this->timeout - $delta); sleep($sleepSeconds); } } return $proxy; }
public function testSelectExceptionHasRightMessage() { $this->setExpectedException('UnderflowException', 'No proxies in list'); $this->object->select(); }