PHP 클래스 kahlan\Expectation

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

보호된 프로퍼티들

프로퍼티 타입 설명
$_actual mixed The current value to test.
$_deferred array Deferred expectation.
$_logs array The result logs.
$_not boolean If true, the result of the test will be inverted.
$_passed boolean Stores the success value.
$_timeout integer The timeout value.

공개 메소드들

메소드 설명
__call ( string $matcherName, array $args ) : boolean Calls a registered matcher.
__construct ( array $config = [] ) Constructor.
__get ( $name ) Magic getter, if called with 'not' invert the _not attribute.
_matcher ( string $matcherName, mixed $actual ) : string Returns a compatible matcher class name according to a passed actual value.
actual ( ) : boolean Returns the actual value.
clear ( ) Clears the instance.
deferred ( ) : array Returns the deferred expectations.
logs ( ) Returns the logs.
not ( ) : boolean Returns the not value.
passed ( ) : boolean Checks if all test passed.
timeout ( ) Returns the timeout value.

보호된 메소드들

메소드 설명
_log ( boolean $boolean, array $data = [] ) : boolean Logs a result.
_resolve ( ) Resolves deferred matchers.
_run ( ) : mixed Processes the expectation.
_spin ( Closure $closure ) Runs the expectation.

메소드 상세

__call() 공개 메소드

Calls a registered matcher.
public __call ( string $matcherName, array $args ) : boolean
$matcherName string The name of the matcher.
$args array The arguments to pass to the matcher.
리턴 boolean

__construct() 공개 메소드

Constructor.
public __construct ( array $config = [] )
$config array The config array. Options are: -`'actual'` _mixed_ : the actual value. -`'timeout'` _integer_ : the timeout value.

__get() 공개 메소드

Magic getter, if called with 'not' invert the _not attribute.
public __get ( $name )

_log() 보호된 메소드

Logs a result.
protected _log ( boolean $boolean, array $data = [] ) : boolean
$boolean boolean Set `true` for success and `false` for failure.
$data array Test details array.
리턴 boolean

_matcher() 공개 메소드

Returns a compatible matcher class name according to a passed actual value.
public _matcher ( string $matcherName, mixed $actual ) : string
$matcherName string The name of the matcher.
$actual mixed The actual value.
리턴 string A matcher class name.

_resolve() 보호된 메소드

Resolves deferred matchers.
protected _resolve ( )

_run() 보호된 메소드

Processes the expectation.
protected _run ( ) : mixed
리턴 mixed

_spin() 보호된 메소드

Runs the expectation.
protected _spin ( Closure $closure )
$closure Closure The closure to run/spin.

actual() 공개 메소드

Returns the actual value.
public actual ( ) : boolean
리턴 boolean

clear() 공개 메소드

Clears the instance.
public clear ( )

deferred() 공개 메소드

Returns the deferred expectations.
public deferred ( ) : array
리턴 array

logs() 공개 메소드

Returns the logs.
public logs ( )

not() 공개 메소드

Returns the not value.
public not ( ) : boolean
리턴 boolean

passed() 공개 메소드

Checks if all test passed.
public passed ( ) : boolean
리턴 boolean Returns `true` if no error occurred, `false` otherwise.

timeout() 공개 메소드

Returns the timeout value.
public timeout ( )

프로퍼티 상세

$_actual 보호되어 있는 프로퍼티

The current value to test.
protected mixed $_actual
리턴 mixed

$_deferred 보호되어 있는 프로퍼티

Deferred expectation.
protected array $_deferred
리턴 array

$_logs 보호되어 있는 프로퍼티

The result logs.
protected array $_logs
리턴 array

$_not 보호되어 있는 프로퍼티

If true, the result of the test will be inverted.
protected bool $_not
리턴 boolean

$_passed 보호되어 있는 프로퍼티

Stores the success value.
protected bool $_passed
리턴 boolean

$_timeout 보호되어 있는 프로퍼티

The timeout value.
protected int $_timeout
리턴 integer