aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-12-30 09:41:17 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-12-30 09:41:17 +0100
commit831b02aaf2709d632453a03ab8eb2663fb947497 (patch)
tree65ff2b6ecdb30ba8d6c5d742b0bf3e248e5c8ea6 /src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
parente6a228c43bf98f64d2d046314bae224c5b87399e (diff)
downloadwallabag-831b02aaf2709d632453a03ab8eb2663fb947497.tar.gz
wallabag-831b02aaf2709d632453a03ab8eb2663fb947497.tar.zst
wallabag-831b02aaf2709d632453a03ab8eb2663fb947497.zip
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
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php32
1 files changed, 32 insertions, 0 deletions
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
180 $this->assertContains($content->getTitle(), $client->getResponse()->getContent()); 180 $this->assertContains($content->getTitle(), $client->getResponse()->getContent());
181 } 181 }
182 182
183 /**
184 * @depends testPostNewOk
185 *
186 * This test will require an internet connection.
187 */
188 public function testReload()
189 {
190 $this->logInAs('admin');
191 $client = $this->getClient();
192
193 $content = $client->getContainer()
194 ->get('doctrine.orm.entity_manager')
195 ->getRepository('WallabagCoreBundle:Entry')
196 ->findOneByUrl($this->url);
197
198 // empty content
199 $content->setContent('');
200 $client->getContainer()->get('doctrine.orm.entity_manager')->persist($content);
201 $client->getContainer()->get('doctrine.orm.entity_manager')->flush();
202
203 $client->request('GET', '/reload/'.$content->getId());
204
205 $this->assertEquals(302, $client->getResponse()->getStatusCode());
206
207 $content = $client->getContainer()
208 ->get('doctrine.orm.entity_manager')
209 ->getRepository('WallabagCoreBundle:Entry')
210 ->findOneByUrl($this->url);
211
212 $this->assertNotEmpty($content->getContent());
213 }
214
183 public function testEdit() 215 public function testEdit()
184 { 216 {
185 $this->logInAs('admin'); 217 $this->logInAs('admin');