PHP Class TestSuite, simpletest

4) Each testXXX() method must return either TEST_PASSED or TEST_FAILED. If it does not, it is marked as being defective.
Afficher le fichier Open project: simpletest/simpletest Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $label = false ) Sets the name of the test suite.
add ( SimpleTestCase $test_case ) Adds a test into the suite by instance or class.
addFile ( string $test_file ) Builds a test suite from a library of test cases.
collect ( string $path, SimpleCollector $collector ) Delegates to a visiting collector to add test files.
getBaseTestCase ( string $class ) Test to see if a class is derived from the SimpleTestCase class.
getLabel ( ) : string Accessor for the test name for subclasses. If the suite wraps a single test case the label defaults to the name of that test.
getSize ( ) : integer Number of contained test cases.
run ( SimpleReporter $reporter ) Invokes run() on all of the held test cases, instantiating them if necessary.

Method Details

__construct() public méthode

Sets the name of the test suite.
public __construct ( string $label = false )
$label string Name sent at the start and end of the test.

add() public méthode

The class will be instantiated if it's a test suite.
public add ( SimpleTestCase $test_case )
$test_case SimpleTestCase Suite or individual test case implementing the runnable test interface.

addFile() public méthode

The new suite is composed into this one.
public addFile ( string $test_file )
$test_file string File name of library with test case classes.

collect() public méthode

Delegates to a visiting collector to add test files.
public collect ( string $path, SimpleCollector $collector )
$path string Path to scan from.
$collector SimpleCollector Directory scanner.

getBaseTestCase() public static méthode

Test to see if a class is derived from the SimpleTestCase class.
public static getBaseTestCase ( string $class )
$class string Class name.

getLabel() public méthode

Accessor for the test name for subclasses. If the suite wraps a single test case the label defaults to the name of that test.
public getLabel ( ) : string
Résultat string Name of the test.

getSize() public méthode

Number of contained test cases.
public getSize ( ) : integer
Résultat integer Total count of cases in the group.

run() public méthode

Invokes run() on all of the held test cases, instantiating them if necessary.
public run ( SimpleReporter $reporter )
$reporter SimpleReporter Current test reporter.