[HttpKernel] Mock must invoke constructor.
This commit is contained in:
parent
7b36d0cc2b
commit
d687801142
@ -33,7 +33,7 @@ class LocaleListenerTest extends \PHPUnit_Framework_TestCase
|
|||||||
session_name('foo');
|
session_name('foo');
|
||||||
$request->cookies->set('foo', 'value');
|
$request->cookies->set('foo', 'value');
|
||||||
|
|
||||||
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\Session', array('get'), array(), '', false);
|
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\Session', array('get'), array(), '', true);
|
||||||
$session->expects($this->once())->method('get')->will($this->returnValue('es'));
|
$session->expects($this->once())->method('get')->will($this->returnValue('es'));
|
||||||
$request->setSession($session);
|
$request->setSession($session);
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ class LocaleListenerTest extends \PHPUnit_Framework_TestCase
|
|||||||
$event = $this->getEvent($request);
|
$event = $this->getEvent($request);
|
||||||
|
|
||||||
// also updates the session _locale value
|
// also updates the session _locale value
|
||||||
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\Session', array('set', 'get'), array(), '', false);
|
$session = $this->getMock('Symfony\Component\HttpFoundation\Session\Session', array('set', 'get'), array(), '', true);
|
||||||
$session->expects($this->once())->method('set')->with('_locale', 'es');
|
$session->expects($this->once())->method('set')->with('_locale', 'es');
|
||||||
$session->expects($this->once())->method('get')->with('_locale')->will($this->returnValue('es'));
|
$session->expects($this->once())->method('get')->with('_locale')->will($this->returnValue('es'));
|
||||||
$request->setSession($session);
|
$request->setSession($session);
|
||||||
|
Reference in New Issue
Block a user