Completed
Branch master (c7b6b7)
by Pierre
19:40 queued 09:38
created

TwoDigitsYearTest::provideTwoWaySamples()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
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
}