AbsoluteFileNameTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testAbsolutePath() 0 4 1
A testRelativePath() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Tests\Unit\Core\Common;
6
7
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\AbsoluteFileName;
8
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\InvalidPathException;
9
use PHPUnit\Framework\TestCase;
10
11
final class AbsoluteFileNameTest extends TestCase
12
{
13
    private const ABSOLUTE_FILENAME = '/tmp/file.php';
14
15
    public function testAbsolutePath(): void
16
    {
17
        $absoluteFileName = new AbsoluteFileName(self::ABSOLUTE_FILENAME);
18
        $this->assertSame(self::ABSOLUTE_FILENAME, $absoluteFileName->getFileName());
19
    }
20
21
    public function testRelativePath(): void
22
    {
23
        $this->expectException(InvalidPathException::class);
24
        new AbsoluteFileName('foo/bar.php');
25
    }
26
}
27