You are here

public static function PHPUnit_Util_Test::describe in Zircon Profile 8

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

Parameters

PHPUnit_Framework_Test $test:

bool $asString:

Return value

mixed

5 calls to PHPUnit_Util_Test::describe()
PHPUnit_Runner_Filter_Test::accept in vendor/phpunit/phpunit/src/Runner/Filter/Test.php
PHPUnit_TextUI_ResultPrinter::startTest in vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php
A test started.
PHPUnit_Util_Log_JSON::startTest in vendor/phpunit/phpunit/src/Util/Log/JSON.php
A test started.
PHPUnit_Util_Log_TAP::endTest in vendor/phpunit/phpunit/src/Util/Log/TAP.php
A test ended.
PHPUnit_Util_Log_TAP::writeNotOk in vendor/phpunit/phpunit/src/Util/Log/TAP.php

File

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

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(),
      );
    }
    elseif ($test instanceof PHPUnit_Framework_SelfDescribing) {
      return array(
        '',
        $test
          ->toString(),
      );
    }
    else {
      return array(
        '',
        get_class($test),
      );
    }
  }
}