function JUnitConverter::getTestCaseResult

Determine a status string for the given testcase.

Parameters

\SimpleXMLElement $test_case: The test case XML element.

Return value

\Drupal\TestTools\PhpUnitTestCaseJUnitResult The status value to insert into the {simpletest} record.

1 call to JUnitConverter::getTestCaseResult()
JUnitConverter::convertTestCaseToSimpletestRow in core/lib/Drupal/Core/Test/JUnitConverter.php
Converts a PHPUnit test case result to a {simpletest} result row.

File

core/lib/Drupal/Core/Test/JUnitConverter.php, line 132

Class

JUnitConverter
Converts JUnit XML to Drupal's {simpletest} schema.

Namespace

Drupal\Core\Test

Code

protected static function getTestCaseResult(\SimpleXMLElement $test_case) : PhpUnitTestCaseJUnitResult {
  if ($test_case->error) {
    return PhpUnitTestCaseJUnitResult::Error;
  }
  if ($test_case->failure) {
    return PhpUnitTestCaseJUnitResult::Fail;
  }
  if ($test_case->skipped) {
    return PhpUnitTestCaseJUnitResult::Skip;
  }
  return PhpUnitTestCaseJUnitResult::Pass;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.