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
Afficher le fichier Open project: jyxo/php

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

addTest() public méthode

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

getTestsData() public méthode

Returns tests data.
public getTestsData ( ) : array
Résultat array

run() public méthode

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

setParams() public méthode

public setParams ( array $params )
$params array