Eloquent\Phony\Verification\GeneratorVerifier::threw PHP Method

threw() public method

Throws an exception unless an exception of the supplied type was thrown from a generator.
public threw ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection
$type Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null An exception to match, the type of exception, or null for any exception.
return Eloquent\Phony\Event\EventCollection The result.
    public function threw($type = null)
    {
        $cardinality = $this->cardinality;
        if ($type instanceof Throwable || $type instanceof Exception) {
            $type = $this->matcherFactory->equalTo($type, true);
        } elseif ($this->matcherFactory->isMatcher($type)) {
            $type = $this->matcherFactory->adapt($type);
        }
        if ($result = $this->checkThrew($type)) {
            return $result;
        }
        return $this->assertionRecorder->createFailure($this->assertionRenderer->renderGeneratorThrew($this->subject, $cardinality, $type));
    }