diff options
Diffstat (limited to 'tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php')
-rw-r--r-- | tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php index e07c57dd..cf9f1e97 100644 --- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php | |||
@@ -849,7 +849,7 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
849 | $entryArchived->setContent('Youhou'); | 849 | $entryArchived->setContent('Youhou'); |
850 | $entryArchived->setTitle('Youhou'); | 850 | $entryArchived->setTitle('Youhou'); |
851 | $entryArchived->addTag($tagArchived); | 851 | $entryArchived->addTag($tagArchived); |
852 | $entryArchived->setArchived(true); | 852 | $entryArchived->updateArchived(true); |
853 | $em->persist($entryArchived); | 853 | $em->persist($entryArchived); |
854 | 854 | ||
855 | $annotationArchived = new Annotation($user); | 855 | $annotationArchived = new Annotation($user); |
@@ -965,4 +965,39 @@ class ConfigControllerTest extends WallabagCoreTestCase | |||
965 | 965 | ||
966 | $client->request('GET', '/config/view-mode'); | 966 | $client->request('GET', '/config/view-mode'); |
967 | } | 967 | } |
968 | |||
969 | public function testChangeLocaleWithoutReferer() | ||
970 | { | ||
971 | $client = $this->getClient(); | ||
972 | |||
973 | $client->request('GET', '/locale/de'); | ||
974 | $client->followRedirect(); | ||
975 | |||
976 | $this->assertSame('de', $client->getRequest()->getLocale()); | ||
977 | $this->assertSame('de', $client->getContainer()->get('session')->get('_locale')); | ||
978 | } | ||
979 | |||
980 | public function testChangeLocaleWithReferer() | ||
981 | { | ||
982 | $client = $this->getClient(); | ||
983 | |||
984 | $client->request('GET', '/login'); | ||
985 | $client->request('GET', '/locale/de'); | ||
986 | $client->followRedirect(); | ||
987 | |||
988 | $this->assertSame('de', $client->getRequest()->getLocale()); | ||
989 | $this->assertSame('de', $client->getContainer()->get('session')->get('_locale')); | ||
990 | } | ||
991 | |||
992 | public function testChangeLocaleToBadLocale() | ||
993 | { | ||
994 | $client = $this->getClient(); | ||
995 | |||
996 | $client->request('GET', '/login'); | ||
997 | $client->request('GET', '/locale/yuyuyuyu'); | ||
998 | $client->followRedirect(); | ||
999 | |||
1000 | $this->assertNotSame('yuyuyuyu', $client->getRequest()->getLocale()); | ||
1001 | $this->assertNotSame('yuyuyuyu', $client->getContainer()->get('session')->get('_locale')); | ||
1002 | } | ||
968 | } | 1003 | } |