function MemoryTestRunResultsStorage::getLogEntriesByTestClass
File
-
core/
tests/ Drupal/ TestTools/ TestRunner/ MemoryTestRunResultsStorage.php, line 75
Class
- MemoryTestRunResultsStorage
- Implements an in-memory test run results storage.
Namespace
Drupal\TestTools\TestRunnerCode
public function getLogEntriesByTestClass(TestRun $test_run) : array {
$result = [];
foreach ($this->testId[$test_run->id()]['log'] as $message_id => $log) {
$entry = array_merge([
'time' => '0',
'exit_code' => '0',
], $log);
$entry['message_id'] = (string) $message_id;
$entry['test_id'] = (string) $entry['test_id'];
$entry['line'] = (string) $entry['line'];
$result[] = (object) $entry;
}
usort($result, function (object $a, object $b) : int {
if ($a->test_class == $b->test_class) {
if ($a->message_id == $b->message_id) {
return 0;
}
return $a->message_id < $b->message_id ? -1 : 1;
}
return strcmp($a->test_class, $b->test_class);
});
return $result;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.