diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-04-15 13:42:13 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-08-23 16:49:21 +0200 |
commit | a7e2218e253138ed53e18b4775dce291c78246c5 (patch) | |
tree | b42d5a26987149f8372c49ef7f78a63ed81867e3 /tests/Wallabag | |
parent | 222e09f140099f3b1b8f6db1846d35e6810d43a3 (diff) | |
download | wallabag-a7e2218e253138ed53e18b4775dce291c78246c5.tar.gz wallabag-a7e2218e253138ed53e18b4775dce291c78246c5.tar.zst wallabag-a7e2218e253138ed53e18b4775dce291c78246c5.zip |
Add test and fix migration
Diffstat (limited to 'tests/Wallabag')
-rw-r--r-- | tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 5c739c78..3b54f057 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -698,4 +698,22 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
698 | $crawler = $client->submit($form, $data); | 698 | $crawler = $client->submit($form, $data); |
699 | $this->assertCount(2, $crawler->filter('div[class=entry]')); | 699 | $this->assertCount(2, $crawler->filter('div[class=entry]')); |
700 | } | 700 | } |
701 | |||
702 | public function testCache() | ||
703 | { | ||
704 | $this->logInAs('admin'); | ||
705 | $client = $this->getClient(); | ||
706 | |||
707 | $content = $client->getContainer() | ||
708 | ->get('doctrine.orm.entity_manager') | ||
709 | ->getRepository('WallabagCoreBundle:Entry') | ||
710 | ->findOneByUser($this->getLoggedInUserId()); | ||
711 | |||
712 | $client->request('GET', '/share/'.$content->getUuid()); | ||
713 | $this->assertContains('max-age=25200, public', $client->getResponse()->headers->get('cache-control')); | ||
714 | $this->assertNotContains('no-cache', $client->getResponse()->headers->get('cache-control')); | ||
715 | |||
716 | $client->request('GET', '/view/'.$content->getId()); | ||
717 | $this->assertContains('no-cache', $client->getResponse()->headers->get('cache-control')); | ||
718 | } | ||
701 | } | 719 | } |