Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
FirewallContext example
use
Symfony\Component\Security\Http\Firewall\LogoutListener;
class
FirewallContextTest
extends
TestCase
{
public
function
testGetters
(
)
{
$config
=
new
FirewallConfig
(
'main', 'user_checker', 'request_matcher'
)
;
$exceptionListener
=
$this
->
getExceptionListenerMock
(
)
;
$logoutListener
=
$this
->
getLogoutListenerMock
(
)
;
$listeners
=
[
function
D
)
{
}
]
;
$context
=
new
FirewallContext
(
$listeners
,
$exceptionListener
,
$logoutListener
,
$config
)
;
$this
->
assertEquals
(
$listeners
,
$context
->
getListeners
(
)
)
;
$this
->
assertEquals
(
$exceptionListener
,
$context
->
getExceptionListener
(
)
)
;
$this
->
assertEquals
(
$logoutListener
,
$context
->
getLogoutListener
(
)
)
;
$this
->
assertEquals
(
$config
,
$context
->
getConfig
(
)
)
;
}
private
function
getExceptionListenerMock
(
)
{
return
$this
->
getMockBuilder
(
ExceptionListener::
class
)