X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FCoreBundle%2FController%2FEntryControllerTest.php;h=006ca330564a7413ed3eafa283f0f71533cc221e;hb=3c7900d0cdc8e1893a14bbdde5a6dec4e4186a10;hp=479e07000e642d1de582d3c67a51d666274bb718;hpb=dc90eab32bd1912a1541ba238dcd2c34e6171e94;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 479e0700..006ca330 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -620,7 +620,7 @@ class EntryControllerTest extends WallabagCoreTestCase $content->setMimetype('text/html'); $content->setTitle('test title entry'); $content->setContent('This is my content /o/'); - $content->setArchived(true); + $content->updateArchived(true); $content->setLanguage('fr'); $em->persist($content); @@ -773,7 +773,7 @@ class EntryControllerTest extends WallabagCoreTestCase $entry = new Entry($this->getLoggedInUser()); $entry->setUrl($this->url); - $entry->setArchived(false); + $entry->updateArchived(false); $this->getEntityManager()->persist($entry); $this->getEntityManager()->flush(); @@ -984,8 +984,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')); @@ -1001,9 +1006,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()); @@ -1244,7 +1246,7 @@ class EntryControllerTest extends WallabagCoreTestCase $entry = new Entry($this->getLoggedInUser()); $entry->setUrl('http://0.0.0.0/foo/baz/qux'); $entry->setTitle('Le manège'); - $entry->setArchived(true); + $entry->updateArchived(true); $this->getEntityManager()->persist($entry); $this->getEntityManager()->flush(); @@ -1274,7 +1276,7 @@ class EntryControllerTest extends WallabagCoreTestCase $entry = new Entry($this->getLoggedInUser()); $entry->setUrl('http://domain/qux'); $entry->setTitle('Le manège'); - $entry->setArchived(true); + $entry->updateArchived(true); $this->getEntityManager()->persist($entry); $this->getEntityManager()->flush();