public function PHPUnit_Framework_TestSuite::addTest

Adds a test to the suite.

Parameters

PHPUnit_Framework_Test $test:

array $groups:

5 calls to PHPUnit_Framework_TestSuite::addTest()

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php, line 246

Class

PHPUnit_Framework_TestSuite
A TestSuite is a composite of Tests. It runs a collection of test cases.

Code

public function addTest(PHPUnit_Framework_Test $test, $groups = array()) {
  $class = new ReflectionClass($test);
  if (!$class
    ->isAbstract()) {
    $this->tests[] = $test;
    $this->numTests = -1;
    if ($test instanceof PHPUnit_Framework_TestSuite && empty($groups)) {
      $groups = $test
        ->getGroups();
    }
    if (empty($groups)) {
      $groups = array(
        '__nogroup__',
      );
    }
    foreach ($groups as $group) {
      if (!isset($this->groups[$group])) {
        $this->groups[$group] = array(
          $test,
        );
      }
      else {
        $this->groups[$group][] = $test;
      }
    }
  }
}