Alex\BehatLauncher\Behat\LazyRunUnitList::__construct PHP Method

__construct() public method

Creates a new lazy-loaded run unit list.
public __construct ( MysqlStorage $storage, Run $run, $pending, $running, $succeeded, $failed )
$storage MysqlStorage a storage for fetching run units
$run Run the concerned run
    public function __construct(MysqlStorage $storage, Run $run, $pending, $running, $succeeded, $failed)
    {
        $this->storage = $storage;
        $this->run = $run;
        $this->cacheCount['all'] = $all = $pending + $running + $succeeded + $failed;
        $this->cacheCount['pending'] = $pending;
        $this->cacheCount['running'] = $running;
        $this->cacheCount['succeeded'] = $succeeded;
        $this->cacheCount['failed'] = $failed;
        $this->cacheCount['finished'] = $finished = $succeeded + $failed;
        $this->cacheCount['is_pending'] = $pending && !$running;
        $this->cacheCount['is_running'] = $running > 0;
        $this->cacheCount['is_succeeded'] = $all == $succeeded;
        $this->cacheCount['is_failed'] = $all == $finished && $failed > 0;
        $this->cacheCount['is_finished'] = $all == $finished;
    }