diff --git a/src/unit/__tests__/ArcanistUnitTestResultTestCase.php b/src/unit/__tests__/ArcanistUnitTestResultTestCase.php --- a/src/unit/__tests__/ArcanistUnitTestResultTestCase.php +++ b/src/unit/__tests__/ArcanistUnitTestResultTestCase.php @@ -40,4 +40,17 @@ } } + public function testRenderer() { + $result = new ArcanistUnitTestResult(); + $result->setName('RendererTest'); + $result->setResult('pass'); + $result->setDuration(0.001); + $result->setUserData(''); + + $renderer = new ArcanistUnitConsoleRenderer(); + $output = $renderer->renderUnitResult($result); + $test_dscr = 'Renderer copes with null namespace'; + $this->assertTrue((bool)preg_match('/PASS/', $output), $test_dscr); + } + } diff --git a/src/unit/renderer/ArcanistUnitConsoleRenderer.php b/src/unit/renderer/ArcanistUnitConsoleRenderer.php --- a/src/unit/renderer/ArcanistUnitConsoleRenderer.php +++ b/src/unit/renderer/ArcanistUnitConsoleRenderer.php @@ -12,7 +12,7 @@ $test_name = $result->getName(); $test_namespace = $result->getNamespace(); - if (strlen($test_namespace)) { + if (phutil_nonempty_string($test_namespace)) { $test_name = $test_namespace.'::'.$test_name; }