assertUrlIsSecured('/homepage'); } public function testIndexAction() { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $this->request($client, '/homepage'); $this->assertIsRedirect($client, '/en/timesheet/'); } public function testIndexActionWithChangedPreferences() { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $em = $client->getContainer()->get('doctrine.orm.entity_manager'); $user = $this->getUserByRole($em, User::ROLE_USER); $pref = (new UserPreference()) ->setName('login.initial_view') ->setValue('my_profile') ->setType(InitialViewType::class); $user->addPreference($pref); $pref = (new UserPreference()) ->setName('language') ->setValue('ar') ->setType(LanguageType::class); $user->addPreference($pref); $em->persist($pref); $this->request($client, '/homepage'); $this->assertIsRedirect($client, '/ar/profile/'); } }