Test Failed
Pull Request — master (#7)
by Laurens
02:01
created

ImageParserTest::parseArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 10

Duplication

Lines 17
Ratio 100 %

Importance

Changes 0
Metric Value
dl 17
loc 17
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 10
nc 2
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\IzettleApi\Tests\Unit\Client\Universal;
6
7
use LauLamanApps\IzettleApi\API\Image;
8
use LauLamanApps\IzettleApi\API\ImageCollection;
9
use LauLamanApps\IzettleApi\Client\Universal\ImageParser;
10
use PHPUnit\Framework\TestCase;
11
12
/**
13
 * @small
14
 */
15 View Code Duplication
final class ImageParserTest extends TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
{
17
    /**
18
     * @test
19
     */
20
    public function parseArray(): void
21
    {
22
        $data = [
23
            "a.jpeg",
24
            "b.png",
25
            "c.gif",
26
        ];
27
28
        $imageCollection = ImageParser::parseArray($data);
29
30
        self::assertInstanceOf(ImageCollection::class, $imageCollection);
31
        self::assertSame(count($data), count($imageCollection->getAll()));
32
33
        foreach ($imageCollection->getAll() as $image) {
34
            self::assertInstanceOf(Image::class, $image);
35
        }
36
    }
37
}
38