From 831b02aaf2709d632453a03ab8eb2663fb947497 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 30 Dec 2015 09:41:17 +0100 Subject: Ability to reload an entry Could be useful when we want to update the content or when the content failed to be fetched. Fix #1503 --- .../Tests/Controller/EntryControllerTest.php | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/Wallabag/CoreBundle/Tests/Controller') diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php index 9f585d85..96f402b0 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php @@ -180,6 +180,38 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertContains($content->getTitle(), $client->getResponse()->getContent()); } + /** + * @depends testPostNewOk + * + * This test will require an internet connection. + */ + public function testReload() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $content = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findOneByUrl($this->url); + + // empty content + $content->setContent(''); + $client->getContainer()->get('doctrine.orm.entity_manager')->persist($content); + $client->getContainer()->get('doctrine.orm.entity_manager')->flush(); + + $client->request('GET', '/reload/'.$content->getId()); + + $this->assertEquals(302, $client->getResponse()->getStatusCode()); + + $content = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findOneByUrl($this->url); + + $this->assertNotEmpty($content->getContent()); + } + public function testEdit() { $this->logInAs('admin'); -- cgit v1.2.3