diff options
Diffstat (limited to 'tests')
6 files changed, 17 insertions, 15 deletions
diff --git a/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php b/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php index 105e8add..9c7aba6b 100644 --- a/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php +++ b/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php | |||
@@ -43,9 +43,9 @@ abstract class WallabagAnnotationTestCase extends WebTestCase | |||
43 | $container = $client->getContainer(); | 43 | $container = $client->getContainer(); |
44 | 44 | ||
45 | /** @var $userManager \FOS\UserBundle\Doctrine\UserManager */ | 45 | /** @var $userManager \FOS\UserBundle\Doctrine\UserManager */ |
46 | $userManager = $container->get('fos_user.user_manager'); | 46 | $userManager = $container->get('fos_user.user_manager.test'); |
47 | /** @var $loginManager \FOS\UserBundle\Security\LoginManager */ | 47 | /** @var $loginManager \FOS\UserBundle\Security\LoginManager */ |
48 | $loginManager = $container->get('fos_user.security.login_manager'); | 48 | $loginManager = $container->get('fos_user.security.login_manager.test'); |
49 | $firewallName = $container->getParameter('fos_user.firewall_name'); | 49 | $firewallName = $container->getParameter('fos_user.firewall_name'); |
50 | 50 | ||
51 | $this->user = $userManager->findUserBy(['username' => 'admin']); | 51 | $this->user = $userManager->findUserBy(['username' => 'admin']); |
diff --git a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php index f58d1c12..090155d7 100644 --- a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php | |||
@@ -121,7 +121,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase | |||
121 | { | 121 | { |
122 | $client = $this->getClient(); | 122 | $client = $this->getClient(); |
123 | $em = $client->getContainer()->get('doctrine.orm.entity_manager'); | 123 | $em = $client->getContainer()->get('doctrine.orm.entity_manager'); |
124 | $userManager = $client->getContainer()->get('fos_user.user_manager'); | 124 | $userManager = $client->getContainer()->get('fos_user.user_manager.test'); |
125 | $user = $userManager->findUserBy(['username' => $username]); | 125 | $user = $userManager->findUserBy(['username' => $username]); |
126 | $apiClient = new Client($user); | 126 | $apiClient = new Client($user); |
127 | $apiClient->setName('My app'); | 127 | $apiClient->setName('My app'); |
diff --git a/tests/Wallabag/ApiBundle/WallabagApiTestCase.php b/tests/Wallabag/ApiBundle/WallabagApiTestCase.php index 8a188e1c..0c52aea0 100644 --- a/tests/Wallabag/ApiBundle/WallabagApiTestCase.php +++ b/tests/Wallabag/ApiBundle/WallabagApiTestCase.php | |||
@@ -31,9 +31,9 @@ abstract class WallabagApiTestCase extends WebTestCase | |||
31 | $container = $client->getContainer(); | 31 | $container = $client->getContainer(); |
32 | 32 | ||
33 | /** @var $userManager \FOS\UserBundle\Doctrine\UserManager */ | 33 | /** @var $userManager \FOS\UserBundle\Doctrine\UserManager */ |
34 | $userManager = $container->get('fos_user.user_manager'); | 34 | $userManager = $container->get('fos_user.user_manager.test'); |
35 | /** @var $loginManager \FOS\UserBundle\Security\LoginManager */ | 35 | /** @var $loginManager \FOS\UserBundle\Security\LoginManager */ |
36 | $loginManager = $container->get('fos_user.security.login_manager'); | 36 | $loginManager = $container->get('fos_user.security.login_manager.test'); |
37 | $firewallName = $container->getParameter('fos_user.firewall_name'); | 37 | $firewallName = $container->getParameter('fos_user.firewall_name'); |
38 | 38 | ||
39 | $this->user = $userManager->findUserBy(['username' => 'admin']); | 39 | $this->user = $userManager->findUserBy(['username' => 'admin']); |
diff --git a/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php b/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php index b13f6519..c4bd6dac 100644 --- a/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php | |||
@@ -26,7 +26,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase | |||
26 | { | 26 | { |
27 | parent::setUp(); | 27 | parent::setUp(); |
28 | 28 | ||
29 | $userRepository = $this->getClient()->getContainer()->get('wallabag_user.user_repository'); | 29 | $userRepository = $this->getClient()->getContainer()->get('wallabag_user.user_repository.test'); |
30 | 30 | ||
31 | $user = $userRepository->findOneByUserName('admin'); | 31 | $user = $userRepository->findOneByUserName('admin'); |
32 | $this->adminEntry = new Entry($user); | 32 | $this->adminEntry = new Entry($user); |
@@ -60,7 +60,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase | |||
60 | 60 | ||
61 | $reloadedEntries = $this->getClient() | 61 | $reloadedEntries = $this->getClient() |
62 | ->getContainer() | 62 | ->getContainer() |
63 | ->get('wallabag_core.entry_repository') | 63 | ->get('wallabag_core.entry_repository.test') |
64 | ->findById([$this->adminEntry->getId(), $this->bobEntry->getId()]); | 64 | ->findById([$this->adminEntry->getId(), $this->bobEntry->getId()]); |
65 | 65 | ||
66 | foreach ($reloadedEntries as $reloadedEntry) { | 66 | foreach ($reloadedEntries as $reloadedEntry) { |
@@ -84,7 +84,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase | |||
84 | 'interactive' => false, | 84 | 'interactive' => false, |
85 | ]); | 85 | ]); |
86 | 86 | ||
87 | $entryRepository = $this->getClient()->getContainer()->get('wallabag_core.entry_repository'); | 87 | $entryRepository = $this->getClient()->getContainer()->get('wallabag_core.entry_repository.test'); |
88 | 88 | ||
89 | $reloadedAdminEntry = $entryRepository->find($this->adminEntry->getId()); | 89 | $reloadedAdminEntry = $entryRepository->find($this->adminEntry->getId()); |
90 | $this->assertNotEmpty($reloadedAdminEntry->getContent()); | 90 | $this->assertNotEmpty($reloadedAdminEntry->getContent()); |
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 0ac119d8..6effe43e 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -985,8 +985,13 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
985 | $client->request('GET', '/share/' . $content->getId()); | 985 | $client->request('GET', '/share/' . $content->getId()); |
986 | $this->assertSame(302, $client->getResponse()->getStatusCode()); | 986 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
987 | 987 | ||
988 | // follow link with uid | 988 | $shareUrl = $client->getResponse()->getTargetUrl(); |
989 | $crawler = $client->followRedirect(); | 989 | |
990 | // use a new client to have a fresh empty session (instead of a logged one from the previous client) | ||
991 | $client->restart(); | ||
992 | |||
993 | $client->request('GET', $shareUrl); | ||
994 | |||
990 | $this->assertSame(200, $client->getResponse()->getStatusCode()); | 995 | $this->assertSame(200, $client->getResponse()->getStatusCode()); |
991 | $this->assertContains('max-age=25200', $client->getResponse()->headers->get('cache-control')); | 996 | $this->assertContains('max-age=25200', $client->getResponse()->headers->get('cache-control')); |
992 | $this->assertContains('public', $client->getResponse()->headers->get('cache-control')); | 997 | $this->assertContains('public', $client->getResponse()->headers->get('cache-control')); |
@@ -1002,9 +1007,6 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
1002 | $client->request('GET', '/share/' . $content->getUid()); | 1007 | $client->request('GET', '/share/' . $content->getUid()); |
1003 | $this->assertSame(404, $client->getResponse()->getStatusCode()); | 1008 | $this->assertSame(404, $client->getResponse()->getStatusCode()); |
1004 | 1009 | ||
1005 | $client->request('GET', '/view/' . $content->getId()); | ||
1006 | $this->assertContains('no-cache', $client->getResponse()->headers->get('cache-control')); | ||
1007 | |||
1008 | // removing the share | 1010 | // removing the share |
1009 | $client->request('GET', '/share/delete/' . $content->getId()); | 1011 | $client->request('GET', '/share/delete/' . $content->getId()); |
1010 | $this->assertSame(302, $client->getResponse()->getStatusCode()); | 1012 | $this->assertSame(302, $client->getResponse()->getStatusCode()); |
diff --git a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php index 6e1163c5..816d22f4 100644 --- a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php +++ b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php | |||
@@ -84,8 +84,8 @@ abstract class WallabagCoreTestCase extends WebTestCase | |||
84 | $container = $this->client->getContainer(); | 84 | $container = $this->client->getContainer(); |
85 | $session = $container->get('session'); | 85 | $session = $container->get('session'); |
86 | 86 | ||
87 | $userManager = $container->get('fos_user.user_manager'); | 87 | $userManager = $container->get('fos_user.user_manager.test'); |
88 | $loginManager = $container->get('fos_user.security.login_manager'); | 88 | $loginManager = $container->get('fos_user.security.login_manager.test'); |
89 | $firewallName = $container->getParameter('fos_user.firewall_name'); | 89 | $firewallName = $container->getParameter('fos_user.firewall_name'); |
90 | 90 | ||
91 | $user = $userManager->findUserBy(['username' => $username]); | 91 | $user = $userManager->findUserBy(['username' => $username]); |