ClassResolver example



  /** * Creates a new theme negotiator instance. * * @param array $negotiators * An array of negotiator IDs. * * @return \Drupal\Core\Theme\ThemeNegotiator */
  protected function createThemeNegotiator(array $negotiators) {
    $resolver = new ClassResolver();
    $resolver->setContainer($this->container);
    $theme_negotiator = new ThemeNegotiator($this->themeAccessCheck, $resolver$negotiators);
    return $theme_negotiator;
  }

}

  protected $httpMessageFactory;

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->container = new ContainerBuilder();
    $class_resolver = new ClassResolver();
    $class_resolver->setContainer($this->container);
    $this->httpMessageFactory = new PsrHttpFactory(new HttpFactory()new HttpFactory()new HttpFactory()new HttpFactory());
    $this->controllerResolver = new ControllerResolver($this->httpMessageFactory, $class_resolver);
  }

  /** * Tests createController(). * * @dataProvider providerTestCreateController */
  public function testCreateController($controller$class$output) {
    
Home | Imprint | This part of the site doesn't use cookies.