aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-10-08 14:07:13 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-10-08 14:07:13 +0200
commitc3396c65ef8532091614ec9ae298ba124d58b2b9 (patch)
tree529d46221eb4409cdd3b01a4bd99aeefb2c91a86 /tests
parentb84026871169cee8cdd4aba892c128beee98e91a (diff)
downloadwallabag-c3396c65ef8532091614ec9ae298ba124d58b2b9.tar.gz
wallabag-c3396c65ef8532091614ec9ae298ba124d58b2b9.tar.zst
wallabag-c3396c65ef8532091614ec9ae298ba124d58b2b9.zip
Fix some tests
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php39
1 files changed, 26 insertions, 13 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
index 75a5e308..7929b63d 100644
--- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
@@ -3,6 +3,8 @@
3namespace Tests\Wallabag\CoreBundle\Controller; 3namespace Tests\Wallabag\CoreBundle\Controller;
4 4
5use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; 5use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
6use Wallabag\CoreBundle\Entity\Config;
7use Wallabag\UserBundle\Entity\User;
6 8
7class ConfigControllerTest extends WallabagCoreTestCase 9class ConfigControllerTest extends WallabagCoreTestCase
8{ 10{
@@ -585,12 +587,6 @@ class ConfigControllerTest extends WallabagCoreTestCase
585 587
586 $user = $em 588 $user = $em
587 ->getRepository('WallabagUserBundle:User') 589 ->getRepository('WallabagUserBundle:User')
588 ->findOneByUsername('wallace');
589 $user->setExpired(1);
590 $em->persist($user);
591
592 $user = $em
593 ->getRepository('WallabagUserBundle:User')
594 ->findOneByUsername('empty'); 590 ->findOneByUsername('empty');
595 $user->setExpired(1); 591 $user->setExpired(1);
596 $em->persist($user); 592 $em->persist($user);
@@ -613,12 +609,6 @@ class ConfigControllerTest extends WallabagCoreTestCase
613 609
614 $user = $em 610 $user = $em
615 ->getRepository('WallabagUserBundle:User') 611 ->getRepository('WallabagUserBundle:User')
616 ->findOneByUsername('wallace');
617 $user->setExpired(0);
618 $em->persist($user);
619
620 $user = $em
621 ->getRepository('WallabagUserBundle:User')
622 ->findOneByUsername('empty'); 612 ->findOneByUsername('empty');
623 $user->setExpired(0); 613 $user->setExpired(0);
624 $em->persist($user); 614 $em->persist($user);
@@ -634,8 +624,31 @@ class ConfigControllerTest extends WallabagCoreTestCase
634 624
635 public function testDeleteAccount() 625 public function testDeleteAccount()
636 { 626 {
637 $this->logInAs('wallace');
638 $client = $this->getClient(); 627 $client = $this->getClient();
628 $em = $client->getContainer()->get('doctrine.orm.entity_manager');
629
630 $user = new User();
631 $user->setName('Wallace');
632 $user->setEmail('wallace@wallabag.org');
633 $user->setUsername('wallace');
634 $user->setPlainPassword('wallace');
635 $user->setEnabled(true);
636 $user->addRole('ROLE_SUPER_ADMIN');
637
638 $em->persist($user);
639
640 $config = new Config($user);
641
642 $config->setTheme('material');
643 $config->setItemsPerPage(30);
644 $config->setReadingSpeed(1);
645 $config->setLanguage('en');
646 $config->setPocketConsumerKey('xxxxx');
647
648 $em->persist($config);
649 $em->flush();
650
651 $this->logInAs('wallace');
639 652
640 // create entry to check after user deletion 653 // create entry to check after user deletion
641 // that this entry is also deleted 654 // that this entry is also deleted