PHP Класс TestSuite, simpletest

4) Each testXXX() method must return either TEST_PASSED or TEST_FAILED. If it does not, it is marked as being defective.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный статический Метод

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

getLabel() публичный Метод

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
Результат string Name of the test.

getSize() публичный Метод

Number of contained test cases.
public getSize ( ) : integer
Результат integer Total count of cases in the group.

run() публичный Метод

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