public static function PHPUnit_Util_Test::parseTestMethodAnnotations

@since Method available since Release 3.4.0

Parameters

string $className:

string $methodName:

Return value

array

Throws

ReflectionException

7 calls to PHPUnit_Util_Test::parseTestMethodAnnotations()
PHPUnit_Framework_TestCase::getAnnotations in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php
Returns the annotations for this test.
PHPUnit_Util_Test::getBooleanAnnotationSetting in drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Test.php
@since Method available since Release 3.4.0
PHPUnit_Util_Test::getDependencies in drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Test.php
Returns the dependencies for a test class or method.
PHPUnit_Util_Test::getExpectedException in drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Test.php
Returns the expected exception for a test.
PHPUnit_Util_Test::getGroups in drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Test.php
Returns the groups for a test class or method.

... See full list

File

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

Class

PHPUnit_Util_Test
Test helpers.

Code

public static function parseTestMethodAnnotations($className, $methodName = '') {
  if (!isset(self::$annotationCache[$className])) {
    $class = new ReflectionClass($className);
    self::$annotationCache[$className] = self::parseAnnotations($class
      ->getDocComment());
  }
  if (!empty($methodName) && !isset(self::$annotationCache[$className . '::' . $methodName])) {
    try {
      $method = new ReflectionMethod($className, $methodName);
      $annotations = self::parseAnnotations($method
        ->getDocComment());
    } catch (ReflectionException $e) {
      $annotations = array();
    }
    self::$annotationCache[$className . '::' . $methodName] = $annotations;
  }
  return array(
    'class' => self::$annotationCache[$className],
    'method' => !empty($methodName) ? self::$annotationCache[$className . '::' . $methodName] : array(),
  );
}