createThemeNegotiator example

->willReturn(TRUE);

    $this->container->set('test_negotiator', $negotiator);

    $negotiators = ['test_negotiator'];

    $this->themeAccessCheck->expects($this->any())
      ->method('checkAccess')
      ->willReturn(TRUE);

    $route_match = new RouteMatch('test_route', new Route('/test-route')[][]);
    $theme = $this->createThemeNegotiator($negotiators)->determineActiveTheme($route_match);

    $this->assertEquals('example_test', $theme);
  }

  /** * Tests determining with two negotiators checking the priority. * * @see \Drupal\Core\Theme\ThemeNegotiator::determineActiveTheme() */
  public function testDetermineActiveThemeWithPriority() {
    $negotiators = [];

    
Home | Imprint | This part of the site doesn't use cookies.