Verified Commit 98fa7ce1 authored by Lee Rowlands's avatar Lee Rowlands Committed by Alex Pott
Browse files

Issue #3279788 by alexpott: PHP 7.3 testing on Drupal 9.4.x and 9.5.x is...

Issue #3279788 by alexpott: PHP 7.3 testing on Drupal 9.4.x and 9.5.x is broken due to \Drupal\Tests\RequirementsPageTrait::assertRequirementSummaries() assuming Seven is the update.php theme

(cherry picked from commit 23e599ba)
parent 0f3e14a9
Loading
Loading
Loading
Loading
+26 −14
Original line number Diff line number Diff line
@@ -79,6 +79,18 @@ protected function assertErrorSummaries(array $summaries) {
   *   The type of requirement, either 'warning' or 'error'.
   */
  protected function assertRequirementSummaries(array $summaries, string $type) {
    // The selectors are different for Seven and Claro.
    $is_claro = stripos($this->getSession()->getPage()->getContent(), 'claro/css/theme/maintenance-page.css') !== FALSE;

    $selectors = [];
    if ($is_claro) {
      // In Claro each requirement heading is present in a div with the class
      // system-status-report__status-title. There is one summary element per
      // requirement type and it is adjacent to a div with the class
      // claro-details__wrapper.
      $selectors[] = 'summary#' . $type . '+.claro-details__wrapper .system-status-report__status-title';
    }
    else {
      // Allow only details elements that are directly after the warning/error
      // header or each other. There is no guaranteed wrapper we can rely on
      // across distributions. When there are multiple warnings, the selectors
@@ -91,10 +103,10 @@ protected function assertRequirementSummaries(array $summaries, string $type) {
      // there isn't any other requirement message before clicking the link.
      // @todo Make this more reliable in
      //   https://www.drupal.org/project/drupal/issues/2927345.
    $selectors = [];
      for ($i = 0; $i <= count($summaries); $i++) {
        $selectors[] = 'h3#' . $type . implode('', array_fill(0, $i + 1, '+details')) . ' summary';
      }
    }
    $elements = $this->cssSelect(implode(', ', $selectors));

    // Confirm that there are only the expected requirements.