Failed Conditions
Push — master ( 5e6761...398dce )
by Adrien
04:14 queued 01:57
created

FileTest.php$0 ➔ testGetPath()   A

Complexity

Conditions 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
cc 1
rs 10
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
class FileTest extends TestCase
11
{
12
    /**
13
     * @var \Ecodev\Felix\Model\File
14
     */
15
    private $file;
16
17
    protected function setUp(): void
18
    {
19
        $this->file = new class() implements \Ecodev\Felix\Model\File {
20
            use File;
21
        };
22
    }
23
24
    public function testGetPath(): void
25
    {
26
        $this->file->setFilename('invoice.pdf');
27
28
        self::assertSame('invoice.pdf', $this->file->getFilename());
29
        $appPath = realpath('.');
30
        $expected = $appPath . '/data/file/invoice.pdf';
31
        self::assertSame($expected, $this->file->getPath());
32
    }
33
}
34