protected function AssertTrait::assertActiveStylePath in Style Switcher 3.0.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/AssertTrait.php \Drupal\Tests\styleswitcher\Functional\AssertTrait::assertActiveStylePath()
Asserts that an active style's CSS URL ends with a given suffix.
Parameters
string $expected_suffix: Expected URL suffix.
string $theme: (optional) Name of the theme to check an active style for. NULL for $this->defaultTheme.
6 calls to AssertTrait::assertActiveStylePath()
- ConfigTest::testActiveStyleOnStyleDelete in tests/
src/ Functional/ ConfigTest.php - Tests active style is replaced with default one when deleted.
- ConfigTest::testConfigCustomStyleChangesPath in tests/
src/ Functional/ ConfigTest.php - Tests active style path changes according to the config changes.
- ConfigTest::testConfigStylesSettings in tests/
src/ Functional/ ConfigTest.php - Tests the styles settings config.
- CookieTest::testCookie in tests/
src/ Functional/ CookieTest.php - Tests the cookie is set for the whole site.
- CookieUpdateTest::testCookieUpdates in tests/
src/ Functional/ CookieUpdateTest.php - Tests cookie updates.
File
- tests/
src/ Functional/ AssertTrait.php, line 50
Class
- AssertTrait
- Provides test assertions for the Style Switcher.
Namespace
Drupal\Tests\styleswitcher\FunctionalCode
protected function assertActiveStylePath(string $expected_suffix, string $theme = NULL) {
$session = $this
->getSession();
$this
->drupalGet('styleswitcher/css/' . ($theme ?? $this->defaultTheme));
$this
->assertStringEndsWith($expected_suffix, $session
->getCurrentUrl());
}