diff --git a/automatic_updates_extensions/automatic_updates_extensions.links.task.yml b/automatic_updates_extensions/automatic_updates_extensions.links.task.yml new file mode 100644 index 0000000000000000000000000000000000000000..51fc9b15bf27e8906b8af38594de1151f9a90479 --- /dev/null +++ b/automatic_updates_extensions/automatic_updates_extensions.links.task.yml @@ -0,0 +1,17 @@ +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 diff --git a/automatic_updates_extensions/automatic_updates_extensions.routing.yml b/automatic_updates_extensions/automatic_updates_extensions.routing.yml index ca8b733fb2043dc0c091ec39ba5ac61dc40c20d0..5206cecf58e4b3860676dd601f66b1c0e4ca2a78 100644 --- a/automatic_updates_extensions/automatic_updates_extensions.routing.yml +++ b/automatic_updates_extensions/automatic_updates_extensions.routing.yml @@ -1,5 +1,5 @@ -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 diff --git a/automatic_updates_extensions/tests/src/Functional/UpdaterFormTest.php b/automatic_updates_extensions/tests/src/Functional/UpdaterFormTest.php index dc51055e5851a406045594c55b87c88414002aa5..568a73a70efbaf2a382c41713f6dce18112039b5 100644 --- a/automatic_updates_extensions/tests/src/Functional/UpdaterFormTest.php +++ b/automatic_updates_extensions/tests/src/Functional/UpdaterFormTest.php @@ -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);