PHPUnit_Extensions_PhptTestSuite
extends PHPUnit_Framework_TestSuite
in package
Suite for .phpt test cases.
Tags
Table of Contents
- $backupGlobals : bool
- Enable or disable the backup and restoration of the $GLOBALS array.
- $backupStaticAttributes : bool
- Enable or disable the backup and restoration of static attributes.
- $foundClasses : array<string|int, mixed>
- $groups : array<string|int, mixed>
- The test groups of the test suite.
- $name : string
- The name of the test suite.
- $numTests : int
- The number of tests in the test suite.
- $runTestInSeparateProcess : bool
- $testCase : bool
- $tests : array<string|int, mixed>
- The tests in the test suite.
- $cachedNumTests : int|null
- Last count of tests in this suite.
- $disallowChangesToGlobalState : bool
- $iteratorFilter : PHPUnit_Runner_Filter_Factory
- __construct() : mixed
- Constructs a new TestSuite for .phpt test cases.
- addTest() : mixed
- Adds a test to the suite.
- addTestFile() : mixed
- Wraps both <code>addTest()</code> and <code>addTestSuite</code> as well as the separate import statements for the user's convenience.
- addTestFiles() : mixed
- Wrapper for addTestFile() that adds multiple test files.
- addTestSuite() : mixed
- Adds the tests from the given class to the suite.
- count() : int
- Counts the number of test cases that will be run by this test.
- createTest() : PHPUnit_Framework_Test
- getGroupDetails() : mixed
- getGroups() : array<string|int, mixed>
- 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() : mixed
- isTestMethod() : bool
- markTestSuiteSkipped() : mixed
- Mark the test suite as skipped.
- run() : PHPUnit_Framework_TestResult
- Runs the tests and collects their result in a TestResult.
- runTest() : mixed
- Runs a test.
- setBackupGlobals() : mixed
- setBackupStaticAttributes() : mixed
- setDisallowChangesToGlobalState() : mixed
- setGroupDetails() : mixed
- Set tests groups of the test case
- setName() : mixed
- Sets the name of the suite.
- setRunTestInSeparateProcess() : mixed
- setTests() : mixed
- Set tests of the test suite
- testAt() : PHPUnit_Framework_Test
- Returns the test at the given index.
- tests() : array<string|int, mixed>
- Returns the tests as an enumeration.
- toString() : string
- Returns a string representation of the test suite.
- addTestMethod() : mixed
- createResult() : PHPUnit_Framework_TestResult
- Creates a default TestResult object.
- incompleteTest() : PHPUnit_Framework_IncompleteTestCase
- setUp() : mixed
- Template Method that is called before the tests of this test suite are run.
- skipTest() : PHPUnit_Framework_SkippedTestCase
- tearDown() : mixed
- Template Method that is called after the tests of this test suite have finished running.
- warning() : PHPUnit_Framework_Warning
Properties
$backupGlobals
Enable or disable the backup and restoration of the $GLOBALS array.
protected
bool
$backupGlobals
=
ull
$backupStaticAttributes
Enable or disable the backup and restoration of static attributes.
protected
bool
$backupStaticAttributes
=
ull
$foundClasses
protected
array<string|int, mixed>
$foundClasses
= array()
$groups
The test groups of the test suite.
protected
array<string|int, mixed>
$groups
= array()
$name
The name of the test suite.
protected
string
$name
= ''
$numTests
The number of tests in the test suite.
protected
int
$numTests
= -1
$runTestInSeparateProcess
protected
bool
$runTestInSeparateProcess
= alse
$testCase
protected
bool
$testCase
= alse
$tests
The tests in the test suite.
protected
array<string|int, mixed>
$tests
= array()
$cachedNumTests
Last count of tests in this suite.
private
int|null
$cachedNumTests
$disallowChangesToGlobalState
private
bool
$disallowChangesToGlobalState
=
ull
$iteratorFilter
private
PHPUnit_Runner_Filter_Factory
$iteratorFilter
=
ull
Methods
__construct()
Constructs a new TestSuite for .phpt test cases.
public
__construct(string $directory) : mixed
Parameters
- $directory : string
Tags
Return values
mixed —addTest()
Adds a test to the suite.
public
addTest(PHPUnit_Framework_Test $test[, array<string|int, mixed> $groups = array() ]) : mixed
Parameters
- $test : PHPUnit_Framework_Test
- $groups : array<string|int, mixed> = array()
Return values
mixed —addTestFile()
Wraps both <code>addTest()</code> and <code>addTestSuite</code> as well as the separate import statements for the user's convenience.
public
addTestFile(string $filename) : mixed
If the named file cannot be read or there are no new tests that can be
added, a PHPUnit_Framework_Warning
will be created instead,
leaving the current test run untouched.
Parameters
- $filename : string
Tags
Return values
mixed —addTestFiles()
Wrapper for addTestFile() that adds multiple test files.
public
addTestFiles(array<string|int, mixed>|Iterator $filenames) : mixed
Parameters
- $filenames : array<string|int, mixed>|Iterator
Tags
Return values
mixed —addTestSuite()
Adds the tests from the given class to the suite.
public
addTestSuite(mixed $testClass) : mixed
Parameters
- $testClass : mixed
Tags
Return values
mixed —count()
Counts the number of test cases that will be run by this test.
public
count([bool $preferCache = false ]) : int
Parameters
- $preferCache : bool = false
-
Indicates if cache is preferred.
Return values
int —createTest()
public
static createTest(ReflectionClass $theClass, string $name) : PHPUnit_Framework_Test
Parameters
- $theClass : ReflectionClass
- $name : string
Tags
Return values
PHPUnit_Framework_Test —getGroupDetails()
public
getGroupDetails() : mixed
Return values
mixed —getGroups()
Returns the test groups of the suite.
public
getGroups() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getIterator()
Returns an iterator for this test suite.
public
getIterator() : RecursiveIteratorIterator
Tags
Return values
RecursiveIteratorIterator —getName()
Returns the name of the suite.
public
getName() : string
Return values
string —injectFilter()
public
injectFilter(PHPUnit_Runner_Filter_Factory $filter) : mixed
Parameters
- $filter : PHPUnit_Runner_Filter_Factory
Return values
mixed —isTestMethod()
public
static isTestMethod(ReflectionMethod $method) : bool
Parameters
- $method : ReflectionMethod
Return values
bool —markTestSuiteSkipped()
Mark the test suite as skipped.
public
markTestSuiteSkipped([string $message = '' ]) : mixed
Parameters
- $message : string = ''
Tags
Return values
mixed —run()
Runs the tests and collects their result in a TestResult.
public
run([PHPUnit_Framework_TestResult $result = null ]) : PHPUnit_Framework_TestResult
Parameters
- $result : PHPUnit_Framework_TestResult = null
Return values
PHPUnit_Framework_TestResult —runTest()
Runs a test.
public
runTest(PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result) : mixed
Parameters
- $test : PHPUnit_Framework_Test
- $result : PHPUnit_Framework_TestResult
Tags
Return values
mixed —setBackupGlobals()
public
setBackupGlobals(bool $backupGlobals) : mixed
Parameters
- $backupGlobals : bool
Tags
Return values
mixed —setBackupStaticAttributes()
public
setBackupStaticAttributes(bool $backupStaticAttributes) : mixed
Parameters
- $backupStaticAttributes : bool
Tags
Return values
mixed —setDisallowChangesToGlobalState()
public
setDisallowChangesToGlobalState(bool $disallowChangesToGlobalState) : mixed
Parameters
- $disallowChangesToGlobalState : bool
Tags
Return values
mixed —setGroupDetails()
Set tests groups of the test case
public
setGroupDetails(array<string|int, mixed> $groups) : mixed
Parameters
- $groups : array<string|int, mixed>
Tags
Return values
mixed —setName()
Sets the name of the suite.
public
setName(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —setRunTestInSeparateProcess()
public
setRunTestInSeparateProcess(bool $runTestInSeparateProcess) : mixed
Parameters
- $runTestInSeparateProcess : bool
Tags
Return values
mixed —setTests()
Set tests of the test suite
public
setTests(array<string|int, mixed> $tests) : mixed
Parameters
- $tests : array<string|int, mixed>
Tags
Return values
mixed —testAt()
Returns the test at the given index.
public
testAt(mixed $index) : PHPUnit_Framework_Test
Parameters
- $index : mixed
Return values
PHPUnit_Framework_Test —tests()
Returns the tests as an enumeration.
public
tests() : array<string|int, mixed>
Return values
array<string|int, mixed> —toString()
Returns a string representation of the test suite.
public
toString() : string
Return values
string —addTestMethod()
protected
addTestMethod(ReflectionClass $class, ReflectionMethod $method) : mixed
Parameters
- $class : ReflectionClass
- $method : ReflectionMethod
Return values
mixed —createResult()
Creates a default TestResult object.
protected
createResult() : PHPUnit_Framework_TestResult
Return values
PHPUnit_Framework_TestResult —incompleteTest()
protected
static incompleteTest(string $class, string $methodName, string $message) : PHPUnit_Framework_IncompleteTestCase
Parameters
- $class : string
- $methodName : string
- $message : string
Tags
Return values
PHPUnit_Framework_IncompleteTestCase —setUp()
Template Method that is called before the tests of this test suite are run.
protected
setUp() : mixed
Tags
Return values
mixed —skipTest()
protected
static skipTest(string $class, string $methodName, string $message) : PHPUnit_Framework_SkippedTestCase
Parameters
- $class : string
- $methodName : string
- $message : string
Tags
Return values
PHPUnit_Framework_SkippedTestCase —tearDown()
Template Method that is called after the tests of this test suite have finished running.
protected
tearDown() : mixed
Tags
Return values
mixed —warning()
protected
static warning(string $message) : PHPUnit_Framework_Warning
Parameters
- $message : string