aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
index 3b54f057..f9ac28c3 100644
--- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
@@ -709,11 +709,36 @@ class EntryControllerTest extends WallabagCoreTestCase
709 ->getRepository('WallabagCoreBundle:Entry') 709 ->getRepository('WallabagCoreBundle:Entry')
710 ->findOneByUser($this->getLoggedInUserId()); 710 ->findOneByUser($this->getLoggedInUserId());
711 711
712 // no uuid
712 $client->request('GET', '/share/'.$content->getUuid()); 713 $client->request('GET', '/share/'.$content->getUuid());
713 $this->assertContains('max-age=25200, public', $client->getResponse()->headers->get('cache-control')); 714 $this->assertEquals(404, $client->getResponse()->getStatusCode());
715
716 // generating the uuid
717 $client->request('GET', '/share/'.$content->getId());
718 $this->assertEquals(302, $client->getResponse()->getStatusCode());
719
720 // follow link with uuid
721 $crawler = $client->followRedirect();
722 $this->assertEquals(200, $client->getResponse()->getStatusCode());
723 $this->assertContains('max-age=25200', $client->getResponse()->headers->get('cache-control'));
724 $this->assertContains('public', $client->getResponse()->headers->get('cache-control'));
725 $this->assertContains('s-maxage=25200', $client->getResponse()->headers->get('cache-control'));
714 $this->assertNotContains('no-cache', $client->getResponse()->headers->get('cache-control')); 726 $this->assertNotContains('no-cache', $client->getResponse()->headers->get('cache-control'));
715 727
728 // sharing is now disabled
729 $client->getContainer()->get('craue_config')->set('share_public', 0);
730 $client->request('GET', '/share/'.$content->getUuid());
731 $this->assertEquals(404, $client->getResponse()->getStatusCode());
732
716 $client->request('GET', '/view/'.$content->getId()); 733 $client->request('GET', '/view/'.$content->getId());
717 $this->assertContains('no-cache', $client->getResponse()->headers->get('cache-control')); 734 $this->assertContains('no-cache', $client->getResponse()->headers->get('cache-control'));
735
736 // removing the share
737 $client->request('GET', '/share/delete/'.$content->getId());
738 $this->assertEquals(302, $client->getResponse()->getStatusCode());
739
740 // share is now disable
741 $client->request('GET', '/share/'.$content->getUuid());
742 $this->assertEquals(404, $client->getResponse()->getStatusCode());
718 } 743 }
719} 744}