| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function testReportSentryNotification() |
||
| 19 | { |
||
| 20 | $messengerClientMock = $this->createMock(MessengerClientInterface::class); |
||
| 21 | $messengerClientMock->expects($this->once()) |
||
| 22 | ->method('sendMessage') |
||
| 23 | ->with($this->isInstanceOf(Exception::class), $this->stringContains('http://example.com/event')); |
||
| 24 | |||
| 25 | $sentryServiceMock = $this->createMock(SentryServiceInterface::class); |
||
| 26 | $sentryServiceMock->method('captureException') |
||
| 27 | ->willReturn('event_id'); |
||
| 28 | $sentryServiceMock->method('getIssueUrl') |
||
| 29 | ->with('event_id') |
||
| 30 | ->willReturn('http://example.com/event'); |
||
| 31 | |||
| 32 | $sentryNotifier = new SentryNotifier($messengerClientMock, $sentryServiceMock); |
||
| 33 | |||
| 34 | $sentryNotifier->reportSentryNotification(new Exception('Test exception')); |
||
| 35 | } |
||
| 37 |