Changeset View
Changeset View
Standalone View
Standalone View
src/unit/parser/__tests__/XUnitTestResultParserTestCase.php
Show All 22 Lines | public function testAcceptsSimpleInput() { | ||||
$this->assertEqual(3, count($parsed_results)); | $this->assertEqual(3, count($parsed_results)); | ||||
} | } | ||||
public function testEmptyInputFailure() { | public function testEmptyInputFailure() { | ||||
try { | try { | ||||
$parsed_results = id(new ArcanistXUnitTestResultParser()) | $parsed_results = id(new ArcanistXUnitTestResultParser()) | ||||
->parseTestResults(''); | ->parseTestResults(''); | ||||
$this->failTest(pht('Should throw on empty input')); | $this->assertFailure(pht('Should throw on empty input')); | ||||
} catch (Exception $e) { | } catch (Exception $e) { | ||||
// OK | // OK | ||||
} | } | ||||
$this->assertTrue(true); | $this->assertTrue(true); | ||||
} | } | ||||
public function testInvalidXmlInputFailure() { | public function testInvalidXmlInputFailure() { | ||||
$stubbed_results = Filesystem::readFile( | $stubbed_results = Filesystem::readFile( | ||||
dirname(__FILE__).'/testresults/xunit.invalid-xml'); | dirname(__FILE__).'/testresults/xunit.invalid-xml'); | ||||
try { | try { | ||||
$parsed_results = id(new ArcanistXUnitTestResultParser()) | $parsed_results = id(new ArcanistXUnitTestResultParser()) | ||||
->parseTestResults($stubbed_results); | ->parseTestResults($stubbed_results); | ||||
$this->failTest(pht('Should throw on non-xml input')); | $this->assertFailure(pht('Should throw on non-xml input')); | ||||
} catch (Exception $e) { | } catch (Exception $e) { | ||||
// OK | // OK | ||||
} | } | ||||
$this->assertTrue(true); | $this->assertTrue(true); | ||||
} | } | ||||
} | } |