public function LocaleListenerTest::testLocaleSetForRoutingContext in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/http-kernel/Tests/EventListener/LocaleListenerTest.php \Symfony\Component\HttpKernel\Tests\EventListener\LocaleListenerTest::testLocaleSetForRoutingContext()
File
- vendor/
symfony/ http-kernel/ Tests/ EventListener/ LocaleListenerTest.php, line 52
Class
Namespace
Symfony\Component\HttpKernel\Tests\EventListenerCode
public function testLocaleSetForRoutingContext() {
// the request context is updated
$context = $this
->getMock('Symfony\\Component\\Routing\\RequestContext');
$context
->expects($this
->once())
->method('setParameter')
->with('_locale', 'es');
$router = $this
->getMock('Symfony\\Component\\Routing\\Router', array(
'getContext',
), array(), '', false);
$router
->expects($this
->once())
->method('getContext')
->will($this
->returnValue($context));
$request = Request::create('/');
$request->attributes
->set('_locale', 'es');
$listener = new LocaleListener('fr', $router, $this->requestStack);
$listener
->onKernelRequest($this
->getEvent($request));
}