Completed
Push — master ( ecb243...bb1b22 )
by Pablo
03:58
created

CurrencyTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A currencyCodeProvider() 0 9 1
A itShouldReturnCurrency() 0 6 1
A itShouldThrowsException() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpValueObjects\Tests\Money;
6
7
use PhpValueObjects\Tests\BaseUnitTestCase;
8
9
final class CurrencyTest extends BaseUnitTestCase
10
{
11
    public function currencyCodeProvider(): array
12
    {
13
        return [
14
            ['EUR'],
15
            ['USD'],
16
            ['KYD'],
17
            ['HKD'],
18
        ];
19
    }
20
    /**
21
     * @test
22
     * @dataProvider currencyCodeProvider
23
     */
24
    public function itShouldReturnCurrency(string $currencyCode): void
25
    {
26
        $currency = new Currency($currencyCode);
27
28
        $this->assertSame($currencyCode, $currency->value());
29
    }
30
31
    /**
32
     * @test
33
     */
34
    public function itShouldThrowsException(): void
35
    {
36
        $this->expectException(\Exception::class);
37
38
        new Currency($this->faker()->address);
39
    }
40
}
41