Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TestSuite.php

function TestSuite::addTestSuite

Adds the tests from the given class to the suite.

Throws

Exception

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\Framework

Code

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));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal