getClientForAuthenticatedUser(User::ROLE_USER); $user = $this->getUserByRole(User::ROLE_USER); $this->request($client, '/dashboard/'); $this->assertTrue($client->getResponse()->isSuccessful()); $this->assertHasMainHeader($client, $user); $this->assertHasNavigation($client); } protected function assertHasMainHeader(HttpKernelBrowser $client, User $user) { $content = $client->getResponse()->getContent(); $this->assertStringContainsString('data-bs-toggle="dropdown" aria-label="Open user menu"', $content); $this->assertStringContainsString('href="/en/profile/' . $user->getUserIdentifier() . '"', $content); $this->assertStringContainsString('href="/en/profile/' . $user->getUserIdentifier() . '/edit"', $content); $this->assertStringContainsString('href="/en/profile/' . $user->getUserIdentifier() . '/prefs"', $content); $this->assertStringContainsString('href="/en/logout?_csrf_token=', $content); } protected function assertHasNavigation(HttpKernelBrowser $client) { $content = $client->getResponse()->getContent(); $this->assertStringContainsString('href="/en/dashboard/"', $content); $this->assertStringContainsString('href="/en/timesheet/"', $content); $this->assertStringContainsString('My times', $content); $this->assertStringContainsString('href="/en/calendar/"', $content); $this->assertStringContainsString('Calendar', $content); } public function testActiveEntries() { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $this->request($client, '/dashboard/'); $this->assertTrue($client->getResponse()->isSuccessful()); $content = $client->getResponse()->getContent(); $this->assertStringContainsString('