You are here

protected function ControllerResolverTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php \Drupal\Tests\Core\Controller\ControllerResolverTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php, line 57
Contains \Drupal\Tests\Core\Controller\ControllerResolverTest.

Class

ControllerResolverTest
@coversDefaultClass \Drupal\Core\Controller\ControllerResolver @group Controller

Namespace

Drupal\Tests\Core\Controller

Code

protected function setUp() : void {
  parent::setUp();
  $this->container = new ContainerBuilder();
  $class_resolver = new ClassResolver();
  $class_resolver
    ->setContainer($this->container);
  $this->httpMessageFactory = new PsrHttpFactory(new ServerRequestFactory(), new StreamFactory(), new UploadedFileFactory(), new ResponseFactory());
  $this->controllerResolver = new ControllerResolver($this->httpMessageFactory, $class_resolver);
}