public function AjaxBasePageNegotiatorTest::testDetermineActiveThemeValidToken in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php \Drupal\Tests\Core\Theme\AjaxBasePageNegotiatorTest::testDetermineActiveThemeValidToken()
@covers ::determineActiveTheme
File
- core/
tests/ Drupal/ Tests/ Core/ Theme/ AjaxBasePageNegotiatorTest.php, line 77
Class
- AjaxBasePageNegotiatorTest
- @coversDefaultClass \Drupal\Core\Theme\AjaxBasePageNegotiator @group Theme
Namespace
Drupal\Tests\Core\ThemeCode
public function testDetermineActiveThemeValidToken() {
$theme = 'seven';
$theme_token = 'valid_theme_token';
$request = new Request([], [
'ajax_page_state' => [
'theme' => $theme,
'theme_token' => $theme_token,
],
]);
$this->requestStack
->push($request);
$route_match = RouteMatch::createFromRequest($request);
$this->tokenGenerator
->validate($theme_token, $theme)
->willReturn(TRUE);
$result = $this->negotiator
->determineActiveTheme($route_match);
$this
->assertSame($theme, $result);
}