PHP Class Jyxo\Beholder\Executor

Includes filtering and HTML output formatting. Tests are performed in random order but results are outputted in alphabetical order with the order they were performed. Example: $beholder = new \Jyxo\Beholder\Executor('Project', $_GET); $beholder->addTest('T1', new \Project\Beholder\Test1('Test 1')); $beholder->addTest('T2', new \Project\Beholder\Test2('Test 2')); $beholder->addTest('T3', new \Project\Beholder\Test3Blah('Test 3 Blah')); $beholder->run();
Author: Jan Matoušek
Author: Jaroslav Hanslík
Datei anzeigen Open project: jyxo/php

Public Methods

Method Description
__construct ( string $project, array $params = [] ) Constructor.
addTest ( string $ident, TestCase $test ) : self Adds a test.
getTestsData ( ) : array Returns tests data.
run ( ) : boolean Performs chosen tests and outputs results according to the selected output type.
setParams ( array $params )

Private Methods

Method Description
includeTest ( string $ident ) : boolean Checks if the given test will be performed according to the current filter settings.
patternMatch ( string $pattern, string $string ) : boolean Checks if the given string matches the given pattern.
runTest ( string $ident ) : array Runs a single test.
writeHtml ( boolean $allSucceeded ) Outputs results in HTML form.
writeText ( boolean $allSucceeded ) Outputs results in plaintext.

Method Details

__construct() public method

Constructor.
public __construct ( string $project, array $params = [] )
$project string Project name
$params array Parameters; possible parameters are: include, exclude, output

addTest() public method

Adds a test.
public addTest ( string $ident, TestCase $test ) : self
$ident string Tests identifier
$test TestCase Test instance
return self

getTestsData() public method

Returns tests data.
public getTestsData ( ) : array
return array

run() public method

Performs chosen tests and outputs results according to the selected output type.
public run ( ) : boolean
return boolean Returns if all tests were successful

setParams() public method

public setParams ( array $params )
$params array