fixed previous merge
This commit is contained in:
parent
d2b5208a77
commit
6dd342c351
@ -526,7 +526,7 @@ class Request
|
||||
*/
|
||||
public function hasSession()
|
||||
{
|
||||
return null !== $this->session && $this->session->isStarted();
|
||||
return null !== $this->session;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -177,13 +177,11 @@ interface SessionInterface
|
||||
function clear();
|
||||
|
||||
/**
|
||||
* Check if a session was started
|
||||
* Checks if the session was started.
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @return boolean
|
||||
* @return Boolean
|
||||
*/
|
||||
public function isStarted();
|
||||
function isStarted();
|
||||
|
||||
/**
|
||||
* Registers a SessionBagInterface with the session.
|
||||
|
@ -205,9 +205,7 @@ class MockArraySessionStorage implements SessionStorageInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the session was started or not
|
||||
*
|
||||
* @return boolean
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isStarted()
|
||||
{
|
||||
|
@ -290,9 +290,7 @@ class NativeSessionStorage implements SessionStorageInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the session was started or not
|
||||
*
|
||||
* @return boolean
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isStarted()
|
||||
{
|
||||
|
@ -35,6 +35,13 @@ interface SessionStorageInterface
|
||||
*/
|
||||
function start();
|
||||
|
||||
/**
|
||||
* Checks if the session is started.
|
||||
*
|
||||
* @return boolean True if started, false otherwise.
|
||||
*/
|
||||
function isStarted();
|
||||
|
||||
/**
|
||||
* Returns the session ID
|
||||
*
|
||||
|
@ -949,7 +949,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertFalse($request->hasSession());
|
||||
$request->setSession(new Session(new MockArraySessionStorage()));
|
||||
$request->getSession()->start();
|
||||
$this->assertTrue($request->hasSession());
|
||||
}
|
||||
|
||||
@ -961,7 +960,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
$request->cookies->set('MOCKSESSID', 'foo');
|
||||
$this->assertFalse($request->hasPreviousSession());
|
||||
$request->setSession(new Session(new MockArraySessionStorage()));
|
||||
$request->getSession()->start();
|
||||
$this->assertTrue($request->hasPreviousSession());
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,6 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase
|
||||
protected function runSessionOnKernelResponse($newToken, $original = null)
|
||||
{
|
||||
$session = new Session(new MockArraySessionStorage());
|
||||
$session->start();
|
||||
|
||||
if ($original !== null) {
|
||||
$session->set('_security_session', $original);
|
||||
|
Reference in New Issue
Block a user