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

test_file_with_extension()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
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