PHP 클래스 kahlan\matcher\ToThrow

파일 보기 프로젝트 열기: crysalead/kahlan 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_description array Description reference of the last ::match() call.

공개 메소드들

메소드 설명
_buildDescription ( object $actual, object $expected ) Build the description of the runned ::match() call.
_matchException ( object $actual, $exception ) : boolean Compares if two exception are similar.
_sameMessage ( string $actual, string $expected ) : boolean Compare if exception messages are similar.
actual ( mixed $actual ) : mixed Normalise the actual value as an Exception.
description ( ) Returns the description report.
expected ( mixed $expected, integer $code ) : mixed Normalise the expected value as an Exception.
match ( Closure $actual, mixed $expected = null, integer $code ) : boolean Checks that $actual throws the $expected exception.

메소드 상세

_buildDescription() 공개 정적인 메소드

Build the description of the runned ::match() call.
public static _buildDescription ( object $actual, object $expected )
$actual object The actual exception instance.
$expected object The expected exception instance.

_matchException() 공개 정적인 메소드

Compares if two exception are similar.
public static _matchException ( object $actual, $exception ) : boolean
$actual object The actual instance.
리턴 boolean

_sameMessage() 공개 정적인 메소드

Compare if exception messages are similar.
public static _sameMessage ( string $actual, string $expected ) : boolean
$actual string The actual message.
$expected string The expected message.
리턴 boolean

actual() 공개 정적인 메소드

Normalise the actual value as an Exception.
public static actual ( mixed $actual ) : mixed
$actual mixed The actual value to be normalized.
리턴 mixed The normalised value.

description() 공개 정적인 메소드

Returns the description report.
public static description ( )

expected() 공개 정적인 메소드

Normalise the expected value as an Exception.
public static expected ( mixed $expected, integer $code ) : mixed
$expected mixed The expected value to be normalized.
$code integer The expected `Exception` code if `$expected` is a string.
리턴 mixed The normalised value.

match() 공개 정적인 메소드

The value passed to $expected is either an exception or the expected exception's message.
public static match ( Closure $actual, mixed $expected = null, integer $code ) : boolean
$actual Closure The closure to run.
$expected mixed A string indicating what the error text is expected to be or a exception instance.
$code integer The expected `Exception` code if `$expected` is a string.
리턴 boolean

프로퍼티 상세

$_description 공개적으로 정적으로 프로퍼티

Description reference of the last ::match() call.
public static array $_description
리턴 array