Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getSessionUsages example
public
function
testItCollectsTheSessionTraceProperly
(
)
{
$collector
=
new
RequestDataCollector
(
)
;
$request
=
$this
->
createRequest
(
)
;
// RequestDataCollectorTest doesn't implement SessionInterface or SessionBagInterface, therefore should do nothing.
$collector
->
collectSessionUsage
(
)
;
$collector
->
collect
(
$request
,
$this
->
createResponse
(
)
)
;
$this
->
assertSame
(
[
]
,
$collector
->
getSessionUsages
(
)
)
;
$collector
->
reset
(
)
;
$session
=
$this
->
createMock
(
SessionInterface::
class
)
;
$session
->
method
(
'getMetadataBag'
)
->
willReturnCallback
(
static
function
D
)
use
(
$collector
)
{
$collector
->
collectSessionUsage
(
)
;
return
new
MetadataBag
(
)
;
}
)
;
$session
->
getMetadataBag
(
)
;