CodeExplorer TraceableFirewallListener example
$firewallMap =
$this ->
getMockBuilder(FirewallMap::
class) ->
disableOriginalConstructor() ->
getMock();
$firewallMap ->
expects($this->
once()) ->
method('getFirewallConfig'
) ->
with($request) ->
willReturn($firewallConfig);
$collector =
new SecurityDataCollector(null, null, null, null,
$firewallMap,
new TraceableFirewallListener($firewallMap,
new EventDispatcher(),
new LogoutUrlGenerator()), true
);
$collector->
collect($request,
new Response());
$collector->
lateCollect();
$collected =
$collector->
getFirewall();
$this->
assertSame($firewallConfig->
getName(),
$collected['name'
]);
$this->
assertSame($firewallConfig->
getRequestMatcher(),
$collected['request_matcher'
]);
$this->
assertSame($firewallConfig->
isSecurityEnabled(),
$collected['security_enabled'
]);
$this->
assertSame($firewallConfig->
isStateless(),
$collected['stateless'
]);
$this->
assertSame($firewallConfig->
getProvider(),
$collected['provider'
]);
$this->
assertSame($firewallConfig->
getContext(),
$collected['context'
]);
$this->
assertSame($firewallConfig->
getEntryPoint(),
$collected['entry_point'
]);