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

ExcludedNamespaceCheckerTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 27
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A test_not_in_excluded_namespace() 0 3 1
A test_in_excluded_namespace() 0 3 1
A setUp() 0 6 1
A test_null_value() 0 3 1
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