Changeset View
Changeset View
Standalone View
Standalone View
src/unit/renderer/ArcanistUnitConsoleRenderer.php
<?php | <?php | ||||
final class ArcanistUnitConsoleRenderer extends ArcanistUnitRenderer { | final class ArcanistUnitConsoleRenderer extends ArcanistUnitRenderer { | ||||
public function renderUnitResult(ArcanistUnitTestResult $result) { | public function renderUnitResult(ArcanistUnitTestResult $result) { | ||||
$result_code = $result->getResult(); | $result_code = $result->getResult(); | ||||
$duration = ''; | $duration = ''; | ||||
if ($result_code == ArcanistUnitTestResult::RESULT_PASS) { | if ($result_code == ArcanistUnitTestResult::RESULT_PASS) { | ||||
$duration = ' '.$this->formatTestDuration($result->getDuration()); | $duration = ' '.$this->formatTestDuration($result->getDuration()); | ||||
} | } | ||||
$test_name = $result->getName(); | $test_name = $result->getName(); | ||||
$test_namespace = $result->getNamespace(); | $test_namespace = $result->getNamespace(); | ||||
if ($test_namespace == null) { | |||||
$test_namespace = ''; | |||||
} | |||||
if (strlen($test_namespace)) { | if (strlen($test_namespace)) { | ||||
$test_name = $test_namespace.'::'.$test_name; | $test_name = $test_namespace.'::'.$test_name; | ||||
} | } | ||||
$return = sprintf( | $return = sprintf( | ||||
" %s %s\n", | " %s %s\n", | ||||
$this->getFormattedResult($result->getResult()).$duration, | $this->getFormattedResult($result->getResult()).$duration, | ||||
$test_name); | $test_name); | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |