FileTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
setUp() 0 4 ?
A hp$0 ➔ setUp() 0 4 1
testGetPath() 0 8 ?
A hp$0 ➔ testGetPath() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcodevTests\Felix\Model\Traits;
6
7
use Ecodev\Felix\Model\Traits\File;
8
use PHPUnit\Framework\TestCase;
9
10
final class FileTest extends TestCase
11
{
12
    private \Ecodev\Felix\Model\File $file;
13
14
    protected function setUp(): void
15
    {
16
        $this->file = new class() implements \Ecodev\Felix\Model\File {
17
            use File;
18
        };
19
    }
20
21
    public function testGetPath(): void
22
    {
23
        $this->file->setFilename('invoice.pdf');
24
25
        self::assertSame('invoice.pdf', $this->file->getFilename());
26
        $appPath = realpath('.');
27
        $expected = $appPath . '/data/file/invoice.pdf';
28
        self::assertSame($expected, $this->file->getPath());
29
    }
30
}
31