]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
Jump to Symfony 3.4
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / Controller / EntryControllerTest.php
index 0ac119d86f2a2546db948f5d153da14281401f0d..6effe43e883412f5d2bf40a0470e4875ae82f5a9 100644 (file)
@@ -985,8 +985,13 @@ class EntryControllerTest extends WallabagCoreTestCase
         $client->request('GET', '/share/' . $content->getId());
         $this->assertSame(302, $client->getResponse()->getStatusCode());
 
-        // follow link with uid
-        $crawler = $client->followRedirect();
+        $shareUrl = $client->getResponse()->getTargetUrl();
+
+        // use a new client to have a fresh empty session (instead of a logged one from the previous client)
+        $client->restart();
+
+        $client->request('GET', $shareUrl);
+
         $this->assertSame(200, $client->getResponse()->getStatusCode());
         $this->assertContains('max-age=25200', $client->getResponse()->headers->get('cache-control'));
         $this->assertContains('public', $client->getResponse()->headers->get('cache-control'));
@@ -1002,9 +1007,6 @@ class EntryControllerTest extends WallabagCoreTestCase
         $client->request('GET', '/share/' . $content->getUid());
         $this->assertSame(404, $client->getResponse()->getStatusCode());
 
-        $client->request('GET', '/view/' . $content->getId());
-        $this->assertContains('no-cache', $client->getResponse()->headers->get('cache-control'));
-
         // removing the share
         $client->request('GET', '/share/delete/' . $content->getId());
         $this->assertSame(302, $client->getResponse()->getStatusCode());