Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
controllerWithExtendingSession example
$request
->
setSession
(
$session
)
;
$controller
=
$this
->
controllerWithSession
(
...
)
;
$this
->
assertEquals
(
[
$session
]
, self::
getResolver
(
)
->
getArguments
(
$request
,
$controller
)
)
;
}
public
function
testGetSessionArgumentsWithExtendedSession
(
)
{
$session
=
new
ExtendingSession
(
new
MockArraySessionStorage
(
)
)
;
$request
= Request::
create
(
'/'
)
;
$request
->
setSession
(
$session
)
;
$controller
=
$this
->
controllerWithExtendingSession
(
...
)
;
$this
->
assertEquals
(
[
$session
]
, self::
getResolver
(
)
->
getArguments
(
$request
,
$controller
)
)
;
}
public
function
testGetSessionArgumentsWithInterface
(
)
{
$session
=
$this
->
createMock
(
SessionInterface::
class
)
;
$request
= Request::
create
(
'/'
)
;
$request
->
setSession
(
$session
)
;
$controller
=
$this
->
controllerWithSessionInterface
(
...
)
;