public static function PHPUnit_Util_Test::describe

Parameters

PHPUnit_Framework_Test $test:

boolean $asString:

Return value

mixed

5 calls to PHPUnit_Util_Test::describe()
PHPUnit_Framework_TestSuite::run in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php
Runs the tests and collects their result in a TestResult.
PHPUnit_TextUI_ResultPrinter::startTest in drupal/core/vendor/phpunit/phpunit/PHPUnit/TextUI/ResultPrinter.php
A test started.
PHPUnit_Util_Log_JSON::startTest in drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Log/JSON.php
A test started.
PHPUnit_Util_Log_TAP::endTest in drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Log/TAP.php
A test ended.
PHPUnit_Util_Log_TAP::writeNotOk in drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Log/TAP.php

File

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

Class

PHPUnit_Util_Test
Test helpers.

Code

public static function describe(PHPUnit_Framework_Test $test, $asString = TRUE) {
  if ($asString) {
    if ($test instanceof PHPUnit_Framework_SelfDescribing) {
      return $test
        ->toString();
    }
    else {
      return get_class($test);
    }
  }
  else {
    if ($test instanceof PHPUnit_Framework_TestCase) {
      return array(
        get_class($test),
        $test
          ->getName(),
      );
    }
    else {
      if ($test instanceof PHPUnit_Framework_SelfDescribing) {
        return array(
          '',
          $test
            ->toString(),
        );
      }
      else {
        return array(
          '',
          get_class($test),
        );
      }
    }
  }
}