SentryNotifierTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 10
c 2
b 0
f 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testReportSentryNotification() 0 13 1
1
<?php
2
3
namespace Tests\Unit\Services;
4
5
use Tests\TestCase;
6
use Skater4\LaravelSentryNotifications\Exceptions\SentryNotifierException;
7
use Skater4\LaravelSentryNotifications\Services\SentryNotifier;
8
use Skater4\LaravelSentryNotifications\Services\Sentry\Interfaces\SentryServiceInterface;
9
use Exception;
10
11
class SentryNotifierTest extends TestCase
12
{
13
    /**
14
     * @return void
15
     * @throws SentryNotifierException
16
     */
17
    public function testReportSentryNotification()
18
    {
19
        $sentryServiceMock = $this->createMock(SentryServiceInterface::class);
20
        $sentryServiceMock->method('captureException')
21
            ->willReturn('event_id');
22
        $sentryServiceMock->method('getIssueUrl')
23
            ->with('event_id')
24
            ->willReturn('http://example.com/event');
25
26
        $sentryNotifier = new SentryNotifier($sentryServiceMock);
27
28
        $sentryNotifier->reportSentryNotification(new Exception('Test exception'));
29
        $this->assertTrue(true);
30
    }
31
}
32