You are here

protected function ValidationTestTrait::getResultsFromManager in Automatic Updates 8.2

Gets the messages of a particular type from the manager.

Parameters

bool $call_run: Whether to run the checkers.

int|null $severity: (optional) The severity for the results to return. Should be one of the SystemManager::REQUIREMENT_* constants.

Return value

\Drupal\automatic_updates\Validation\ValidationResult[]|null The messages of the type.

2 calls to ValidationTestTrait::getResultsFromManager()
ReadinessValidationManagerTest::testGetResults in tests/src/Kernel/ReadinessValidation/ReadinessValidationManagerTest.php
@covers ::getResults
ValidationTestTrait::assertCheckerResultsFromManager in tests/src/Traits/ValidationTestTrait.php
Asserts expected validation results from the manager.

File

tests/src/Traits/ValidationTestTrait.php, line 125

Class

ValidationTestTrait
Common methods for testing validation.

Namespace

Drupal\Tests\automatic_updates\Traits

Code

protected function getResultsFromManager(bool $call_run = FALSE, ?int $severity = NULL) : ?array {
  $manager = $this->container
    ->get('automatic_updates.readiness_validation_manager');
  if ($call_run) {
    $manager
      ->run();
  }
  return $manager
    ->getResults($severity);
}