Skip to content
Snippets Groups Projects

Issue #3262303: Always clear stored validation results when modules are installed or uninstalled

Merged Issue #3262303: Always clear stored validation results when modules are installed or uninstalled
@@ -86,41 +86,6 @@ class ReadinessValidationManagerTest extends AutomaticUpdatesKernelTestBase {
@@ -86,41 +86,6 @@ class ReadinessValidationManagerTest extends AutomaticUpdatesKernelTestBase {
$this->assertCheckerResultsFromManager($errors_only_results, FALSE, SystemManager::REQUIREMENT_ERROR);
$this->assertCheckerResultsFromManager($errors_only_results, FALSE, SystemManager::REQUIREMENT_ERROR);
}
}
/**
* Tests that the manager is run after modules are installed.
*/
public function testRunOnInstall(): void {
$expected_results = [array_pop($this->testResults['checker_1'])];
TestChecker1::setTestResult($expected_results[0], ReadinessCheckEvent::class);
// Confirm that messages from an existing module are displayed when
// 'automatic_updates' is installed.
$this->container->get('module_installer')->install(['automatic_updates']);
$this->assertCheckerResultsFromManager($expected_results[0]);
// Confirm that the checkers are run when a module that provides a readiness
// checker is installed.
$expected_results = [
array_pop($this->testResults['checker_1']),
array_pop($this->testResults['checker_2']),
];
TestChecker1::setTestResult($expected_results[0], ReadinessCheckEvent::class);
TestChecker2::setTestResult($expected_results[1], ReadinessCheckEvent::class);
$this->container->get('module_installer')->install(['automatic_updates_test2']);
$expected_results_all = array_merge($expected_results[0], $expected_results[1]);
$this->assertCheckerResultsFromManager($expected_results_all);
// Confirm that the checkers are not run when a module that does not provide
// a readiness checker is installed.
$unexpected_results = [
array_pop($this->testResults['checker_1']),
array_pop($this->testResults['checker_2']),
];
TestChecker1::setTestResult($unexpected_results[0], ReadinessCheckEvent::class);
TestChecker2::setTestResult($unexpected_results[1], ReadinessCheckEvent::class);
$this->container->get('module_installer')->install(['help']);
$this->assertCheckerResultsFromManager($expected_results_all);
}
/**
/**
* Tests that the manager is run after modules are uninstalled.
* Tests that the manager is run after modules are uninstalled.
*/
*/
Loading