function ThemeTest::assertThemeIncompatibleText

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/System/ThemeTest.php \Drupal\Tests\system\Functional\System\ThemeTest::assertThemeIncompatibleText()
  2. 10 core/modules/system/tests/src/Functional/System/ThemeTest.php \Drupal\Tests\system\Functional\System\ThemeTest::assertThemeIncompatibleText()
  3. 11.x core/modules/system/tests/src/Functional/System/ThemeTest.php \Drupal\Tests\system\Functional\System\ThemeTest::assertThemeIncompatibleText()

Asserts that expected incompatibility text is displayed for a theme.

Parameters

string $theme_name: Theme name to select element on page. This can be a partial name.

string $expected_text: The expected incompatibility text.

1 call to ThemeTest::assertThemeIncompatibleText()
ThemeTest::testInvalidTheme in core/modules/system/tests/src/Functional/System/ThemeTest.php
Test themes can't be installed when the base theme or engine is missing.

File

core/modules/system/tests/src/Functional/System/ThemeTest.php, line 503

Class

ThemeTest
Tests the theme interface functionality by enabling and switching themes, and using an administration theme.

Namespace

Drupal\Tests\system\Functional\System

Code

private function assertThemeIncompatibleText($theme_name, $expected_text) {
    $this->assertSession()
        ->elementExists('css', ".theme-info:contains(\"{$theme_name}\") .incompatible:contains(\"{$expected_text}\")");
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.