PHP Класс PHPUnit_Framework_TestSuite, phpunit

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

Защищенные свойства (Protected)

Свойство Тип Описание
$backupGlobals boolean Enable or disable the backup and restoration of the $GLOBALS array.
$backupStaticAttributes boolean Enable or disable the backup and restoration of static attributes.
$foundClasses array
$groups array The test groups of the test suite.
$name string The name of the test suite.
$numTests integer The number of tests in the test suite.
$runTestInSeparateProcess boolean
$testCase boolean
$tests array The tests in the test suite.

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

Метод Описание
__construct ( mixed $theClass = '', string $name = '' ) Constructs a new TestSuite:
addTest ( PHPUnit_Framework_Test $test, array $groups = [] ) Adds a test to the suite.
addTestFile ( string $filename ) Wraps both addTest() and addTestSuite as well as the separate import statements for the user's convenience.
addTestFiles ( array | Iterator $filenames ) Wrapper for addTestFile() that adds multiple test files.
addTestSuite ( mixed $testClass ) Adds the tests from the given class to the suite.
count ( boolean $preferCache = false ) : integer Counts the number of test cases that will be run by this test.
createTest ( ReflectionClass $theClass, string $name ) : PHPUnit_Framework_Test
getGroupDetails ( )
getGroups ( ) : array Returns the test groups of the suite.
getIterator ( ) : RecursiveIteratorIterator Returns an iterator for this test suite.
getName ( ) : string Returns the name of the suite.
injectFilter ( PHPUnit_Runner_Filter_Factory $filter )
isTestMethod ( ReflectionMethod $method ) : boolean
markTestSuiteSkipped ( string $message = '' ) Mark the test suite as skipped.
run ( PHPUnit_Framework_TestResult $result = null ) : PHPUnit_Framework_TestResult Runs the tests and collects their result in a TestResult.
runTest ( PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result ) Runs a test.
setBackupGlobals ( boolean $backupGlobals )
setBackupStaticAttributes ( boolean $backupStaticAttributes )
setGroupDetails ( array $groups ) Set tests groups of the test case
setName ( $name ) Sets the name of the suite.
setRunTestInSeparateProcess ( boolean $runTestInSeparateProcess )
setTests ( array $tests ) Set tests of the test suite
setbeStrictAboutChangesToGlobalState ( boolean $beStrictAboutChangesToGlobalState )
testAt ( $index ) : PHPUnit_Framework_Test Returns the test at the given index.
tests ( ) : array Returns the tests as an enumeration.
toString ( ) : string Returns a string representation of the test suite.

Защищенные методы

Метод Описание
addTestMethod ( ReflectionClass $class, ReflectionMethod $method )
createResult ( ) : PHPUnit_Framework_TestResult Creates a default TestResult object.
incompleteTest ( string $class, string $methodName, string $message ) : PHPUnit_Framework_IncompleteTestCase
setUp ( ) Template Method that is called before the tests of this test suite are run.
skipTest ( string $class, string $methodName, string $message ) : PHPUnit_Framework_SkippedTestCase
tearDown ( ) Template Method that is called after the tests of this test suite have finished running.
warning ( string $message ) : PHPUnit_Framework_WarningTestCase

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

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

- PHPUnit_Framework_TestSuite() constructs an empty TestSuite. - PHPUnit_Framework_TestSuite(ReflectionClass) constructs a TestSuite from the given class. - PHPUnit_Framework_TestSuite(ReflectionClass, String) constructs a TestSuite from the given class with the given name. - PHPUnit_Framework_TestSuite(String) either constructs a TestSuite from the given class (if the passed string is the name of an existing class) or constructs an empty TestSuite with the given name.
public __construct ( mixed $theClass = '', string $name = '' )
$theClass mixed
$name string

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

Adds a test to the suite.
public addTest ( PHPUnit_Framework_Test $test, array $groups = [] )
$test PHPUnit_Framework_Test
$groups array

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

If the named file cannot be read or there are no new tests that can be added, a PHPUnit_Framework_WarningTestCase will be created instead, leaving the current test run untouched.
public addTestFile ( string $filename )
$filename string

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

Wrapper for addTestFile() that adds multiple test files.
public addTestFiles ( array | Iterator $filenames )
$filenames array | Iterator

addTestMethod() защищенный Метод

protected addTestMethod ( ReflectionClass $class, ReflectionMethod $method )
$class ReflectionClass
$method ReflectionMethod

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

