class DataProviderTestSuite extends TestSuite (View source)

Properties

protected bool $backupGlobals Enable or disable the backup and restoration of the $GLOBALS array. from TestSuite
protected bool $backupStaticAttributes Enable or disable the backup and restoration of static attributes. from TestSuite
protected bool $runTestInSeparateProcess from TestSuite
protected string $name The name of the test suite. from TestSuite
protected array $groups The test groups of the test suite. from TestSuite
protected TestCase[] $tests The tests in the test suite. from TestSuite
protected int $numTests The number of tests in the test suite. from TestSuite
protected bool $testCase from TestSuite
protected array $foundClasses from TestSuite

Methods

__construct(mixed $theClass = '', string $name = '')

Constructs a new TestSuite:

from TestSuite
string
toString()

Returns a string representation of the test suite.

from TestSuite
addTest(Test $test, array $groups = [])

Adds a test to the suite.

from TestSuite
addTestSuite(mixed $testClass)

Adds the tests from the given class to the suite.

from TestSuite
addTestFile(string $filename)

Wraps both addTest() and addTestSuite as well as the separate import statements for the user's convenience.

from TestSuite
addTestFiles(array|Iterator $filenames)

Wrapper for addTestFile() that adds multiple test files.

from TestSuite
int
count(bool $preferCache = false)

Counts the number of test cases that will be run by this test.

from TestSuite
static Test
createTest(ReflectionClass $theClass, string $name)

No description

from TestSuite
createResult()

Creates a default TestResult object.

from TestSuite
string
getName()

Returns the name of the suite.

from TestSuite
array
getGroups()

Returns the test groups of the suite.

from TestSuite
getGroupDetails()

No description

from TestSuite
setGroupDetails(array $groups)

Set tests groups of the test case

from TestSuite
run(TestResult $result = null)

Runs the tests and collects their result in a TestResult.

from TestSuite
setRunTestInSeparateProcess(bool $runTestInSeparateProcess)

No description

from TestSuite
runTest(Test $test, TestResult $result) deprecated

Runs a test.

from TestSuite
setName(string $name)

Sets the name of the suite.

from TestSuite
Test|false
testAt(int|false $index)

Returns the test at the given index.

from TestSuite
array
tests()

Returns the tests as an enumeration.

from TestSuite
setTests(array $tests)

Set tests of the test suite

from TestSuite
markTestSuiteSkipped(string $message = '')

Mark the test suite as skipped.

from TestSuite
addTestMethod(ReflectionClass $class, ReflectionMethod $method)

No description

from TestSuite
static bool
isTestMethod(ReflectionMethod $method)

No description

from TestSuite
static WarningTestCase
warning(string $message)

No description

from TestSuite
static SkippedTestCase
skipTest(string $class, string $methodName, string $message)

No description

from TestSuite
incompleteTest(string $class, string $methodName, string $message)

No description

from TestSuite
setbeStrictAboutChangesToGlobalState(bool $beStrictAboutChangesToGlobalState)

No description

from TestSuite
setBackupGlobals(bool $backupGlobals)

No description

from TestSuite
setBackupStaticAttributes(bool $backupStaticAttributes)

No description

from TestSuite
getIterator()

Returns an iterator for this test suite.

from TestSuite
injectFilter(Factory $filter)

No description

from TestSuite
setUp()

Template Method that is called before the tests of this test suite are run.

from TestSuite
tearDown()

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

from TestSuite
setDependencies(array $dependencies)

Sets the dependencies of a TestCase.

Details

__construct(mixed $theClass = '', string $name = '')

Constructs a new TestSuite:

  • 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.

Parameters

mixed $theClass
string $name

Exceptions

Exception

string toString()

Returns a string representation of the test suite.

Return Value

string

addTest(Test $test, array $groups = [])

Adds a test to the suite.

Parameters

Test $test
array $groups

addTestSuite(mixed $testClass)

Adds the tests from the given class to the suite.

Parameters

mixed $testClass

Exceptions

Exception

addTestFile(string $filename)

Wraps both addTest() and addTestSuite as well as the separate import statements for the user's convenience.

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.

Parameters

string $filename

Exceptions

Exception

addTestFiles(array|Iterator $filenames)

Wrapper for addTestFile() that adds multiple test files.

Parameters

array|Iterator $filenames

Exceptions

Exception

int count(bool $preferCache = false)

Counts the number of test cases that will be run by this test.

Parameters

bool $preferCache Indicates if cache is preferred.

Return Value

int

static Test createTest(ReflectionClass $theClass, string $name)

Parameters

ReflectionClass $theClass
string $name

Return Value

Test

Exceptions

Exception

protected TestResult createResult()

Creates a default TestResult object.

Return Value

TestResult

string getName()

Returns the name of the suite.

Return Value

string

array getGroups()

Returns the test groups of the suite.

Return Value

array

getGroupDetails()

setGroupDetails(array $groups)

Set tests groups of the test case

Parameters

array $groups

TestResult run(TestResult $result = null)

Runs the tests and collects their result in a TestResult.

Parameters

TestResult $result

Return Value

TestResult

setRunTestInSeparateProcess(bool $runTestInSeparateProcess)

Parameters

bool $runTestInSeparateProcess

Exceptions

Exception

runTest(Test $test, TestResult $result) deprecated

deprecated

Runs a test.

Parameters

Test $test
TestResult $result

setName(string $name)

Sets the name of the suite.

Parameters

string $name

Test|false testAt(int|false $index)

Returns the test at the given index.

Parameters

int|false $index

Return Value

Test|false

array tests()

Returns the tests as an enumeration.

Return Value

array

setTests(array $tests)

Set tests of the test suite

Parameters

array $tests

markTestSuiteSkipped(string $message = '')

Mark the test suite as skipped.

Parameters

string $message

Exceptions

SkippedTestSuiteError

protected addTestMethod(ReflectionClass $class, ReflectionMethod $method)

Parameters

ReflectionClass $class
ReflectionMethod $method

static bool isTestMethod(ReflectionMethod $method)

Parameters

ReflectionMethod $method

Return Value

bool

static protected WarningTestCase warning(string $message)

Parameters

string $message

Return Value

WarningTestCase

static protected SkippedTestCase skipTest(string $class, string $methodName, string $message)

Parameters

string $class
string $methodName
string $message

Return Value

SkippedTestCase

static protected IncompleteTestCase incompleteTest(string $class, string $methodName, string $message)

Parameters

string $class
string $methodName
string $message

Return Value

IncompleteTestCase

setbeStrictAboutChangesToGlobalState(bool $beStrictAboutChangesToGlobalState)

Parameters

bool $beStrictAboutChangesToGlobalState

setBackupGlobals(bool $backupGlobals)

Parameters

bool $backupGlobals

setBackupStaticAttributes(bool $backupStaticAttributes)

Parameters

bool $backupStaticAttributes

TestSuiteIterator getIterator()

Returns an iterator for this test suite.

Return Value

TestSuiteIterator

injectFilter(Factory $filter)

Parameters

Factory $filter

protected setUp()

Template Method that is called before the tests of this test suite are run.

protected tearDown()

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

setDependencies(array $dependencies)

Sets the dependencies of a TestCase.

Parameters

array $dependencies