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

VatParserTest::parseArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 2
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LauLamanApps\IzettleApi\Tests\Unit\Client\Purchase;
6
7
use LauLamanApps\IzettleApi\Client\Purchase\VatParser;
8
use Money\Currency;
9
use PHPUnit\Framework\TestCase;
10
11
/**
12
 * @small
13
 */
14
final class VatParserTest extends TestCase
15
{
16
    /**
17
     * @test
18
     */
19
    public function parseArray(): void
20
    {
21
        $data = [
22
            6 => 1000,
23
            21 => 500,
24
        ];
25
        $vatAmount = VatParser::parseArray($data, new Currency('EUR'));
26
27
        foreach ($vatAmount as $vat => $amount) {
28
            self::assertTrue(array_key_exists($vat, $data));
29
            self::assertSame($data[$vat], (int)$amount->getAmount());
30
        }
31
    }
32
}
33