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

VatParserTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

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