aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-08-24 22:29:36 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-08-24 22:29:36 +0200
commiteddda878a0ec375fa738e3228a72dd01b23e0fab (patch)
tree7bc8bb34a14d09f0e75ddc052e560486bb6d69b7 /tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
parentb1afef30dc5527e5bf57c3eff60b05ee478a6014 (diff)
downloadwallabag-eddda878a0ec375fa738e3228a72dd01b23e0fab.tar.gz
wallabag-eddda878a0ec375fa738e3228a72dd01b23e0fab.tar.zst
wallabag-eddda878a0ec375fa738e3228a72dd01b23e0fab.zip
Update test
and some cleanup
Diffstat (limited to 'tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php')
-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}