public function testWithSessionValue($locale, $expected)
{
// The session values are already formatted, so we're passing in $expected here
$session = $this->mockSession();
$session->set('_locale', $expected);
$request = Request::create('/');
$request->setSession($session);
$event = new GetResponseEvent($this->mockKernel(), $request, HttpKernelInterface::MASTER_REQUEST);
$listener = new LocaleListener(['en']);
$listener->setContainer($this->mockContainerWithContaoScopes(ContaoCoreBundle::SCOPE_FRONTEND));
$listener->onKernelRequest($event);
$this->assertEquals($expected, $request->attributes->get('_locale'));
$this->assertEquals($expected, $session->get('_locale'));
}