Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. JUnitConverter.php

function JUnitConverter::xmlElementToRows

Parse test cases from XML to {simpletest} schema.

@internal

Parameters

int $test_id: The current test ID.

\SimpleXMLElement $element: The XML data from the JUnit file.

Return value

array[] The results as array of rows in a format that can be inserted into the {simpletest} table of the results database.

1 call to JUnitConverter::xmlElementToRows()
JUnitConverter::xmlToRows in core/lib/Drupal/Core/Test/JUnitConverter.php
Converts PHPUnit's JUnit XML output file to {simpletest} schema.

File

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

Class

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

Namespace

Drupal\Core\Test

Code

public static function xmlElementToRows($test_id, \SimpleXMLElement $element) {
    $records = [];
    $test_cases = static::findTestCases($element);
    foreach ($test_cases as $test_case) {
        $records[] = static::convertTestCaseToSimpletestRow($test_id, $test_case);
    }
    return $records;
}
RSS feed
Powered by Drupal