Loading src/Form/UpdaterForm.php +9 −9 Original line number Diff line number Diff line Loading @@ -164,6 +164,15 @@ final class UpdaterForm extends FormBase { return $form; } if ($form_state->getUserInput()) { $results = []; } else { $event = new ReadinessCheckEvent($this->updater); $this->eventDispatcher->dispatch($event); $results = $event->getResults(); } $this->displayResults($results, $this->messenger(), $this->renderer); $project = $project_info->getProjectInfo(); if ($installed_minor_release === NULL && $next_minor_release === NULL) { if ($project['status'] === UpdateManagerInterface::CURRENT) { Loading Loading @@ -216,15 +225,6 @@ final class UpdaterForm extends FormBase { $release_status = $this->t('Available update'); $type = 'update-recommended'; } if ($form_state->getUserInput()) { $results = []; } else { $event = new ReadinessCheckEvent($this->updater); $this->eventDispatcher->dispatch($event); $results = $event->getResults(); } $this->displayResults($results, $this->messenger(), $this->renderer); $create_update_buttons = !$stage_exists && $this->getOverallSeverity($results) !== SystemManager::REQUIREMENT_ERROR; if ($installed_minor_release) { $installed_version = ExtensionVersion::createFromVersionString($project_info->getInstalledVersion()); Loading tests/src/Functional/UpdaterFormTest.php +15 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,21 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { $this->assertUpdateStagedTimes(0); } /** * Tests readiness checks are displayed when there is no update available. */ public function testReadinessCheckFailureWhenNoUpdate() { $assert_session = $this->assertSession(); $this->setCoreVersion('9.8.1'); $message = "You've not experienced Shakespeare until you have read him in the original Klingon."; $result = ValidationResult::createError([$message]); TestSubscriber1::setTestResult([$result], ReadinessCheckEvent::class); $this->checkForUpdates(); $this->drupalGet('/admin/reports/updates/automatic-update'); $assert_session->pageTextContains('No update available'); $assert_session->pageTextContains($message); } /** * Checks the table for a release on the form. * Loading Loading
src/Form/UpdaterForm.php +9 −9 Original line number Diff line number Diff line Loading @@ -164,6 +164,15 @@ final class UpdaterForm extends FormBase { return $form; } if ($form_state->getUserInput()) { $results = []; } else { $event = new ReadinessCheckEvent($this->updater); $this->eventDispatcher->dispatch($event); $results = $event->getResults(); } $this->displayResults($results, $this->messenger(), $this->renderer); $project = $project_info->getProjectInfo(); if ($installed_minor_release === NULL && $next_minor_release === NULL) { if ($project['status'] === UpdateManagerInterface::CURRENT) { Loading Loading @@ -216,15 +225,6 @@ final class UpdaterForm extends FormBase { $release_status = $this->t('Available update'); $type = 'update-recommended'; } if ($form_state->getUserInput()) { $results = []; } else { $event = new ReadinessCheckEvent($this->updater); $this->eventDispatcher->dispatch($event); $results = $event->getResults(); } $this->displayResults($results, $this->messenger(), $this->renderer); $create_update_buttons = !$stage_exists && $this->getOverallSeverity($results) !== SystemManager::REQUIREMENT_ERROR; if ($installed_minor_release) { $installed_version = ExtensionVersion::createFromVersionString($project_info->getInstalledVersion()); Loading
tests/src/Functional/UpdaterFormTest.php +15 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,21 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { $this->assertUpdateStagedTimes(0); } /** * Tests readiness checks are displayed when there is no update available. */ public function testReadinessCheckFailureWhenNoUpdate() { $assert_session = $this->assertSession(); $this->setCoreVersion('9.8.1'); $message = "You've not experienced Shakespeare until you have read him in the original Klingon."; $result = ValidationResult::createError([$message]); TestSubscriber1::setTestResult([$result], ReadinessCheckEvent::class); $this->checkForUpdates(); $this->drupalGet('/admin/reports/updates/automatic-update'); $assert_session->pageTextContains('No update available'); $assert_session->pageTextContains($message); } /** * Checks the table for a release on the form. * Loading