Class Context
Context tracks the state of the runner - i.e the current Suite, and provides access to
Peridot's global state.
-
Peridot\Runner\Context
uses
Peridot\Core\HasEventEmitterTrait
Methods summary
public
|
#
clear( )
Clear the internal suite structure.
Clear the internal suite structure.
|
public
|
#
setFile( $path )
Set the file for the context. This file
generally represents the current file being used
to load suites.
Set the file for the context. This file
generally represents the current file being used
to load suites.
Parameters
|
public
string
|
|
public
Peridot\Core\Suite
|
|
public
|
#
addSuite( string $description, callable $fn, boolean|null $pending = null, boolean $focused = false )
Creates a suite and adds it to the current suite. The newly
created suite will become the new "current" suite
Creates a suite and adds it to the current suite. The newly
created suite will become the new "current" suite
Parameters
- $description
- $fn
- $pending
- $focused
|
public
|
#
addTest( string $description, callable $fn = null, boolean|null $pending = null, boolean $focused = false )
Create a test and add it to the current suite
Create a test and add it to the current suite
Parameters
- $description
- $fn
- $pending
- $focused
|
public
|
#
addSetupFunction( callable $fn )
Add a setup function for all tests in the
current suite
Add a setup function for all tests in the
current suite
Parameters
|
public
|
#
addTearDownFunction( callable $fn )
Add a tear down function for all tests in the current suite
Add a tear down function for all tests in the current suite
Parameters
|
public static
Peridot\Runner\Context
|
#
getInstance( )
Singleton access to Context
Singleton access to Context
Returns
|
Properties summary
protected
array
|
$suites
|
|
protected
string
|
$file
|
|