diff --git a/core/tests/Drupal/Tests/RequirementsPageTrait.php b/core/tests/Drupal/Tests/RequirementsPageTrait.php index 44f9bb9dc2e..b71afba0841 100644 --- a/core/tests/Drupal/Tests/RequirementsPageTrait.php +++ b/core/tests/Drupal/Tests/RequirementsPageTrait.php @@ -12,7 +12,8 @@ trait RequirementsPageTrait { */ protected function updateRequirementsProblem() { // Assert a warning is shown on older test environments. - if (version_compare(phpversion(), DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) { + $links = $this->getSession()->getPage()->findAll('named', ['link', 'try again']); + if ($links && version_compare(phpversion(), DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) { $this->assertNoText('Errors found'); $this->assertWarningSummaries(['PHP']); $this->clickLink('try again');