From 3474fb9ce3d015ea32845c79240d11f8b3172892 Mon Sep 17 00:00:00 2001 From: "Theresa.Grannum" <theresa.grannum@3688861.no-reply.drupal.org> Date: Wed, 5 Oct 2022 15:37:07 +0000 Subject: [PATCH] Issue #3313630 by Theresa.Grannum, phenaproxima: Automatic Updates help has the wrong route name and errors --- automatic_updates.module | 3 +- tests/src/Functional/HelpPageTest.php | 40 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tests/src/Functional/HelpPageTest.php diff --git a/automatic_updates.module b/automatic_updates.module index eaff944273..e793fd50cf 100644 --- a/automatic_updates.module +++ b/automatic_updates.module @@ -10,13 +10,14 @@ use Drupal\Core\Routing\RouteMatchInterface; use Drupal\automatic_updates\Validation\AdminReadinessMessages; use Drupal\Core\Url; use Drupal\system\Controller\DbUpdateController; +use Drupal\package_manager\Validator\ComposerExecutableValidator; /** * Implements hook_help(). */ function automatic_updates_help($route_name, RouteMatchInterface $route_match) { switch ($route_name) { - case 'help.page.auto_updates': + case 'help.page.automatic_updates': $output = '<h3>' . t('About') . '</h3>'; $output .= '<p>' . t('Automatic Updates lets you update Drupal core.') . '</p>'; $output .= '<p>'; diff --git a/tests/src/Functional/HelpPageTest.php b/tests/src/Functional/HelpPageTest.php new file mode 100644 index 0000000000..0061daff86 --- /dev/null +++ b/tests/src/Functional/HelpPageTest.php @@ -0,0 +1,40 @@ +<?php + +namespace Drupal\Tests\automatic_updates\Functional; + +use Drupal\Tests\BrowserTestBase; + +/** + * @group automatic_updates + */ +class HelpPageTest extends BrowserTestBase { + + /** + * {@inheritdoc} + */ + protected static $modules = [ + 'automatic_updates', + 'help', + ]; + + /** + * {@inheritdoc} + */ + protected $defaultTheme = 'stark'; + + /** + * Tests that the help page for Automatic Updates loads correctly. + */ + public function testHelpPage(): void { + $user = $this->createUser([ + 'access administration pages', + ]); + $this->drupalLogin($user); + $this->drupalGet('/admin/help/automatic_updates'); + + $assert_session = $this->assertSession(); + $assert_session->statusCodeEquals(200); + $assert_session->pageTextContains('Automatic Updates'); + } + +} -- GitLab