Eloquent\Phony\Call\CallVerifier::checkGenerated PHP Method

checkGenerated() public method

Checks if this call returned a generator.
public checkGenerated ( ) : GeneratorVerifier | null
return Eloquent\Phony\Verification\GeneratorVerifier | null The result.
    public function checkGenerated()
    {
        $cardinality = $this->resetCardinality()->assertSingular();
        if ($this->call->responseEvent()) {
            list(, $returnValue) = $this->call->response();
            $isMatch = $returnValue instanceof Generator;
        } else {
            $isMatch = false;
        }
        list($matchCount, $matchingEvents) = $this->matchIf($this->call, $isMatch);
        if ($cardinality->matches($matchCount, 1)) {
            return $this->assertionRecorder->createSuccessFromEventCollection($this->generatorVerifierFactory->create($this->call, $matchingEvents));
        }
    }