Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
PhpBridgeSessionStorageFactory example
/** * @runInSeparateProcess */
public
function
testPhpBridgeAlreadyStartedSession
(
)
{
session_start
(
)
;
$sessionId
=
session_id
(
)
;
$request
=
new
Request
(
)
;
$listener
=
$this
->
createListener
(
$request
,
new
PhpBridgeSessionStorageFactory
(
)
)
;
$event
=
new
RequestEvent
(
$this
->
createMock
(
HttpKernelInterface::
class
)
,
$request
, HttpKernelInterface::MAIN_REQUEST
)
;
$listener
->
onKernelRequest
(
$event
)
;
$this
->
assertTrue
(
$request
->
hasSession
(
)
)
;
$this
->
assertSame
(
$sessionId
,
$request
->
getSession
(
)
->
getId
(
)
)
;
}
/** * @runInSeparateProcess */