function TestDatabase::processPhpUnitResults

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Test/TestDatabase.php \Drupal\Core\Test\TestDatabase::processPhpUnitResults()

Inserts the parsed PHPUnit results into {simpletest}.

@internal

Parameters

array[] $phpunit_results: An array of test results, as returned from \Drupal\Core\Test\JUnitConverter::xmlToRows(). These results are in a form suitable for inserting into the {simpletest} table of the test results database.

File

core/lib/Drupal/Core/Test/TestDatabase.php, line 422

Class

TestDatabase
Provides helper methods for interacting with the fixture database.

Namespace

Drupal\Core\Test

Code

public static function processPhpUnitResults($phpunit_results) {
    if ($phpunit_results) {
        $query = static::getConnection()->insert('simpletest')
            ->fields(array_keys($phpunit_results[0]));
        foreach ($phpunit_results as $result) {
            $query->values($result);
        }
        $query->execute();
    }
}

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