You are here

protected function PageManagerAdminTest::assertTheme in Page Manager 8

Asserts that a theme was used for the page.

Parameters

string $theme_name: The theme name.

1 call to PageManagerAdminTest::assertTheme()
PageManagerAdminTest::doTestAdminPath in page_manager_ui/src/Tests/PageManagerAdminTest.php
Tests changing the admin theme of a page.

File

page_manager_ui/src/Tests/PageManagerAdminTest.php, line 678
Contains \Drupal\page_manager_ui\Tests\PageManagerAdminTest.

Class

PageManagerAdminTest
Tests the admin UI for page entities.

Namespace

Drupal\page_manager_ui\Tests

Code

protected function assertTheme($theme_name) {
  $url = Url::fromUri('base:core/themes/' . $theme_name . '/logo.svg')
    ->toString();
  $elements = $this
    ->xpath('//img[contains(@src, :url)]', [
    ':url' => $url,
  ]);
  $this
    ->assertEqual(count($elements), 1, new FormattableMarkup('Page is rendered in @theme', [
    '@theme' => $theme_name,
  ]));
}