Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ChannelListener example
$accessMap
=
$this
->
createMock
(
AccessMapInterface::
class
)
;
$accessMap
->
expects
(
$this
->
any
(
)
)
->
method
(
'getPatterns'
)
->
with
(
$this
->
equalTo
(
$request
)
)
->
willReturn
(
[
[
]
, 'http'
]
)
;
$event
=
new
RequestEvent
(
$this
->
createMock
(
HttpKernelInterface::
class
)
,
$request
, HttpKernelInterface::MAIN_REQUEST
)
;
$listener
=
new
ChannelListener
(
$accessMap
)
;
$listener
(
$event
)
;
$this
->
assertNull
(
$event
->
getResponse
(
)
)
;
}
public
function
testHandleWithSecuredRequestAndHttpsChannel
(
)
{
$request
=
$this
->
createMock
(
Request::
class
)
;
$request
->
expects
(
$this
->
any
(
)
)
->
method
(
'isSecure'
)