You are here

public static function TestChecker1::setTestResult in Automatic Updates 8.2

Sets messages for this readiness checker.

This method is static to enable setting the expected messages before the test module is enabled.

Parameters

\Drupal\automatic_updates\Validation\ValidationResult[]|\Throwable|null $checker_results: The test validation results, or an exception to throw, or NULL to delete stored results.

string $event_name: (optional )The event name. Defaults to AutomaticUpdatesEvents::READINESS_CHECK.

8 calls to TestChecker1::setTestResult()
ReadinessValidationManagerTest::testGetResults in tests/src/Kernel/ReadinessValidation/ReadinessValidationManagerTest.php
@covers ::getResults
ReadinessValidationManagerTest::testRunIfNeeded in tests/src/Kernel/ReadinessValidation/ReadinessValidationManagerTest.php
@covers ::runIfNoStoredResults
ReadinessValidationManagerTest::testRunOnInstall in tests/src/Kernel/ReadinessValidation/ReadinessValidationManagerTest.php
Tests that the manager is run after modules are installed.
ReadinessValidationManagerTest::testRunOnUninstall in tests/src/Kernel/ReadinessValidation/ReadinessValidationManagerTest.php
Tests that the manager is run after modules are uninstalled.
ReadinessValidationTest::testReadinessCheckerUninstall in tests/src/Functional/ReadinessValidationTest.php
Tests that checker message for an uninstalled module is not displayed.

... See full list

File

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

Class

TestChecker1
A test readiness checker.

Namespace

Drupal\automatic_updates_test\ReadinessChecker

Code

public static function setTestResult($checker_results, string $event_name = AutomaticUpdatesEvents::READINESS_CHECK) : void {
  $key = static::STATE_KEY . ".{$event_name}";
  if (isset($checker_results)) {
    \Drupal::state()
      ->set($key, $checker_results);
  }
  else {
    \Drupal::state()
      ->delete($key);
  }
}