aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php26
1 files changed, 23 insertions, 3 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
index 514e9d89..4ab06dbf 100644
--- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
@@ -869,10 +869,30 @@ class EntryControllerTest extends WallabagCoreTestCase
869 $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry); 869 $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry);
870 $this->assertEquals($url, $entry->getUrl()); 870 $this->assertEquals($url, $entry->getUrl());
871 $this->assertContains('Perpignan', $entry->getTitle()); 871 $this->assertContains('Perpignan', $entry->getTitle());
872 $this->assertContains('assets/images/8/e/8ec9229a/d9bc0fcd.jpeg', $entry->getContent()); 872 $this->assertContains('/d9bc0fcd.jpeg', $entry->getContent());
873 873
874 $em->remove($entry); 874 $client->getContainer()->get('craue_config')->set('download_images_enabled', 0);
875 $em->flush(); 875 }
876
877 /**
878 * @depends testNewEntryWithDownloadImagesEnabled
879 */
880 public function testRemoveEntryWithDownloadImagesEnabled()
881 {
882 $this->logInAs('admin');
883 $client = $this->getClient();
884
885 $url = 'http://www.20minutes.fr/montpellier/1952003-20161030-video-car-tombe-panne-rugbymen-perpignan-improvisent-melee-route';
886 $client->getContainer()->get('craue_config')->set('download_images_enabled', 1);
887
888 $content = $client->getContainer()
889 ->get('doctrine.orm.entity_manager')
890 ->getRepository('WallabagCoreBundle:Entry')
891 ->findByUrlAndUserId($url, $this->getLoggedInUserId());
892
893 $client->request('GET', '/delete/'.$content->getId());
894
895 $this->assertEquals(302, $client->getResponse()->getStatusCode());
876 896
877 $client->getContainer()->get('craue_config')->set('download_images_enabled', 0); 897 $client->getContainer()->get('craue_config')->set('download_images_enabled', 0);
878 } 898 }