for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Rezzza\RestApiBehatExtension\Tolerance;
use Tolerance\Waiter\Waiter;
use Tolerance\Waiter\StatefulWaiter;
class ExecutionTimeLimited implements Waiter, StatefulWaiter
{
/**
* @var Waiter
*/
private $waiter;
private $maxExecutionTime;
private $timeEllapsed;
public function __construct(Waiter $waiter, $maxExecutionTime)
$this->waiter = $waiter;
$this->maxExecutionTime = $maxExecutionTime;
$this->timeEllapsed = 0;
}
* {@inheritdoc}
public function wait($seconds = 1)
$this->timeEllapsed += $seconds;
if ($this->maxExecutionTime < $this->timeEllapsed) {
throw MaxExecutionTimeReached::withValue($this->maxExecutionTime);
$this->waiter->wait($seconds);
public function resetState()
// wait to fix https://github.com/Tolerance/Tolerance/pull/66