Passed
Push — master ( 72f8f4...a05bce )
by Jesús
07:47 queued 11s
created

WithoutSuffixAbsolutePathStrategyTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_file_without_extension() 0 8 1
A test_file_with_extension() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Unit\Framework\Config\PathNormalizer;
6
7
use Gacela\Framework\Config\PathNormalizer\WithoutSuffixAbsolutePathStrategy;
8
use PHPUnit\Framework\TestCase;
9
10
final class WithoutSuffixAbsolutePathStrategyTest extends TestCase
11
{
12
    public function test_file_without_extension(): void
13
    {
14
        $strategy = new WithoutSuffixAbsolutePathStrategy('/app/root/');
15
        $relativePath = '/file-name';
16
17
        self::assertSame(
18
            '/app/root/file-name',
19
            $strategy->generateAbsolutePath($relativePath)
20
        );
21
    }
22
23
    public function test_file_with_extension(): void
24
    {
25
        $strategy = new WithoutSuffixAbsolutePathStrategy('/app/root/');
26
        $relativePath = '/file-name.ext';
27
28
        self::assertSame(
29
            '/app/root/file-name.ext',
30
            $strategy->generateAbsolutePath($relativePath)
31
        );
32
    }
33
}
34