getPackageProviders()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
eloc 2
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Tests\Unit\Notifications\Factories;
4
5
use Orchestra\Testbench\Foundation\Application;
6
use Orchestra\Testbench\TestCase;
7
use Skater4\LaravelSentryNotifications\Enum\Services;
8
use Skater4\LaravelSentryNotifications\Notifications\Factories\NotificationEntityFactory;
9
use Skater4\LaravelSentryNotifications\Notifications\Services\Telegram\Entities\NotifableTelegramChannel;
10
use Skater4\LaravelSentryNotifications\Exceptions\UnknownServiceException;
11
use Skater4\LaravelSentryNotifications\Providers\TelegramServiceProvider;
12
13
class NotificationEntityFactoryTest extends TestCase
14
{
15
    /**
16
     * @return void
17
     * @throws UnknownServiceException
18
     */
19
    public function testCreatesNotifableTelegramChannelForTelegramService()
20
    {
21
        $factory = new NotificationEntityFactory(Services::SERVICE_TELEGRAM);
22
        $entity = $factory->create();
23
24
        $this->assertInstanceOf(NotifableTelegramChannel::class, $entity);
25
    }
26
27
    /**
28
     * @return void
29
     * @throws UnknownServiceException
30
     */
31
    public function testThrowsExceptionForUnknownService()
32
    {
33
        $this->expectException(UnknownServiceException::class);
34
35
        $factory = new NotificationEntityFactory('wtf?');
36
        $factory->create();
37
    }
38
39
    /**
40
     * @param Application $app
41
     * @return class-string[]
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string[] at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string[].
Loading history...
42
     */
43
    protected function getPackageProviders($app): array
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

43
    protected function getPackageProviders(/** @scrutinizer ignore-unused */ $app): array

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
44
    {
45
        return [
46
            TelegramServiceProvider::class,
47
        ];
48
    }
49
}
50