Eloquent\Phony\Spy\SpyVerifier::checkResponded PHP Метод

checkResponded() публичный Метод

Checks if this spy responded.
public checkResponded ( ) : Eloquent\Phony\Event\EventCollection | null
Результат Eloquent\Phony\Event\EventCollection | null The result.
    public function checkResponded()
    {
        $cardinality = $this->resetCardinality();
        $calls = $this->spy->allCalls();
        $matchingEvents = array();
        $totalCount = count($calls);
        $matchCount = 0;
        foreach ($calls as $call) {
            if ($responseEvent = $call->responseEvent()) {
                $matchingEvents[] = $responseEvent;
                ++$matchCount;
            }
        }
        if ($cardinality->matches($matchCount, $totalCount)) {
            return $this->assertionRecorder->createSuccess($matchingEvents);
        }
    }