PHP Class kahlan\Specification

Inheritance: extends Scope
Afficher le fichier Open project: crysalead/kahlan Class Usage Examples

Protected Properties

Свойство Type Description
$_expectations Expectation[] List of expectations.
$_return mixed Store the return value of the spec closure.

Méthodes publiques

Méthode Description
__construct ( array $config = [] ) Constructor.
expect ( Expectation $actual, $timeout ) : Expectation[] The expect statement.
logs ( ) : array Returns execution log.
passed ( &$return = null ) : boolean Checks if all test passed.
waitsFor ( Expectation $actual, $timeout ) : mixed The waitsFor statement.

Méthodes protégées

Méthode Description
_execute ( ) Processes the spec.
_process ( ) Processes a child specs.
_specEnd ( $runAfterEach = true ) Spec end helper.
_specStart ( ) Spec start helper.

Method Details

__construct() public méthode

Constructor.
public __construct ( array $config = [] )
$config array The Suite config array. Options are: -`'closure'` _Closure_ : the closure of the test. -`'message'` _string_ : the spec message. -`'scope'` _string_ : supported scope are `'normal'` & `'focus'`.

_execute() protected méthode

Processes the spec.
protected _execute ( )

_process() protected méthode

Processes a child specs.
See also: Kahlan\Suite::process()
protected _process ( )

_specEnd() protected méthode

Spec end helper.
protected _specEnd ( $runAfterEach = true )

_specStart() protected méthode

Spec start helper.
protected _specStart ( )

expect() public méthode

The expect statement.
public expect ( Expectation $actual, $timeout ) : Expectation[]
$actual Expectation The expression to check
Résultat Expectation[]

logs() public méthode

Returns execution log.
public logs ( ) : array
Résultat array

passed() public méthode

Checks if all test passed.
public passed ( &$return = null ) : boolean
Résultat boolean Returns `true` if no error occurred, `false` otherwise.

waitsFor() public méthode

The waitsFor statement.
public waitsFor ( Expectation $actual, $timeout ) : mixed
$actual Expectation The expression to check
Résultat mixed

Property Details

$_expectations protected_oe property

List of expectations.
protected Expectation[],kahlan $_expectations
Résultat Expectation[]

$_return protected_oe property

Store the return value of the spec closure.
protected mixed $_return
Résultat mixed