aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/UserBundle
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2018-10-13 09:24:39 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2018-10-13 09:39:00 +0200
commit4d4147b228ac90f329fd2d40dd4fb60cb980328a (patch)
treebb18d67c8ec03bf8abd24dc6ef2138c3f81f6fa5 /tests/Wallabag/UserBundle
parentbe417ef23685e17a239b1d192a0e9b9f484f1bfe (diff)
downloadwallabag-4d4147b228ac90f329fd2d40dd4fb60cb980328a.tar.gz
wallabag-4d4147b228ac90f329fd2d40dd4fb60cb980328a.tar.zst
wallabag-4d4147b228ac90f329fd2d40dd4fb60cb980328a.zip
Ensure language is valid
- Do not override locale if user has choosen a locale from the login screen. - Add some tests about locale url
Diffstat (limited to 'tests/Wallabag/UserBundle')
-rw-r--r--tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
index 2b540fdf..c13bfbea 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();