diff --git a/core/modules/simpletest/src/InstallerTestBase.php b/core/modules/simpletest/src/InstallerTestBase.php index 73ca636132..151e9eff00 100644 --- a/core/modules/simpletest/src/InstallerTestBase.php +++ b/core/modules/simpletest/src/InstallerTestBase.php @@ -122,7 +122,7 @@ protected function setUp() { // Select profile. $this->setUpProfile(); - // Skip the warning about old PHP, if applicable. + // Address the requirements problem screen, if any. $this->setUpRequirementsProblem(); // Configure settings. @@ -244,16 +244,14 @@ protected function continueOnExpectedWarnings($allowed_warnings = []) { if (strpos($this->getTextContent(), 'Errors found')) { return; } - $warning_elements = $this->cssSelect('.system-status-report__entry--warning summary'); - // Don't allow more warnings than the ones permitted. - if (count($allowed_warnings) >= count($warning_elements)) { - $allowed_warning_list = implode(', ', $allowed_warnings); + $warning_elements = $this->cssSelect('h3#warning+details summary'); + // Confirm that there are only the expected warnings. + if (count($allowed_warnings) == count($warning_elements)) { + $warnings = []; foreach ($warning_elements as $warning) { - $warning = trim((string) $warning); - if (!in_array($warning, $allowed_warnings, TRUE)) { - $this->fail("Warning '$warning' is not one of the allowed warnings ($allowed_warning_list)"); - } + $warnings[] = trim((string) $warning); } + $this->assertEqual($allowed_warnings, $warnings); $this->clickLink('continue anyway'); } }