You are here

public static function PHPUnit_Util_Test::getSize in Zircon Profile 8

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

Returns the size of the test.

@since Method available since Release 3.6.0

Parameters

string $className:

string $methodName:

Return value

int

2 calls to PHPUnit_Util_Test::getSize()
PHPUnit_Framework_TestCase::getSize in vendor/phpunit/phpunit/src/Framework/TestCase.php
Returns the size of the test.
PHPUnit_Framework_TestResult::endTest in vendor/phpunit/phpunit/src/Framework/TestResult.php
Informs the result that a test was completed.

File

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

Class

PHPUnit_Util_Test
Test helpers.

Code

public static function getSize($className, $methodName) {
  $groups = array_flip(self::getGroups($className, $methodName));
  $size = self::UNKNOWN;
  $class = new ReflectionClass($className);
  if (isset($groups['large']) || class_exists('PHPUnit_Extensions_Database_TestCase', false) && $class
    ->isSubclassOf('PHPUnit_Extensions_Database_TestCase') || class_exists('PHPUnit_Extensions_SeleniumTestCase', false) && $class
    ->isSubclassOf('PHPUnit_Extensions_SeleniumTestCase')) {
    $size = self::LARGE;
  }
  elseif (isset($groups['medium'])) {
    $size = self::MEDIUM;
  }
  elseif (isset($groups['small'])) {
    $size = self::SMALL;
  }
  return $size;
}