Passed
Push — master ( 8a4be9...c7b6b7 )
by Pierre
09:51
created

TwoDigitsYearTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
c 1
b 1
f 0
lcom 1
cbo 2
dl 0
loc 25
rs 10
1
<?php
2
3
namespace Popy\Calendar\Tests\Formatter\NumberConverter;
4
5
use PHPUnit_Framework_TestCase;
6
use Popy\Calendar\Formatter\NumberConverter\TwoDigitsYear;
7
8
class TwoDigitsYearTest extends PHPUnit_Framework_TestCase
9
{
10
    protected $converter;
11
12
    public function setUp()
13
    {
14
        $this->converter = new TwoDigitsYear();
15
    }
16
17
    public function provideTwoWaySamples()
18
    {
19
        yield [2000, '00'];
20
        yield [1990, '90'];
21
        yield [2010, '10'];
22
        yield [1950, '50'];
23
        yield [2049, '49'];
24
    }
25
26
    /**
27
     * @dataProvider provideTwoWaySamples
28
     */
29
    public function testConverter($year, $formatted)
30
    {
31
        $this->assertSame($formatted, $this->converter->to($year));
32
        $this->assertSame($year, $this->converter->from($formatted));
33
    }
34
}