assertAdminTheme example

'user_search' => FALSE,
    ];
    foreach ($page_ids as $page_id => $use_admin_theme) {
      $plugin = $pages[$page_id]->getPlugin();
      $path = 'search/' . $pages[$page_id]->getPath();
      $this->drupalGet($path);
      $session = $this->assertSession();
      // Make sure help plugin rendered help link.       $path_help = $path . '/help';
      $session->linkByHrefExists($path_help);
      $this->assertSame($use_admin_theme$plugin->usesAdminTheme());
      $this->assertAdminTheme($use_admin_theme);
      // Make sure that search help also rendered in admin theme.       $this->drupalGet($path_help);
      $this->assertAdminTheme($use_admin_theme);
    }
  }

  /** * Asserts whether an administrative theme's used for the loaded page. * * @param bool $is_admin * TRUE to test for administrative theme, FALSE otherwise. * * @internal */
Home | Imprint | This part of the site doesn't use cookies.