createMock(Environment::class), new EventDispatcher(), $this->createMock(ProjectStatisticService::class), $this->createMock(ActivityStatisticService::class) ); $this->assertEquals('html', $sut->getId()); $this->assertEquals('print', $sut->getTitle()); $this->assertEquals('print', $sut->getIcon()); } public function testRender() { $kernel = self::bootKernel(); /** @var Environment $twig */ $twig = self::getContainer()->get('twig'); $token = $this->createMock(TokenInterface::class); $token->expects($this->any())->method('getUser')->willReturn(new User()); $tokenStorage = new TokenStorage(); $tokenStorage->setToken($token); /** @var AppVariable $app */ $app = $twig->getGlobals()['app']; $twig->addGlobal('app', $app); $app->setTokenStorage($tokenStorage); $stack = self::getContainer()->get('request_stack'); $request = new Request(); $request->setLocale('en'); $stack->push($request); $sut = new HtmlRenderer( $twig, new EventDispatcher(), $this->createMock(ProjectStatisticService::class), $this->createMock(ActivityStatisticService::class) ); $response = $this->render($sut); $content = $response->getContent(); $this->assertStringContainsString('