@@ -31,18 +31,33 @@ public function testAliasedEvents()
31
31
$ dispatcher = $ container ->get ('event_dispatcher ' );
32
32
33
33
$ dispatcher ->dispatch (new AuthenticationSuccessEvent ($ this ->createMock (TokenInterface::class)), AuthenticationEvents::AUTHENTICATION_SUCCESS );
34
- $ dispatcher ->dispatch (new AuthenticationFailureEvent ($ this ->createMock (TokenInterface::class), new AuthenticationException ()), AuthenticationEvents::AUTHENTICATION_FAILURE );
35
34
$ dispatcher ->dispatch (new InteractiveLoginEvent ($ this ->createMock (Request::class), $ this ->createMock (TokenInterface::class)), SecurityEvents::INTERACTIVE_LOGIN );
36
35
$ dispatcher ->dispatch (new SwitchUserEvent ($ this ->createMock (Request::class), $ this ->createMock (UserInterface::class), $ this ->createMock (TokenInterface::class)), SecurityEvents::SWITCH_USER );
37
36
38
37
$ this ->assertEquals (
39
38
[
40
39
'onAuthenticationSuccess ' => 1 ,
41
- 'onAuthenticationFailure ' => 1 ,
42
40
'onInteractiveLogin ' => 1 ,
43
41
'onSwitchUser ' => 1 ,
44
42
],
45
43
$ container ->get ('test_subscriber ' )->calledMethods
46
44
);
47
45
}
46
+
47
+ /**
48
+ * @group legacy
49
+ */
50
+ public function testAliasedLegacyEvent ()
51
+ {
52
+ $ client = $ this ->createClient (['test_case ' => 'AliasedEvents ' , 'root_config ' => 'config.yml ' ]);
53
+ $ container = $ client ->getContainer ();
54
+ $ dispatcher = $ container ->get ('event_dispatcher ' );
55
+
56
+ $ dispatcher ->dispatch (new AuthenticationFailureEvent ($ this ->createMock (TokenInterface::class), new AuthenticationException ()), AuthenticationEvents::AUTHENTICATION_FAILURE );
57
+
58
+ $ this ->assertEquals (
59
+ ['onAuthenticationFailure ' => 1 ],
60
+ $ container ->get ('test_subscriber ' )->calledMethods
61
+ );
62
+ }
48
63
}
0 commit comments