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() { /** @var Environment $twig */ $twig = self::getContainer()->get('twig'); $user = $this->createMock(User::class); $user->method('getId')->willReturn(1); $user->method('getName')->willReturn('Testing'); $user->method('isAdmin')->willReturn(false); $user->method('isSuperAdmin')->willReturn(false); $user->method('getTimezone')->willReturn('America/Edmonton'); $token = $this->createMock(TokenInterface::class); $token->expects($this->any())->method('getUser')->willReturn($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('