Skip to content
Snippets Groups Projects
Commit 8bb18523 authored by Ted Bowman's avatar Ted Bowman
Browse files

Issue #3284495 by tedbow: Tests failing on 9.3.x

parent 56f2e341
No related branches found
No related tags found
No related merge requests found
...@@ -85,12 +85,17 @@ class UpdaterFormNoRecommendedReleaseMessageTest extends AutomaticUpdatesFunctio ...@@ -85,12 +85,17 @@ class UpdaterFormNoRecommendedReleaseMessageTest extends AutomaticUpdatesFunctio
$this->drupalGet('/admin/reports/updates/automatic-update'); $this->drupalGet('/admin/reports/updates/automatic-update');
$assert_session = $this->assertSession(); $assert_session = $this->assertSession();
// BEGIN: DELETE FROM CORE MERGE REQUEST
// @todo Use \Drupal\Tests\WebAssert::statusMessageContains() when module
// drops support for Drupal core 9.3.x.
// END: DELETE FROM CORE MERGE REQUEST
$message_selector = $expected_message_type === 'status' ? "//div[@role='contentinfo' and h2[text()='Status message']]" : "//div[@role='alert' and h2[text()='Error message']]";
if ($updates_available) { if ($updates_available) {
$assert_session->statusMessageContains('Updates were found, but they must be performed manually.', $expected_message_type); $assert_session->elementTextContains('xpath', $message_selector, 'Updates were found, but they must be performed manually.');
$assert_session->linkExists('the list of available updates'); $assert_session->linkExists('the list of available updates');
} }
else { else {
$assert_session->statusMessageContains('No update available', $expected_message_type); $assert_session->elementTextContains('xpath', $message_selector, 'No update available');
} }
$assert_session->buttonNotExists('Update'); $assert_session->buttonNotExists('Update');
} }
......
...@@ -50,7 +50,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -50,7 +50,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
parent::setUp(); parent::setUp();
$this->setReleaseMetadata(__DIR__ . '/../../fixtures/release-history/drupal.9.8.1-security.xml'); $this->setReleaseMetadata(__DIR__ . '/../../fixtures/release-history/drupal.9.8.1-security.xml');
$user = $this->createUser([ $permissions = [
'administer site configuration', 'administer site configuration',
'administer software updates', 'administer software updates',
'access administration pages', 'access administration pages',
...@@ -58,7 +58,15 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -58,7 +58,15 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
'administer modules', 'administer modules',
'access site reports', 'access site reports',
'view update notifications', 'view update notifications',
]); ];
// BEGIN: DELETE FROM CORE MERGE REQUEST
// Check for permission that was added in Drupal core 9.4.x.
$available_permissions = array_keys($this->container->get('user.permissions')->getPermissions());
if (!in_array('view update notifications', $available_permissions)) {
array_pop($permissions);
}
// END: DELETE FROM CORE MERGE REQUEST
$user = $this->createUser($permissions);
$this->drupalLogin($user); $this->drupalLogin($user);
$this->checkForUpdates(); $this->checkForUpdates();
} }
......
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