Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
onVoterVote example
->
getMockBuilder
(
TraceableAccessDecisionManager::
class
)
->
disableOriginalConstructor
(
)
->
onlyMethods
(
[
'addVoterVote'
]
)
->
getMock
(
)
;
$traceableAccessDecisionManager
->
expects
(
$this
->
once
(
)
)
->
method
(
'addVoterVote'
)
->
with
(
$voter
,
[
'myattr1', 'myattr2'
]
, VoterInterface::ACCESS_GRANTED
)
;
$sut
=
new
VoteListener
(
$traceableAccessDecisionManager
)
;
$sut
->
onVoterVote
(
new
VoteEvent
(
$voter
, 'mysubject',
[
'myattr1', 'myattr2'
]
, VoterInterface::ACCESS_GRANTED
)
)
;
}
}