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

ImageTest.php$0 ➔ testDimension()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
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\Image;
8
use PHPUnit\Framework\TestCase;
9
10
class ImageTest extends TestCase
11
{
12
    /**
13
     * @var \Ecodev\Felix\Model\Image
14
     */
15
    private $image;
16
17
    protected function setUp(): void
18
    {
19
        $this->image = new class() implements \Ecodev\Felix\Model\Image {
20
            use Image;
21
        };
22
    }
23
24
    public function testGetPath(): void
25
    {
26
        $this->image->setFilename('photo.jpg');
27
28
        self::assertSame('photo.jpg', $this->image->getFilename());
29
        $appPath = realpath('.');
30
        $expected = $appPath . '/data/images/photo.jpg';
31
        self::assertSame($expected, $this->image->getPath());
32
    }
33
34
    public function testDimension(): void
35
    {
36
        $this->image->setWidth(123);
37
        $this->image->setHeight(456);
38
39
        self::assertSame(123, $this->image->getWidth());
40
        self::assertSame(456, $this->image->getHeight());
41
    }
42
}
43