File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
src/Symfony/Component/Workflow Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,7 @@ private function getVariables(GuardEvent $event)
57
57
$ token = $ this ->tokenStorage ->getToken ();
58
58
59
59
if (null === $ token ) {
60
- $ token = new AnonymousToken ('secret ' , 'anon ' , array ());
61
- $ this ->tokenStorage ->setToken ($ token );
60
+ throw new \Exception ("No token is set " );
62
61
}
63
62
64
63
if (null !== $ this ->roleHierarchy ) {
Original file line number Diff line number Diff line change @@ -74,13 +74,9 @@ public function testWithNoTokenStorage()
74
74
$ event = $ this ->createEvent ();
75
75
$ this ->tokenStorage = null ;
76
76
77
- $ this ->listener ->onTransition ($ event , 'event_name_a ' );
78
-
79
- $ this ->assertFalse ($ event ->isBlocked ());
77
+ $ this ->expectException (\Exception::class);
80
78
81
- $ this ->listener ->onTransition ($ event , 'event_name_b ' );
82
-
83
- $ this ->assertTrue ($ event ->isBlocked ());
79
+ $ this ->listener ->onTransition ($ event , 'event_name_a ' );
84
80
}
85
81
86
82
private function createEvent ()
You can’t perform that action at this time.
0 commit comments