Completed
Push — master ( b736eb...f06be5 )
by Laurens
03:50 queued 01:55
created

ImageParserTest::parseArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
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
final class ImageParserTest extends TestCase
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