You are here

protected function TestChecker1::addResults in Automatic Updates 8.2

Adds test result to an update event from a state setting.

Parameters

\Drupal\automatic_updates\Event\UpdateEvent $event: The update event.

string $state_key: The state key.

3 calls to TestChecker1::addResults()
TestChecker1::runPreChecks in tests/modules/automatic_updates_test/src/ReadinessChecker/TestChecker1.php
Adds test results for the readiness check event.
TestChecker1::runPreCommitChecks in tests/modules/automatic_updates_test/src/ReadinessChecker/TestChecker1.php
Adds test results for the pre-commit event.
TestChecker1::runStartChecks in tests/modules/automatic_updates_test/src/ReadinessChecker/TestChecker1.php
Adds test results for the pre-start event.

File

tests/modules/automatic_updates_test/src/ReadinessChecker/TestChecker1.php, line 69

Class

TestChecker1
A test readiness checker.

Namespace

Drupal\automatic_updates_test\ReadinessChecker

Code

protected function addResults(UpdateEvent $event, string $state_key) : void {
  $results = $this->state
    ->get($state_key, []);
  if ($results instanceof \Throwable) {
    throw $results;
  }
  foreach ($results as $result) {
    $event
      ->addValidationResult($result);
  }
}