PHP Class SimpleFileLoader, simpletest

Afficher le fichier Open project: simpletest/simpletest Class Usage Examples

Méthodes publiques

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

Méthodes protégées

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

Method Details

createSuiteFromClasses() public méthode

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.
Résultat TestSuite Group loaded with the new test cases.

load() public méthode

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.
Résultat TestSuite The new test suite.

makeFileVariablesGlobal() protected méthode

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() protected méthode

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.
Résultat string classnames

selectRunnableTests() public méthode

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