PHP Класс SimpleFileLoader, simpletest

Показать файл Открыть проект Примеры использования класса

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

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