Skip to content
Snippets Groups Projects
Commit 8bf9b100 authored by Theresa Grannum's avatar Theresa Grannum Committed by Ted Bowman
Browse files

Issue #3273011 by Theresa.Grannum: Create local task links for Automatic Updates Extension form

parent c565ab36
No related branches found
No related tags found
No related merge requests found
automatic_updates_extensions.report_update:
route_name: automatic_updates_extensions.report_update
base_route: system.admin_reports
title: Update Extensions
weight: 20
automatic_updates_extensions.module_update:
route_name: automatic_updates_extensions.module_update
base_route: system.modules_list
title: Update Extensions
weight: 20
automatic_updates_extensions.theme_update:
route_name: automatic_updates_extension.theme_update
base_route: system.themes_page
title: Update Extensions
weight: 20
automatic_updates_extensions.update:
path: '/admin/automatic-update-extensions'
automatic_updates_extensions.report_update:
path: 'admin/reports/updates/automatic-update-extensions'
defaults:
_form: 'Drupal\automatic_updates_extensions\Form\UpdaterForm'
_title: 'Automatic Updates Form'
......@@ -8,3 +8,23 @@ automatic_updates_extensions.update:
options:
_admin_route: TRUE
_automatic_updates_readiness_messages: skip
automatic_updates_extensions.module_update:
path: '/admin/modules/automatic-update-extensions'
defaults:
_form: 'Drupal\automatic_updates_extensions\Form\UpdaterForm'
_title: 'Automatic Updates Form'
requirements:
_permission: 'administer software updates'
options:
_admin_route: TRUE
automatic_updates_extension.theme_update:
path: '/admin/appearance/automatic-update-extensions'
defaults:
_form: 'Drupal\automatic_updates_extensions\Form\UpdaterForm'
_title: 'Automatic Updates Form'
requirements:
_permission: 'administer software updates'
options:
_admin_route: TRUE
......@@ -28,6 +28,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
protected static $modules = [
'automatic_updates_test',
'automatic_updates_extensions',
'block',
'semver_test',
];
......@@ -44,6 +45,8 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
protected function setUp(): void {
parent::setUp();
$this->setReleaseMetadata(__DIR__ . '/../../../../tests/fixtures/release-history/semver_test.1.1.xml');
$this->drupalLogin($this->rootUser);
$this->drupalPlaceBlock('local_tasks_block', ['primary' => TRUE]);
}
/**
......@@ -94,12 +97,12 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$this->drupalLogin($user);
$this->setProjectInstalledVersion('8.1.0');
$this->checkForUpdates();
$this->drupalGet('/admin/automatic-update-extensions');
$this->drupalGet('admin/reports/updates/automatic-update-extensions');
$assert->pageTextContains('Access Denied');
$assert->pageTextNotContains('Automatic Updates Form');
$user = $this->createUser(['administer software updates']);
$this->drupalLogin($user);
$this->drupalGet('/admin/automatic-update-extensions');
$this->drupalGet('admin/reports/updates/automatic-update-extensions');
$this->assertTableShowsUpdates();
$assert->pageTextContains('Automatic Updates Form');
$assert->buttonExists('Update');
......@@ -117,7 +120,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$this->drupalLogin($user);
$this->setProjectInstalledVersion('8.1.1');
$this->checkForUpdates();
$this->drupalGet('/admin/automatic-update-extensions');
$this->drupalGet('admin/reports/updates/automatic-update-extensions');
$assert->pageTextContains('There are no available updates.');
$assert->buttonNotExists('Update');
}
......@@ -134,7 +137,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$this->drupalLogin($user);
$this->setProjectInstalledVersion('8.1.0');
$this->checkForUpdates();
$this->drupalGet('/admin/automatic-update-extensions');
$this->drupalGet('admin/reports/updates/automatic-update-extensions');
$this->assertTableShowsUpdates();
$message = t("You've not experienced Shakespeare until you have read him in the original Klingon.");
$error = ValidationResult::createError([$message]);
......@@ -151,17 +154,14 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
*/
public function testWarnings(): void {
$assert = $this->assertSession();
$user = $this->createUser([
'administer site configuration',
'administer software updates',
]);
$this->drupalLogin($user);
$this->setProjectInstalledVersion('8.1.0');
$this->checkForUpdates();
$message = t("Warning! Updating this module may cause an error.");
$warning = ValidationResult::createWarning([$message]);
TestSubscriber1::setTestResult([$warning], ReadinessCheckEvent::class);
$this->drupalGet('/admin/automatic-update-extensions');
// Navigate to the automatic updates form.
$this->drupalGet('/admin/reports/updates');
$this->clickLink('Update Extensions');
$this->assertTableShowsUpdates();
$assert->pageTextContains(static::$warningsExplanation);
$assert->pageTextNotContains(static::$errorsExplanation);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment