PHP Class Eloquent\Phony\Verification\GeneratorVerifier

Inheritance: extends IterableVerifier
Show file Open project: eloquent/phony

Public Methods

Method Description
__construct ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, array $calls, MatcherFactory $matcherFactory, CallVerifierFactory $callVerifierFactory, Eloquent\Phony\Assertion\AssertionRecorder $assertionRecorder, AssertionRenderer $assertionRenderer ) Construct a new generator verifier.
checkReceived ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection | null Checks if the subject received the supplied value.
checkReceivedException ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection | null Checks if the subject received an exception of the supplied type.
checkReturned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection | null Checks if the subject returned the supplied value from a generator.
checkThrew ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection | null Checks if an exception of the supplied type was thrown from a generator.
received ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection Throws an exception unless the subject received the supplied value.
receivedException ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection Throws an exception unless the subject received an exception of the supplied type.
returned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection Throws an exception unless the subject returned the supplied value from a generator.
threw ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection Throws an exception unless an exception of the supplied type was thrown from a generator.

Method Details

__construct() public method

Construct a new generator verifier.
public __construct ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, array $calls, MatcherFactory $matcherFactory, CallVerifierFactory $callVerifierFactory, Eloquent\Phony\Assertion\AssertionRecorder $assertionRecorder, AssertionRenderer $assertionRenderer )
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$calls array
$matcherFactory Eloquent\Phony\Matcher\MatcherFactory The matcher factory to use.
$callVerifierFactory Eloquent\Phony\Call\CallVerifierFactory The call verifier factory to use.
$assertionRecorder Eloquent\Phony\Assertion\AssertionRecorder The assertion recorder to use.
$assertionRenderer Eloquent\Phony\Assertion\AssertionRenderer The assertion renderer to use.

checkReceived() public method

When called with no arguments, this method simply checks that the subject received any value.
public checkReceived ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection | null
$value mixed The value.
return Eloquent\Phony\Event\EventCollection | null The result.

checkReceivedException() public method

Checks if the subject received an exception of the supplied type.
public checkReceivedException ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection | null
$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 | null The result.

checkReturned() public method

Checks if the subject returned the supplied value from a generator.
public checkReturned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection | null
$value mixed The value.
return Eloquent\Phony\Event\EventCollection | null The result.

checkThrew() public method

Checks if an exception of the supplied type was thrown from a generator.
public checkThrew ( Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type = null ) : Eloquent\Phony\Event\EventCollection | null
$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 | null The result.

received() public method

When called with no arguments, this method simply checks that the subject received any value.
public received ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection
$value mixed The value.
return Eloquent\Phony\Event\EventCollection The result.

receivedException() public method

Throws an exception unless the subject received an exception of the supplied type.
public receivedException ( 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.

returned() public method

Throws an exception unless the subject returned the supplied value from a generator.
public returned ( mixed $value = null ) : Eloquent\Phony\Event\EventCollection
$value mixed The value.
return Eloquent\Phony\Event\EventCollection The result.

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.