class JUnitConverterTest extends UnitTestCase
{ /**
* Tests errors reported.
* @covers ::xmlToRows
*/
public function testXmlToRowsWithErrors() { $phpunit_error_xml = __DIR__ . '/fixtures/phpunit_error.xml';
$res = JUnitConverter::
xmlToRows(1,
$phpunit_error_xml);
$this->
assertCount(4,
$res, 'All testcases got extracted'
);
$this->
assertNotEquals('pass',
$res[0
]['status'
]);
$this->
assertEquals('fail',
$res[0
]['status'
]);
// Test nested testsuites, which appear when you use @dataProvider.
for ($i = 0;
$i < 3;
$i++
) { $this->
assertNotEquals('pass',
$res[$i + 1
]['status'
]);
$this->
assertEquals('fail',
$res[$i + 1
]['status'
]);
} // Make sure xmlToRows() does not balk if there are no test results.