You are here

private static function PHPUnit_Util_Test::getBooleanAnnotationSetting in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Util/Test.php \PHPUnit_Util_Test::getBooleanAnnotationSetting()

@since Method available since Release 3.4.0

Parameters

string $className:

string $methodName:

string $settingName:

Return value

bool

3 calls to PHPUnit_Util_Test::getBooleanAnnotationSetting()
PHPUnit_Util_Test::getBackupSettings in vendor/phpunit/phpunit/src/Util/Test.php
Returns the backup settings for a test.
PHPUnit_Util_Test::getErrorHandlerSettings in vendor/phpunit/phpunit/src/Util/Test.php
Returns the error handler settings for a test.
PHPUnit_Util_Test::getPreserveGlobalStateSettings in vendor/phpunit/phpunit/src/Util/Test.php
Returns the preserve global state settings for a test.

File

vendor/phpunit/phpunit/src/Util/Test.php, line 813

Class

PHPUnit_Util_Test
Test helpers.

Code

private static function getBooleanAnnotationSetting($className, $methodName, $settingName) {
  $annotations = self::parseTestMethodAnnotations($className, $methodName);
  $result = null;
  if (isset($annotations['class'][$settingName])) {
    if ($annotations['class'][$settingName][0] == 'enabled') {
      $result = true;
    }
    elseif ($annotations['class'][$settingName][0] == 'disabled') {
      $result = false;
    }
  }
  if (isset($annotations['method'][$settingName])) {
    if ($annotations['method'][$settingName][0] == 'enabled') {
      $result = true;
    }
    elseif ($annotations['method'][$settingName][0] == 'disabled') {
      $result = false;
    }
  }
  return $result;
}