PHP Class Bolt\Tests\BoltListener

Author: Gawain Lynch ([email protected])
Inheritance: implements PHPUnit_Framework_TestListener
Show file Open project: bolt/bolt

Protected Properties

Property Type Description
$boltdb string
$configs array
$currentSuite string
$reset boolean
$theme string
$timer boolean
$tracker array

Public Methods

Method Description
__construct ( array $configs = [], boolean $theme = false, boolean $boltDb = false, boolean $reset = true, boolean $timer = true ) Called on init of PHPUnit exectution.
__destruct ( ) Destructor that will be called at the completion of the PHPUnit execution.
addError ( PHPUnit_Framework_Test $test, Exception $e, float $time ) An error occurred.
addFailure ( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time ) A failure occurred.
addIncompleteTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) A test was incomplete.
addRiskyTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) A test is deemed risky.
addSkippedTest ( PHPUnit_Framework_Test $test, Exception $e, float $time ) Test has been skipped.
endTest ( PHPUnit_Framework_Test $test, float $time ) A test ended.
endTestSuite ( PHPUnit_Framework_TestSuite $suite ) A test suite ended.
startTest ( PHPUnit_Framework_Test $test ) A test started.
startTestSuite ( PHPUnit_Framework_TestSuite $suite ) A test suite started.

Protected Methods

Method Description
getBoltDb ( string $boltdb ) : string Get the Bolt unit test Sqlite database.
getConfigs ( array $configs ) : array Get a valid array of configuration files.
getPath ( string $name, string $file ) : string Resolve a file path.
getTheme ( string $theme ) : string Get the path to the theme to be used in the unit test.

Private Methods

Method Description
buildTestEnv ( ) Build the pre-requisites for our test environment
cleanTestEnv ( ) Clean up after test runs

Method Details

__construct() public method

Called on init of PHPUnit exectution.
See also: PHPUnit_Util_Configuration
public __construct ( array $configs = [], boolean $theme = false, boolean $boltDb = false, boolean $reset = true, boolean $timer = true )
$configs array Location of configuration files
$theme boolean Location of the theme
$boltDb boolean Location of Sqlite database
$reset boolean Reset test environment after run
$timer boolean Create test execution timer output

__destruct() public method

Add code here to clean up our test environment.
public __destruct ( )

addError() public method

An error occurred.
See also: PHPUnit_Framework_TestListener::addError()
public addError ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

addFailure() public method

A failure occurred.
See also: PHPUnit_Framework_TestListener::addFailure()
public addFailure ( PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, float $time )
$test PHPUnit_Framework_Test
$e PHPUnit_Framework_AssertionFailedError
$time float

addIncompleteTest() public method

A test was incomplete.
See also: PHPUnit_Framework_TestListener::addIncompleteTest()
public addIncompleteTest ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

addRiskyTest() public method

A test is deemed risky.
See also: PHPUnit_Framework_TestListener::addRiskyTest()
public addRiskyTest ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

addSkippedTest() public method

Test has been skipped.
See also: PHPUnit_Framework_TestListener::addSkippedTest()
public addSkippedTest ( PHPUnit_Framework_Test $test, Exception $e, float $time )
$test PHPUnit_Framework_Test
$e Exception
$time float

endTest() public method

A test ended.
See also: PHPUnit_Framework_TestListener::endTest()
public endTest ( PHPUnit_Framework_Test $test, float $time )
$test PHPUnit_Framework_Test
$time float

endTestSuite() public method

A test suite ended.
See also: PHPUnit_Framework_TestListener::endTestSuite()
public endTestSuite ( PHPUnit_Framework_TestSuite $suite )
$suite PHPUnit_Framework_TestSuite

getBoltDb() protected method

Get the Bolt unit test Sqlite database.
protected getBoltDb ( string $boltdb ) : string
$boltdb string
return string

getConfigs() protected method

Get a valid array of configuration files.
protected getConfigs ( array $configs ) : array
$configs array
return array

getPath() protected method

Resolve a file path.
protected getPath ( string $name, string $file ) : string
$name string
$file string
return string

getTheme() protected method

Get the path to the theme to be used in the unit test.
protected getTheme ( string $theme ) : string
$theme string
return string

startTest() public method

A test started.
See also: PHPUnit_Framework_TestListener::startTest()
public startTest ( PHPUnit_Framework_Test $test )
$test PHPUnit_Framework_Test

startTestSuite() public method

A test suite started.
See also: PHPUnit_Framework_TestListener::startTestSuite()
public startTestSuite ( PHPUnit_Framework_TestSuite $suite )
$suite PHPUnit_Framework_TestSuite

Property Details

$boltdb protected property

protected string $boltdb
return string

$configs protected property

protected array $configs
return array

$currentSuite protected property

protected string $currentSuite
return string

$reset protected property

protected bool $reset
return boolean

$theme protected property

protected string $theme
return string

$timer protected property

protected bool $timer
return boolean

$tracker protected property

protected array $tracker
return array