diff --git a/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.info.yml b/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.info.yml index f4828a7807347361c85cff28b887f38a90dc9b72..934ded52bc581c915d9177ef61a77ad38eafad29 100644 --- a/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.info.yml +++ b/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.info.yml @@ -1,4 +1,4 @@ -name: 'Update test with update_last_removed implementation' +name: 'Update test with hook_update_last_removed() implementation' type: module description: 'Support module for update testing.' package: Testing diff --git a/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.install b/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.install index 7b9700fca0ec3a2ebeb2540d25804b43f8a4dc22..1ba6ad1750c0ce44d6b89b61f0a57d64d947e5fc 100644 --- a/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.install +++ b/core/modules/system/tests/modules/update_test_last_removed/update_test_last_removed.install @@ -2,11 +2,11 @@ /** * @file - * Install, update and uninstall functions for the update_test_invalid_hook module. + * Update functions for the update_test_invalid_hook module. */ /** - * Implements hook_update_last_removed() + * Implements hook_update_last_removed(). */ function update_test_last_removed_update_last_removed() { return 8002; diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php index fc34b6adb9129e7b7b50e478262b9caa1950edcd..30f8b38905ab33e6d326ede13921a0a817cb36b1 100644 --- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php +++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathLastRemovedTest.php @@ -47,21 +47,21 @@ protected function setUp() { } /** - * Test that a module with a too old schema version can not be updated. + * Tests that a module with a too old schema version can not be updated. */ public function testLastRemovedVersion() { drupal_set_installed_schema_version('update_test_last_removed', 8000); drupal_set_installed_schema_version('system', 8804); - // Access the update page with too old versions for system and the test - // module, only the generic core message should be shown. + // Access the update page with a schema version that is too old for system + // and the test module, only the generic core message should be shown. $this->drupalLogin($this->updateUser); $this->drupalGet($this->updateUrl); $assert_session = $this->assertSession(); $assert_session->pageTextContains('Requirements problem'); $assert_session->pageTextContains('The version of Drupal you are trying to update from is too old'); $assert_session->pageTextContains('Updating to Drupal 9 is only supported from Drupal version 8.8.0 or higher. If you are trying to update from an older version, first update to the latest version of Drupal 8'); - $assert_session->pageTextNotContains('Unsupported schema version: Update test with update_last_removed implementation'); + $assert_session->pageTextNotContains('Unsupported schema version: Update test with hook_update_last_removed() implementation'); $assert_session->linkNotExists('Continue'); @@ -72,8 +72,8 @@ public function testLastRemovedVersion() { $assert_session->pageTextNotContains('The version of Drupal you are trying to update from is too old'); - $assert_session->pageTextContains('Unsupported schema version: Update test with update_last_removed implementation'); - $assert_session->pageTextContains('The installed version of the Update test with update_last_removed implementation module is too old to update. Update to an intermediate version first (last removed version: 8002, installed version: 8000).'); + $assert_session->pageTextContains('Unsupported schema version: Update test with hook_update_last_removed() implementation'); + $assert_session->pageTextContains('The installed version of the Update test with hook_update_last_removed() implementation module is too old to update. Update to an intermediate version first (last removed version: 8002, installed version: 8000).'); $assert_session->linkNotExists('Continue'); // Set the expected schema version for the node and test module, updates are diff --git a/core/tests/Drupal/Tests/UpdatePathTestTrait.php b/core/tests/Drupal/Tests/UpdatePathTestTrait.php index 8c3fc723d50439f056613d165f0a23e78281203f..421f7097f81b78292ce5a16c3c44e703d6b23c35 100644 --- a/core/tests/Drupal/Tests/UpdatePathTestTrait.php +++ b/core/tests/Drupal/Tests/UpdatePathTestTrait.php @@ -58,7 +58,8 @@ protected function runUpdates($update_url = NULL) { $this->fail('The update failed with the following message: "' . reset($failure)->getText() . '"'); } - // Ensure that there are no pending updates. + // Ensure that there are no pending updates. Clear the schema version + // static cache first in case it was accessed before running updates. drupal_get_installed_schema_version(NULL, TRUE); foreach (['update', 'post_update'] as $update_type) { switch ($update_type) {