PHP Class Eloquent\Phony\Assertion\AssertionRenderer

Datei anzeigen Open project: eloquent/phony Class Usage Examples

Public Methods

Method Description
__construct ( MatcherVerifier $matcherVerifier, Eloquent\Phony\Exporter\Exporter $exporter, DifferenceEngine $differenceEngine, FeatureDetector $featureDetector ) Construct a new call renderer.
instance ( ) : AssertionRenderer Get the static instance of this renderer.
renderCalled ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality ) : string Render a failed called() verification.
renderCalledWith ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, array $matchers ) : string Render a failed calledWith() verification.
renderCompleted ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality ) : string Render a failed completed() verification.
renderGenerated ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality ) : string Render a failed generated() verification.
renderGeneratorReceived ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher $value = null ) : string Render a failed generator received() verification.
renderGeneratorReceivedException ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type ) : string Render a failed generator receivedException() verification.
renderGeneratorReturned ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher $value = null ) : string Render a failed generator returned() verification.
renderGeneratorThrew ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type ) : string Render a failed generator threw() verification.
renderInOrder ( array $expected, array $actual ) : string Render a failed inOrder() verification.
renderIterableConsumed ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, boolean $isGenerator ) : string Render a failed iterable consumed() verification.
renderIterableProduced ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, boolean $isGenerator, Eloquent\Phony\Matcher\Matcher $key = null, Eloquent\Phony\Matcher\Matcher $value = null ) : string Render a failed iterable produced() verification.
renderIterableUsed ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, boolean $isGenerator ) : string Render a failed iterable used() verification.
renderIterated ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality ) : string Render a failed iterated() verification.
renderMatchers ( array $matchers ) : string Render a sequence of matchers.
renderNoInteraction ( Eloquent\Phony\Mock\Handle\Handle $handle, array $calls ) : string Render a failed noInteraction() verification.
renderResponded ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality ) : string Render a failed responded() verification.
renderReturned ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher $value = null ) : string Render a failed responded() verification.
renderThrew ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher | string | null $type ) : string Render a failed threw() verification.
renderValue ( mixed $value ) : string Render a value.
setUseColor ( boolean | null $useColor ) Turn on or off the use of ANSI colored output.

Private Methods

Method Description
renderCardinality ( $minimum, $maximum, $matchCount, $totalCount, $callCount, $isFailureCause )
renderEvents ( $events )

Method Details

__construct() public method

Construct a new call renderer.
public __construct ( MatcherVerifier $matcherVerifier, Eloquent\Phony\Exporter\Exporter $exporter, DifferenceEngine $differenceEngine, FeatureDetector $featureDetector )
$matcherVerifier Eloquent\Phony\Matcher\MatcherVerifier The matcher verifier to use.
$exporter Eloquent\Phony\Exporter\Exporter The exporter to use.
$differenceEngine Eloquent\Phony\Difference\DifferenceEngine The difference engine to use.
$featureDetector Eloquent\Phony\Reflection\FeatureDetector The feature detector to use.

instance() public static method

Get the static instance of this renderer.
public static instance ( ) : AssertionRenderer
return AssertionRenderer The static renderer.

renderCalled() public method

Render a failed called() verification.
public renderCalled ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
return string The rendered failure message.

renderCalledWith() public method

Render a failed calledWith() verification.
public renderCalledWith ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, array $matchers ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
$matchers array
return string The rendered failure message.

renderCompleted() public method

Render a failed completed() verification.
public renderCompleted ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
return string The rendered failure message.

renderGenerated() public method

Render a failed generated() verification.
public renderGenerated ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
return string The rendered failure message.

renderGeneratorReceived() public method

Render a failed generator received() verification.
public renderGeneratorReceived ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher $value = null ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
$value Eloquent\Phony\Matcher\Matcher The value.
return string The rendered failure message.

renderGeneratorReceivedException() public method

Render a failed generator receivedException() verification.
public renderGeneratorReceivedException ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
$type Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null The type of exception.
return string The rendered failure message.

renderGeneratorReturned() public method

Render a failed generator returned() verification.
public renderGeneratorReturned ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher $value = null ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
$value Eloquent\Phony\Matcher\Matcher The value.
return string The rendered failure message.

renderGeneratorThrew() public method

Render a failed generator threw() verification.
public renderGeneratorThrew ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null $type ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
$type Eloquent\Phony\Matcher\Matcher | Exceptio\Exception | Erro\Error | string | null The type of exception.
return string The rendered failure message.

renderInOrder() public method

Render a failed inOrder() verification.
public renderInOrder ( array $expected, array $actual ) : string
$expected array
$actual array
return string The rendered failure message.

renderIterableConsumed() public method

Render a failed iterable consumed() verification.
public renderIterableConsumed ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, boolean $isGenerator ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
$isGenerator boolean True if this verification is for a generator.
return string The rendered failure message.

renderIterableProduced() public method

Render a failed iterable produced() verification.
public renderIterableProduced ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, boolean $isGenerator, Eloquent\Phony\Matcher\Matcher $key = null, Eloquent\Phony\Matcher\Matcher $value = null ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
$isGenerator boolean True if this verification is for a generator.
$key Eloquent\Phony\Matcher\Matcher The key.
$value Eloquent\Phony\Matcher\Matcher The value.
return string The rendered failure message.

renderIterableUsed() public method

Render a failed iterable used() verification.
public renderIterableUsed ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, boolean $isGenerator ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
$isGenerator boolean True if this verification is for a generator.
return string The rendered failure message.

renderIterated() public method

Render a failed iterated() verification.
public renderIterated ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
return string The rendered failure message.

renderMatchers() public method

Render a sequence of matchers.
public renderMatchers ( array $matchers ) : string
$matchers array
return string The rendered matchers.

renderNoInteraction() public method

Render a failed noInteraction() verification.
public renderNoInteraction ( Eloquent\Phony\Mock\Handle\Handle $handle, array $calls ) : string
$handle Eloquent\Phony\Mock\Handle\Handle The handle.
$calls array
return string The rendered failure message.

renderResponded() public method

Render a failed responded() verification.
public renderResponded ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
return string The rendered failure message.

renderReturned() public method

Render a failed responded() verification.
public renderReturned ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher $value = null ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
$value Eloquent\Phony\Matcher\Matcher The value.
return string The rendered failure message.

renderThrew() public method

Render a failed threw() verification.
public renderThrew ( Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call $subject, Cardinality $cardinality, Eloquent\Phony\Matcher\Matcher | string | null $type ) : string
$subject Eloquent\Phony\Spy\Spy | Eloquent\Phony\Call\Call The subject.
$cardinality Eloquent\Phony\Verification\Cardinality The cardinality.
$type Eloquent\Phony\Matcher\Matcher | string | null The type of exception.
return string The rendered failure message.

renderValue() public method

Render a value.
public renderValue ( mixed $value ) : string
$value mixed The value.
return string The rendered value.

setUseColor() public method

Pass null to detect automatically.
public setUseColor ( boolean | null $useColor )
$useColor boolean | null True to use color.