PHP Class kahlan\Specification

Inheritance: extends Scope
Datei anzeigen Open project: crysalead/kahlan Class Usage Examples

Protected Properties

Property Type Description
$_expectations Expectation[] List of expectations.
$_return mixed Store the return value of the spec closure.

Public Methods

Method 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.

Protected Methods

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

Method Details

__construct() public method

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 method

Processes the spec.
protected _execute ( )

_process() protected method

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

_specEnd() protected method

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

_specStart() protected method

Spec start helper.
protected _specStart ( )

expect() public method

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

logs() public method

Returns execution log.
public logs ( ) : array
return array

passed() public method

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

waitsFor() public method

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

Property Details

$_expectations protected_oe property

List of expectations.
protected Expectation[],kahlan $_expectations
return Expectation[]

$_return protected_oe property

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