function JUnitConverterTest::testXmlToRowsWithErrors
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php \Drupal\Tests\Core\Test\JUnitConverterTest::testXmlToRowsWithErrors()
- 10 core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php \Drupal\Tests\Core\Test\JUnitConverterTest::testXmlToRowsWithErrors()
- 9 core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php \Drupal\Tests\Core\Test\JUnitConverterTest::testXmlToRowsWithErrors()
- 8.9.x core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php \Drupal\Tests\Core\Test\JUnitConverterTest::testXmlToRowsWithErrors()
Tests errors reported.
File
-
core/
tests/ Drupal/ Tests/ Core/ Test/ JUnitConverterTest.php, line 29
Class
Namespace
Drupal\Tests\Core\TestCode
public function testXmlToRowsWithErrors() : void {
$phpunit_error_xml = __DIR__ . '/../../../../fixtures/phpunit_error.xml';
$res = JUnitConverter::xmlToRows(1, $phpunit_error_xml);
$this->assertCount(4, $res, 'All test cases got extracted');
$this->assertSame('fail', $res[0]['status']);
$this->assertSame('fail', $res[1]['status']);
$this->assertSame('error', $res[2]['status']);
$this->assertSame('pass', $res[3]['status']);
// Make sure xmlToRows() does not balk if there are no test results.
$this->assertSame([], JUnitConverter::xmlToRows(1, 'does_not_exist'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.