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.
파일 보기 프로젝트 열기: simpletest/simpletest 1 사용 예제들

공개 메소드들

메소드 설명
__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.