function 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.

2 calls to TestDatabase::processPhpUnitResults()
simpletest_process_phpunit_results in core/modules/simpletest/simpletest.module
Inserts the parsed PHPUnit results into {simpletest}.
_simpletest_batch_operation in core/modules/simpletest/simpletest.module
Implements callback_batch_operation().

File

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

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.