A class to contain test cases and run them with shared fixtures
boolEnable or disable the backup and restoration of the $GLOBALS array.
boolEnable or disable the backup and restoration of static attributes.
string[]The test groups of the test suite.
stringThe name of the test suite.
intThe number of tests in the test suite.
null|list<ExecutionOrderDependency>null|list<ExecutionOrderDependency>boolboolTest[]The tests in the test suite.
Constructs a new TestSuite.
Adds a test to the suite.
Adds all the files in a directory to the test suite. Does not recursive through directories.
Recursively adds all the files in a directory to the test suite.
Wraps both addTest() and addTestSuite as well as the separate import statements for the user's convenience.
Wrapper for addTestFile() that adds multiple test files.
Adds the tests from the given class to the suite.
Counts the number of test cases that will be run by this test.
Creates a default TestResult object.
Returns the test groups of the suite.
Returns an iterator for this test suite.
Returns the name of the suite.
Mark the test suite as skipped.
Runs the tests and collects their result in a TestResult.
Set tests groups of the test case.
Set tests of the test suite.
Returns the tests as an enumeration.
Returns a string representation of the test suite.
__construct(ReflectionClass|string $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.
ReflectionClass|string $theClass optional string $name optional ExceptionaddTest(Test $test, array $groups = []): void
Adds a test to the suite.
Test $test array $groups optional voidaddTestDirectory(string $directory = '.'): void
Adds all the files in a directory to the test suite. Does not recursive through directories.
string $directory optional The directory to add tests from.
voidaddTestDirectoryRecursive(string $directory = '.'): void
Recursively adds all the files in a directory to the test suite.
string $directory optional The directory subtree to add tests from.
voidaddTestFile(string $filename): void
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.
string $filename voidExceptionaddTestFiles(iterable $fileNames): void
Wrapper for addTestFile() that adds multiple test files.
iterable $fileNames voidExceptionaddTestMethod(ReflectionClass $class, ReflectionMethod $method): void
ReflectionClass $class ReflectionMethod $method voidExceptionaddTestSuite(mixed $testClass): void
Adds the tests from the given class to the suite.
voidExceptionaddWarning(string $warning): void
string $warning voidcount(): int
Counts the number of test cases that will be run by this test.
intcreateResult(): TestResult
Creates a default TestResult object.
TestResultgetGroupDetails(): array
arraygetGroups(): array
Returns the test groups of the suite.
arraygetIterator(): Iterator
Returns an iterator for this test suite.
IteratorgetName(): string
Returns the name of the suite.
stringinjectFilter(Factory $filter): void
Factory $filter voidmarkTestSuiteSkipped(string $message = ''): void
Mark the test suite as skipped.
string $message optional voidSkippedTestSuiteErrorprovides(): list<ExecutionOrderDependency>
list<ExecutionOrderDependency>requires(): list<ExecutionOrderDependency>
list<ExecutionOrderDependency>run(TestResult $result = null): TestResult
Runs the tests and collects their result in a TestResult.
TestResult $result optional TestResultPHPUnit\Framework\CodeCoverageExceptionSebastianBergmann\CodeCoverage\InvalidArgumentExceptionSebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeExceptionSebastianBergmann\RecursionContext\InvalidArgumentExceptionWarningsetBackupGlobals(bool $backupGlobals): void
bool $backupGlobals voidsetBackupStaticAttributes(bool $backupStaticAttributes): void
bool $backupStaticAttributes voidsetBeStrictAboutChangesToGlobalState(bool $beStrictAboutChangesToGlobalState): void
bool $beStrictAboutChangesToGlobalState voidsetGroupDetails(array $groups): void
Set tests groups of the test case.
array $groups voidsetName(string $name): void
string $name voidsetRunTestInSeparateProcess(bool $runTestInSeparateProcess): void
bool $runTestInSeparateProcess voidsetTests(Test[] $tests): void
Set tests of the test suite.
Test[] $tests voidsortId(): string
stringtests(): Test[]
Returns the tests as an enumeration.
Test[]toString(): string
Returns a string representation of the test suite.
stringwarnings(): array
arrayEnable or disable the backup and restoration of the $GLOBALS array.
boolEnable or disable the backup and restoration of static attributes.
boolstring[]The test groups of the test suite.
The name of the test suite.
stringThe number of tests in the test suite.
intnull|list<ExecutionOrderDependency>null|list<ExecutionOrderDependency>boolboolThe tests in the test suite.
Test[]
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.TestSuite.TestSuite.html