Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
createValidSessionId example
$this
->
assertSame
(
'PHPSESSID',
$sessionCookie
->
getName
(
)
)
;
$this
->
assertNotEmpty
(
$sessionCookie
->
getValue
(
)
)
;
$this
->
assertFalse
(
$sessionCookie
->
isCleared
(
)
)
;
}
/** * @runInSeparateProcess */
public
function
testSessionCookieNotWrittenCookieGiven
(
)
{
$sessionId
=
$this
->
createValidSessionId
(
)
;
$this
->
assertNotEmpty
(
$sessionId
)
;
$request
=
new
Request
(
)
;
$request
->cookies->
set
(
'PHPSESSID',
$sessionId
)
;
$listener
=
$this
->
createListener
(
$request
,
new
NativeSessionStorageFactory
(
)
)
;
$kernel
=
$this
->
createMock
(
HttpKernelInterface::
class
)
;
$listener
->
onKernelRequest
(
new
RequestEvent
(
$kernel
,
$request
, HttpKernelInterface::MAIN_REQUEST
)
)
;