function TestSuite::addTestSuite
Adds the tests from the given class to the suite.
Throws
1 call to TestSuite::addTestSuite()
- TestSuite::addTestFile in vendor/
phpunit/ phpunit/ src/ Framework/ TestSuite.php - Wraps both <code>addTest()</code> and <code>addTestSuite</code> as well as the separate import statements for the user's convenience.
File
-
vendor/
phpunit/ phpunit/ src/ Framework/ TestSuite.php, line 210
Class
- TestSuite
- @template-implements IteratorAggregate<int, Test>
Namespace
PHPUnit\FrameworkCode
public function addTestSuite(ReflectionClass $testClass) : void {
if ($testClass->isAbstract()) {
throw new Exception(sprintf('Class %s is abstract', $testClass->getName()));
}
if (!$testClass->isSubclassOf(TestCase::class)) {
throw new Exception(sprintf('Class %s is not a subclass of %s', $testClass->getName(), TestCase::class));
}
$this->addTest(self::fromClassReflector($testClass));
}