PHP 클래스 SimpleFileLoader, simpletest

파일 보기 프로젝트 열기: simpletest/simpletest 1 사용 예제들

공개 메소드들

메소드 설명
createSuiteFromClasses ( string $title, array $classes ) : TestSuite Builds a test suite from a class list.
load ( string $test_file ) : TestSuite Builds a test suite from a library of test cases.
selectRunnableTests ( array $candidates ) : array Calculates the incoming test cases. Skips abstract and ignored classes.

보호된 메소드들

메소드 설명
makeFileVariablesGlobal ( hash $existing, hash $new ) Imports new variables into the global namespace.
scrapeClassesFromFile ( string $file ) : string Lookup classnames from file contents, in case the file may have been included before.

메소드 상세

createSuiteFromClasses() 공개 메소드

Builds a test suite from a class list.
public createSuiteFromClasses ( string $title, array $classes ) : TestSuite
$title string Title of new group.
$classes array Test classes.
리턴 TestSuite Group loaded with the new test cases.

load() 공개 메소드

The new suite is composed into this one.
public load ( string $test_file ) : TestSuite
$test_file string File name of library with test case classes.
리턴 TestSuite The new test suite.

makeFileVariablesGlobal() 보호된 메소드

Imports new variables into the global namespace.
protected makeFileVariablesGlobal ( hash $existing, hash $new )
$existing hash Variables before the file was loaded.
$new hash Variables after the file was loaded.

scrapeClassesFromFile() 보호된 메소드

Note: This is probably too clever by half. Figuring this out after a failed test case is going to be tricky for us, never mind the user. A test case should not be included twice anyway.
protected scrapeClassesFromFile ( string $file ) : string
$file string Test File name with classes.
리턴 string classnames

selectRunnableTests() 공개 메소드

Calculates the incoming test cases. Skips abstract and ignored classes.
public selectRunnableTests ( array $candidates ) : array
$candidates array Candidate classes.
리턴 array New classes which are test cases that shouldn't be ignored.