aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag')
-rw-r--r--tests/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverterTest.php8
-rw-r--r--tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php (renamed from tests/Wallabag/CoreBundle/EventListener/RegistrationConfirmedListenerTest.php)16
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverterTest.php b/tests/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverterTest.php
index e29b58b5..2e6fccfb 100644
--- a/tests/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverterTest.php
+++ b/tests/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverterTest.php
@@ -125,16 +125,14 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
125 $this->assertTrue($converter->supports($params)); 125 $this->assertTrue($converter->supports($params));
126 } 126 }
127 127
128 /**
129 * @expectedException InvalidArgumentException
130 * @expectedExceptionMessage Route attribute is missing
131 */
132 public function testApplyEmptyRequest() 128 public function testApplyEmptyRequest()
133 { 129 {
134 $params = new ParamConverter([]); 130 $params = new ParamConverter([]);
135 $converter = new UsernameRssTokenConverter(); 131 $converter = new UsernameRssTokenConverter();
136 132
137 $converter->apply(new Request(), $params); 133 $res = $converter->apply(new Request(), $params);
134
135 $this->assertFalse($res);
138 } 136 }
139 137
140 /** 138 /**
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
3namespace Tests\Wallabag\CoreBundle\EventListener; 3namespace Tests\Wallabag\UserBundle\EventListener;
4 4
5use FOS\UserBundle\Event\FilterUserResponseEvent; 5use FOS\UserBundle\Event\FilterUserResponseEvent;
6use FOS\UserBundle\FOSUserEvents; 6use FOS\UserBundle\FOSUserEvents;
@@ -8,10 +8,10 @@ use Symfony\Component\EventDispatcher\EventDispatcher;
8use Symfony\Component\HttpFoundation\Request; 8use Symfony\Component\HttpFoundation\Request;
9use Symfony\Component\HttpFoundation\Response; 9use Symfony\Component\HttpFoundation\Response;
10use Wallabag\CoreBundle\Entity\Config; 10use Wallabag\CoreBundle\Entity\Config;
11use Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener; 11use Wallabag\UserBundle\EventListener\CreateConfigListener;
12use Wallabag\UserBundle\Entity\User; 12use Wallabag\UserBundle\Entity\User;
13 13
14class RegistrationConfirmedListenerTest extends \PHPUnit_Framework_TestCase 14class 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 }