diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-10-01 15:51:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-01 15:51:37 +0200 |
commit | db5541e7a1e7131d62b4df23fa6eadd0c542b256 (patch) | |
tree | c5c71df873a9aa9350660e225f046a448274868f /tests/Wallabag | |
parent | 114c55c0a6eade2ba6c53fe25f61cc58cca91620 (diff) | |
parent | fb7354c4a430f4f4916a1247aa1b1bf564ead0da (diff) | |
download | wallabag-db5541e7a1e7131d62b4df23fa6eadd0c542b256.tar.gz wallabag-db5541e7a1e7131d62b4df23fa6eadd0c542b256.tar.zst wallabag-db5541e7a1e7131d62b4df23fa6eadd0c542b256.zip |
Merge pull request #2320 from wallabag/user-config
Create user config in one place.
Diffstat (limited to 'tests/Wallabag')
-rw-r--r-- | tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php (renamed from tests/Wallabag/CoreBundle/EventListener/RegistrationConfirmedListenerTest.php) | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/Wallabag/CoreBundle/EventListener/RegistrationConfirmedListenerTest.php b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php index e45722fa..0cebd3e4 100644 --- a/tests/Wallabag/CoreBundle/EventListener/RegistrationConfirmedListenerTest.php +++ b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php | |||
@@ -1,6 +1,6 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Tests\Wallabag\CoreBundle\EventListener; | 3 | namespace Tests\Wallabag\UserBundle\EventListener; |
4 | 4 | ||
5 | use FOS\UserBundle\Event\FilterUserResponseEvent; | 5 | use FOS\UserBundle\Event\FilterUserResponseEvent; |
6 | use FOS\UserBundle\FOSUserEvents; | 6 | use FOS\UserBundle\FOSUserEvents; |
@@ -8,10 +8,10 @@ use Symfony\Component\EventDispatcher\EventDispatcher; | |||
8 | use Symfony\Component\HttpFoundation\Request; | 8 | use Symfony\Component\HttpFoundation\Request; |
9 | use Symfony\Component\HttpFoundation\Response; | 9 | use Symfony\Component\HttpFoundation\Response; |
10 | use Wallabag\CoreBundle\Entity\Config; | 10 | use Wallabag\CoreBundle\Entity\Config; |
11 | use Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener; | 11 | use Wallabag\UserBundle\EventListener\CreateConfigListener; |
12 | use Wallabag\UserBundle\Entity\User; | 12 | use Wallabag\UserBundle\Entity\User; |
13 | 13 | ||
14 | class RegistrationConfirmedListenerTest extends \PHPUnit_Framework_TestCase | 14 | class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase |
15 | { | 15 | { |
16 | private $em; | 16 | private $em; |
17 | private $listener; | 17 | private $listener; |
@@ -25,12 +25,13 @@ class RegistrationConfirmedListenerTest extends \PHPUnit_Framework_TestCase | |||
25 | ->disableOriginalConstructor() | 25 | ->disableOriginalConstructor() |
26 | ->getMock(); | 26 | ->getMock(); |
27 | 27 | ||
28 | $this->listener = new RegistrationConfirmedListener( | 28 | $this->listener = new CreateConfigListener( |
29 | $this->em, | 29 | $this->em, |
30 | 'baggy', | 30 | 'baggy', |
31 | 20, | 31 | 20, |
32 | 50, | 32 | 50, |
33 | 'fr' | 33 | 'fr', |
34 | 1 | ||
34 | ); | 35 | ); |
35 | 36 | ||
36 | $this->dispatcher = new EventDispatcher(); | 37 | $this->dispatcher = new EventDispatcher(); |
@@ -55,7 +56,7 @@ class RegistrationConfirmedListenerTest extends \PHPUnit_Framework_TestCase | |||
55 | $this->em->expects($this->never())->method('flush'); | 56 | $this->em->expects($this->never())->method('flush'); |
56 | 57 | ||
57 | $this->dispatcher->dispatch( | 58 | $this->dispatcher->dispatch( |
58 | FOSUserEvents::REGISTRATION_CONFIRMED, | 59 | FOSUserEvents::REGISTRATION_COMPLETED, |
59 | $event | 60 | $event |
60 | ); | 61 | ); |
61 | } | 62 | } |
@@ -76,6 +77,7 @@ class RegistrationConfirmedListenerTest extends \PHPUnit_Framework_TestCase | |||
76 | $config->setItemsPerPage(20); | 77 | $config->setItemsPerPage(20); |
77 | $config->setRssLimit(50); | 78 | $config->setRssLimit(50); |
78 | $config->setLanguage('fr'); | 79 | $config->setLanguage('fr'); |
80 | $config->setReadingSpeed(1); | ||
79 | 81 | ||
80 | $this->em->expects($this->once()) | 82 | $this->em->expects($this->once()) |
81 | ->method('persist') | 83 | ->method('persist') |
@@ -84,7 +86,7 @@ class RegistrationConfirmedListenerTest extends \PHPUnit_Framework_TestCase | |||
84 | ->method('flush'); | 86 | ->method('flush'); |
85 | 87 | ||
86 | $this->dispatcher->dispatch( | 88 | $this->dispatcher->dispatch( |
87 | FOSUserEvents::REGISTRATION_CONFIRMED, | 89 | FOSUserEvents::REGISTRATION_COMPLETED, |
88 | $event | 90 | $event |
89 | ); | 91 | ); |
90 | } | 92 | } |