diff --git a/core/modules/update/tests/src/Functional/UpdateContribTest.php b/core/modules/update/tests/src/Functional/UpdateContribTest.php index db631fef4d..2d06e3d0d5 100644 --- a/core/modules/update/tests/src/Functional/UpdateContribTest.php +++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php @@ -797,7 +797,6 @@ public function testUnsupportedRelease() { */ protected function assertCoreCompatibilityMessage($version, $expected_range, $expected_release_title, $is_compatible = TRUE) { $update_element = $this->findUpdateElementByLabel($expected_release_title); - $this->assertNotEmpty($update_element, 'The update element exists.'); $this->assertTrue($update_element->hasLink($version)); $compatibility_details = $update_element->find('css', '.project-update__compatibility-details details'); $this->assertContains("Requires Drupal core: $expected_range", $compatibility_details->getText()); diff --git a/core/modules/update/tests/src/Functional/UpdateTestBase.php b/core/modules/update/tests/src/Functional/UpdateTestBase.php index d7be77e9d7..5ca84d922b 100644 --- a/core/modules/update/tests/src/Functional/UpdateTestBase.php +++ b/core/modules/update/tests/src/Functional/UpdateTestBase.php @@ -196,7 +196,6 @@ protected function assertSecurityUpdates($project_path_part, array $expected_sec protected function assertVersionUpdateLinks($label, $version, $download_version = NULL) { $download_version = $download_version ?? $version; $update_element = $this->findUpdateElementByLabel($label); - $this->assertNotEmpty($update_element, 'The update element exists.'); // In the release notes URL the periods are replaced with dashes. $url_version = str_replace('.', '-', $version); @@ -277,21 +276,17 @@ protected function assertUpdateTableElementContains($text) { /** * Finds an update page element by label. - + * * @param string $label * The label for the update, for example "Recommended version:" or * "Latest version:". * - * @return \Behat\Mink\Element\NodeElement|null - * The update element if found, otherwise NULL. + * @return \Behat\Mink\Element\NodeElement + * The update element. */ protected function findUpdateElementByLabel($label) { - $update_elements = $this->getSession() - ->getPage() + $update_elements = $this->getSession()->getPage() ->findAll('css', $this->updateTableLocator . " .project-update__version:contains(\"$label\")"); - if (empty($update_elements)) { - return NULL; - } $this->assertCount(1, $update_elements); return $update_elements[0]; }