aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php')
-rw-r--r--tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
index 2b540fdf..8a8ec3cf 100644
--- a/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
+++ b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
@@ -8,6 +8,8 @@ use PHPUnit\Framework\TestCase;
8use Symfony\Component\EventDispatcher\EventDispatcher; 8use Symfony\Component\EventDispatcher\EventDispatcher;
9use Symfony\Component\HttpFoundation\Request; 9use Symfony\Component\HttpFoundation\Request;
10use Symfony\Component\HttpFoundation\Response; 10use Symfony\Component\HttpFoundation\Response;
11use Symfony\Component\HttpFoundation\Session\Session;
12use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
11use Wallabag\CoreBundle\Entity\Config; 13use Wallabag\CoreBundle\Entity\Config;
12use Wallabag\UserBundle\Entity\User; 14use Wallabag\UserBundle\Entity\User;
13use Wallabag\UserBundle\EventListener\CreateConfigListener; 15use Wallabag\UserBundle\EventListener\CreateConfigListener;
@@ -22,6 +24,7 @@ class CreateConfigListenerTest extends TestCase
22 24
23 protected function setUp() 25 protected function setUp()
24 { 26 {
27 $session = new Session(new MockArraySessionStorage());
25 $this->em = $this->getMockBuilder('Doctrine\ORM\EntityManager') 28 $this->em = $this->getMockBuilder('Doctrine\ORM\EntityManager')
26 ->disableOriginalConstructor() 29 ->disableOriginalConstructor()
27 ->getMock(); 30 ->getMock();
@@ -34,7 +37,8 @@ class CreateConfigListenerTest extends TestCase
34 'fr', 37 'fr',
35 1, 38 1,
36 1, 39 1,
37 1 40 1,
41 $session
38 ); 42 );
39 43
40 $this->dispatcher = new EventDispatcher(); 44 $this->dispatcher = new EventDispatcher();
@@ -58,13 +62,13 @@ class CreateConfigListenerTest extends TestCase
58 $config = new Config($user); 62 $config = new Config($user);
59 $config->setTheme('baggy'); 63 $config->setTheme('baggy');
60 $config->setItemsPerPage(20); 64 $config->setItemsPerPage(20);
61 $config->setRssLimit(50); 65 $config->setFeedLimit(50);
62 $config->setLanguage('fr'); 66 $config->setLanguage('fr');
63 $config->setReadingSpeed(1); 67 $config->setReadingSpeed(200);
64 68
65 $this->em->expects($this->once()) 69 $this->em->expects($this->once())
66 ->method('persist') 70 ->method('persist')
67 ->will($this->returnValue($config)); 71 ->willReturn($config);
68 $this->em->expects($this->once()) 72 $this->em->expects($this->once())
69 ->method('flush'); 73 ->method('flush');
70 74