protected function PHPUnit_Framework_TestSuite::addTestMethod

Parameters

ReflectionClass $class:

ReflectionMethod $method:

1 call to PHPUnit_Framework_TestSuite::addTestMethod()
PHPUnit_Framework_TestSuite::__construct in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php
Constructs a new TestSuite:

File

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

Class

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

Code

protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method) {
  $name = $method
    ->getName();
  if ($this
    ->isPublicTestMethod($method)) {
    $test = self::createTest($class, $name);
    if ($test instanceof PHPUnit_Framework_TestCase || $test instanceof PHPUnit_Framework_TestSuite_DataProvider) {
      $test
        ->setDependencies(PHPUnit_Util_Test::getDependencies($class
        ->getName(), $name));
    }
    $this
      ->addTest($test, PHPUnit_Util_Test::getGroups($class
      ->getName(), $name));
  }
  else {
    if ($this
      ->isTestMethod($method)) {
      $this
        ->addTest(self::warning(sprintf('Test method "%s" in test class "%s" is not public.', $name, $class
        ->getName())));
    }
  }
}