Skip to content

Commit c4f274c

Browse files
committed
Add regression test and changelog entry about #78
(cherry picked from commit e538969)
1 parent b5def10 commit c4f274c

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
### Fixed
10+
- Fix a fatal error when the user token is not authenticated (#78)
11+
912
## 0.8.6 - 2017-08-24
1013
### Changed
1114
- Migrate service definitions to non-deprecated option configuration values
@@ -23,7 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2326

2427
## 0.8.3 - 2017-08-07
2528
### Changed
26-
- Migrate all the opions from the config root to `sentry.options` (#68); the affected options are still usable in the old form, but they will generate deprecation notices. They will be dropped in the 1.0 release.
29+
- Migrate all the options from the config root to `sentry.options` (#68); the affected options are still usable in the old form, but they will generate deprecation notices. They will be dropped in the 1.0 release.
2730

2831
Before:
2932
```yaml

test/EventListener/ExceptionListenerTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,32 @@ public function test_that_username_is_set_from_user_interface_if_token_present_a
478478
$listener->onKernelRequest($mockEvent);
479479
}
480480

481+
public function test_regression_with_unauthenticated_user_token_PR_78()
482+
{
483+
$mockToken = $this->createMock(TokenInterface::class);
484+
$mockToken
485+
->method('isAuthenticated')
486+
->willReturn(false)
487+
;
488+
489+
$mockEvent = $this->createMock(GetResponseEvent::class);
490+
491+
$mockEvent
492+
->expects($this->once())
493+
->method('getRequestType')
494+
->willReturn(HttpKernelInterface::MASTER_REQUEST)
495+
;
496+
497+
$this->mockTokenStorage
498+
->method('getToken')
499+
->willReturn($mockToken)
500+
;
501+
502+
$this->containerBuilder->compile();
503+
$listener = $this->containerBuilder->get('sentry.exception_listener');
504+
$listener->onKernelRequest($mockEvent);
505+
}
506+
481507
public function test_that_it_does_not_report_http_exception_if_included_in_capture_skip()
482508
{
483509
$mockException = new \Symfony\Component\HttpKernel\Exception\HttpException(401);

0 commit comments

Comments
 (0)