You are here

protected function PHPUnit_Util_Log_JSON::writeCase in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Util/Log/JSON.php \PHPUnit_Util_Log_JSON::writeCase()

Parameters

string $status:

float $time:

array $trace:

string $message:

PHPUnit_Framework_TestCase|null $test:

6 calls to PHPUnit_Util_Log_JSON::writeCase()
PHPUnit_Util_Log_JSON::addError in vendor/phpunit/phpunit/src/Util/Log/JSON.php
An error occurred.
PHPUnit_Util_Log_JSON::addFailure in vendor/phpunit/phpunit/src/Util/Log/JSON.php
A failure occurred.
PHPUnit_Util_Log_JSON::addIncompleteTest in vendor/phpunit/phpunit/src/Util/Log/JSON.php
Incomplete test.
PHPUnit_Util_Log_JSON::addRiskyTest in vendor/phpunit/phpunit/src/Util/Log/JSON.php
Risky test.
PHPUnit_Util_Log_JSON::addSkippedTest in vendor/phpunit/phpunit/src/Util/Log/JSON.php
Skipped test.

... See full list

File

vendor/phpunit/phpunit/src/Util/Log/JSON.php, line 203

Class

PHPUnit_Util_Log_JSON
A TestListener that generates JSON messages.

Code

protected function writeCase($status, $time, array $trace = array(), $message = '', $test = null) {
  $output = '';

  // take care of TestSuite producing error (e.g. by running into exception) as TestSuite doesn't have hasOutput
  if ($test !== null && method_exists($test, 'hasOutput') && $test
    ->hasOutput()) {
    $output = $test
      ->getActualOutput();
  }
  $this
    ->write(array(
    'event' => 'test',
    'suite' => $this->currentTestSuiteName,
    'test' => $this->currentTestName,
    'status' => $status,
    'time' => $time,
    'trace' => $trace,
    'message' => PHPUnit_Util_String::convertToUtf8($message),
    'output' => $output,
  ));
}