1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Ensure language is valid

- Do not override locale if user has choosen a locale from the login screen.
- Add some tests about locale url
This commit is contained in:
Jeremy Benoist 2018-10-13 09:24:39 +02:00
parent be417ef236
commit 4d4147b228
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
6 changed files with 76 additions and 9 deletions

View file

@ -8,6 +8,8 @@ use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Wallabag\CoreBundle\Entity\Config;
use Wallabag\UserBundle\Entity\User;
use Wallabag\UserBundle\EventListener\CreateConfigListener;
@ -22,6 +24,7 @@ class CreateConfigListenerTest extends TestCase
protected function setUp()
{
$session = new Session(new MockArraySessionStorage());
$this->em = $this->getMockBuilder('Doctrine\ORM\EntityManager')
->disableOriginalConstructor()
->getMock();
@ -34,7 +37,8 @@ class CreateConfigListenerTest extends TestCase
'fr',
1,
1,
1
1,
$session
);
$this->dispatcher = new EventDispatcher();