aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-09-09 10:08:12 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-10-08 13:27:18 +0200
commitb84026871169cee8cdd4aba892c128beee98e91a (patch)
tree6349aa65510224753ad5afb06eeb453093eb7329 /tests
parent71254701b7e5364516b7510e9237c00c678dac1c (diff)
downloadwallabag-b84026871169cee8cdd4aba892c128beee98e91a.tar.gz
wallabag-b84026871169cee8cdd4aba892c128beee98e91a.tar.zst
wallabag-b84026871169cee8cdd4aba892c128beee98e91a.zip
Added a test to check if entries are also deleted
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
index 282bf570..75a5e308 100644
--- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
@@ -637,6 +637,20 @@ class ConfigControllerTest extends WallabagCoreTestCase
637 $this->logInAs('wallace'); 637 $this->logInAs('wallace');
638 $client = $this->getClient(); 638 $client = $this->getClient();
639 639
640 // create entry to check after user deletion
641 // that this entry is also deleted
642 $crawler = $client->request('GET', '/new');
643
644 $this->assertEquals(200, $client->getResponse()->getStatusCode());
645
646 $form = $crawler->filter('form[name=entry]')->form();
647 $data = [
648 'entry[url]' => $url = 'https://github.com/wallabag/wallabag',
649 ];
650
651 $client->submit($form, $data);
652 $this->assertEquals(302, $client->getResponse()->getStatusCode());
653
640 $crawler = $client->request('GET', '/config'); 654 $crawler = $client->request('GET', '/config');
641 655
642 $deleteLink = $crawler->filter('.delete-account')->last()->link(); 656 $deleteLink = $crawler->filter('.delete-account')->last()->link();
@@ -654,5 +668,12 @@ class ConfigControllerTest extends WallabagCoreTestCase
654 ; 668 ;
655 669
656 $this->assertNull($user); 670 $this->assertNull($user);
671
672 $entries = $client->getContainer()
673 ->get('doctrine.orm.entity_manager')
674 ->getRepository('WallabagCoreBundle:Entry')
675 ->findByUser($this->getLoggedInUserId());
676
677 $this->assertEmpty($entries);
657 } 678 }
658} 679}