Adds the tests from the given class to the suite.
public addTestSuite ( mixed $testClass )
$testClass mixed

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

Counts the number of test cases that will be run by this test.
public count ( boolean $preferCache = false ) : integer
$preferCache boolean Indicates if cache is preferred.
Результат integer

createResult() защищенный Метод

Creates a default TestResult object.
protected createResult ( ) : PHPUnit_Framework_TestResult
Результат PHPUnit_Framework_TestResult

createTest() публичный статический Метод

public static createTest ( ReflectionClass $theClass, string $name ) : PHPUnit_Framework_Test
$theClass ReflectionClass
$name string
Результат PHPUnit_Framework_Test

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

public getGroupDetails ( )

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

Returns the test groups of the suite.
public getGroups ( ) : array
Результат array

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

Returns an iterator for this test suite.

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

Returns the name of the suite.
public getName ( ) : string
Результат string

incompleteTest() защищенный статический Метод

protected static incompleteTest ( string $class, string $methodName, string $message ) : PHPUnit_Framework_IncompleteTestCase
$class string
$methodName string
$message string
Результат PHPUnit_Framework_IncompleteTestCase

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

public injectFilter ( PHPUnit_Runner_Filter_Factory $filter )
$filter PHPUnit_Runner_Filter_Factory

isTestMethod() публичный статический Метод

public static isTestMethod ( ReflectionMethod $method ) : boolean
$method ReflectionMethod
Результат boolean

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

Mark the test suite as skipped.
public markTestSuiteSkipped ( string $message = '' )
$message string

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

Runs the tests and collects their result in a TestResult.
public run ( PHPUnit_Framework_TestResult $result = null ) : PHPUnit_Framework_TestResult
$result PHPUnit_Framework_TestResult
Результат PHPUnit_Framework_TestResult

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

Runs a test.
Устаревший:
public runTest ( PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result )
$test PHPUnit_Framework_Test
$result PHPUnit_Framework_TestResult

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

public setBackupGlobals ( boolean $backupGlobals )
$backupGlobals boolean

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

public setBackupStaticAttributes ( boolean $backupStaticAttributes )
$backupStaticAttributes boolean

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

Set tests groups of the test case
public setGroupDetails ( array $groups )
$groups array

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

Sets the name of the suite.
public setName ( $name )

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

public setRunTestInSeparateProcess ( boolean $runTestInSeparateProcess )
$runTestInSeparateProcess boolean

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

Set tests of the test suite
public setTests ( array $tests )
$tests array

setUp() защищенный Метод

Template Method that is called before the tests of this test suite are run.
protected setUp ( )

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

public setbeStrictAboutChangesToGlobalState ( boolean $beStrictAboutChangesToGlobalState )
$beStrictAboutChangesToGlobalState boolean

skipTest() защищенный статический Метод

protected static skipTest ( string $class, string $methodName, string $message ) : PHPUnit_Framework_SkippedTestCase
$class string
$methodName string
$message string
Результат PHPUnit_Framework_SkippedTestCase

tearDown() защищенный Метод

Template Method that is called after the tests of this test suite have finished running.
protected tearDown ( )

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

Returns the test at the given index.
public testAt ( $index ) : PHPUnit_Framework_Test
Результат PHPUnit_Framework_Test

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

Returns the tests as an enumeration.
public tests ( ) : array
Результат array

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

Returns a string representation of the test suite.
public toString ( ) : string
Результат string

warning() защищенный статический Метод

protected static warning ( string $message ) : PHPUnit_Framework_WarningTestCase
$message string
Результат PHPUnit_Framework_WarningTestCase

Описание свойств

$backupGlobals защищенное свойство

Enable or disable the backup and restoration of the $GLOBALS array.
protected bool $backupGlobals
Результат boolean

$backupStaticAttributes защищенное свойство

Enable or disable the backup and restoration of static attributes.
protected bool $backupStaticAttributes
Результат boolean

$foundClasses защищенное свойство

protected array $foundClasses
Результат array

$groups защищенное свойство

The test groups of the test suite.
protected array $groups
Результат array

$name защищенное свойство

The name of the test suite.
protected string $name
Результат string

$numTests защищенное свойство

The number of tests in the test suite.
protected int $numTests
Результат integer

$runTestInSeparateProcess защищенное свойство

protected bool $runTestInSeparateProcess
Результат boolean

$testCase защищенное свойство

protected bool $testCase
Результат boolean

$tests защищенное свойство

The tests in the test suite.
protected array $tests
Результат array