File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
16
16
### Fixed
17
17
- Remove usage of create_function to avoid deprecations (#71 )
18
18
- Fix a possible bug that could make Sentry crash if an error is triggered before loading a console command
19
+ - Fix a fatal error when the user token is not authenticated (#78 )
19
20
### Removed
20
21
- Drop deprecated fields from configuration; the same options can be used (since 0.8.3) under ` sentry.options `
21
22
- Dropped the third argument from the ` SentrySymfonyClient ` constructor; ` error_types ` are now fetched from the second argument, the options array
Original file line number Diff line number Diff line change @@ -424,6 +424,32 @@ public function test_that_username_is_set_from_user_interface_if_token_present_a
424
424
$ listener ->onKernelRequest ($ mockEvent );
425
425
}
426
426
427
+ public function test_regression_with_unauthenticated_user_token_PR_78 ()
428
+ {
429
+ $ mockToken = $ this ->createMock (TokenInterface::class);
430
+ $ mockToken
431
+ ->method ('isAuthenticated ' )
432
+ ->willReturn (false )
433
+ ;
434
+
435
+ $ mockEvent = $ this ->createMock (GetResponseEvent::class);
436
+
437
+ $ mockEvent
438
+ ->expects ($ this ->once ())
439
+ ->method ('getRequestType ' )
440
+ ->willReturn (HttpKernelInterface::MASTER_REQUEST )
441
+ ;
442
+
443
+ $ this ->mockTokenStorage
444
+ ->method ('getToken ' )
445
+ ->willReturn ($ mockToken )
446
+ ;
447
+
448
+ $ this ->containerBuilder ->compile ();
449
+ $ listener = $ this ->containerBuilder ->get ('sentry.exception_listener ' );
450
+ $ listener ->onKernelRequest ($ mockEvent );
451
+ }
452
+
427
453
public function test_that_it_does_not_report_http_exception_if_included_in_capture_skip ()
428
454
{
429
455
$ mockEvent = $ this ->createMock (GetResponseForExceptionEvent::class);
You can’t perform that action at this time.
0 commit comments