Test Failed
Push — feature/add-phpstan-rules ( 26ac25 )
by Dave
10:33
created

test_not_in_excluded_namespace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaPhpstan\Tests;
6
7
use GacelaPhpstan\Rules\ExcludedNamespaceChecker;
8
use PHPUnit\Framework\TestCase;
9
10
class ExcludedNamespaceCheckerTest extends TestCase
11
{
12
    private ExcludedNamespaceChecker $excludedNamespaces;
13
14
    public function setUp(): void
15
    {
16
        $this->excludedNamespaces = new ExcludedNamespaceChecker(
17
            [
18
                'Gacela/Common',
19
                'Gacela/Utils',
20
            ]
21
        );
22
    }
23
24
    public function test_in_excluded_namespace(): void
25
    {
26
        $this->assertTrue($this->excludedNamespaces->isExcludedNamespace('Gacela/Common/SomeOtherNamespace'));
27
    }
28
29
    public function test_not_in_excluded_namespace(): void
30
    {
31
        $this->assertFalse($this->excludedNamespaces->isExcludedNamespace('Gacela/SomeOtherNamespace'));
32
    }
33
34
    public function test_null_value(): void
35
    {
36
        $this->assertFalse($this->excludedNamespaces->isExcludedNamespace(null));
37
    }
38
}
39