public static function PHPUnit_Util_Test::getGroups

Returns the groups for a test class or method.

@since Method available since Release 3.2.0

Parameters

string $className:

string $methodName:

Return value

array

4 calls to PHPUnit_Util_Test::getGroups()
PHPUnit_Extensions_GroupTestSuite::__construct in drupal/core/vendor/phpunit/phpunit/PHPUnit/Extensions/GroupTestSuite.php
Constructs a new TestSuite:
PHPUnit_Framework_TestSuite::addTestMethod in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php
PHPUnit_Framework_TestSuite::createTest in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php
PHPUnit_Util_Test::getSize in drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Test.php
Returns the size of the test.

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Test.php, line 409

Class

PHPUnit_Util_Test
Test helpers.

Code

public static function getGroups($className, $methodName = '') {
  $annotations = self::parseTestMethodAnnotations($className, $methodName);
  $groups = array();
  if (isset($annotations['method']['author'])) {
    $groups = $annotations['method']['author'];
  }
  else {
    if (isset($annotations['class']['author'])) {
      $groups = $annotations['class']['author'];
    }
  }
  if (isset($annotations['class']['group'])) {
    $groups = array_merge($groups, $annotations['class']['group']);
  }
  if (isset($annotations['method']['group'])) {
    $groups = array_merge($groups, $annotations['method']['group']);
  }
  if (isset($annotations['class']['ticket'])) {
    $groups = array_merge($groups, $annotations['class']['ticket']);
  }
  if (isset($annotations['method']['ticket'])) {
    $groups = array_merge($groups, $annotations['method']['ticket']);
  }
  foreach (array(
    'small',
    'medium',
    'large',
  ) as $size) {
    if (isset($annotations['method'][$size])) {
      $groups[] = $size;
    }
    else {
      if (isset($annotations['class'][$size])) {
        $groups[] = $size;
      }
    }
  }
  return array_unique($groups);
}