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

ImageParserTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A parseArray() 0 17 2
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