StatsDTOTest::testYear()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * File:StatsDTOTest.php
6
 *
7
 * @author Maciej Sławik <[email protected]>
8
 * @copyright Copyright (C) 2018 Lizard Media (http://lizardmedia.pl)
9
 */
10
11
namespace MSlwk\Otomoto\App\Test\Unit\Stats\Data;
12
13
use MSlwk\Otomoto\App\Stats\Data\StatsDTO;
14
use PHPUnit\Framework\TestCase;
15
16
/**
17
 * Class StatsDTOTest
18
 * @package MSlwk\Otomoto\App\Test\Unit\Stats\Data
19
 */
20
class StatsDTOTest extends TestCase
21
{
22
    /**
23
     * @var StatsDTO
24
     */
25
    private $statsDTO;
26
27
    /**
28
     * @return void
29
     */
30
    protected function setUp()
31
    {
32
        $this->statsDTO = new StatsDTO();
33
    }
34
35
    /**
36
     * @test
37
     */
38
    public function testMileage()
39
    {
40
        $this->statsDTO->setAverageMileage(3425.32);
41
        $expectedMileage = 3425.32;
42
43
        $this->assertEquals($expectedMileage, $this->statsDTO->getAverageMileage());
44
    }
45
46
    /**
47
     * @test
48
     */
49
    public function testPrice()
50
    {
51
        $this->statsDTO->setAveragePrice(65489.21);
52
        $expectedPrice = 65489.21;
53
54
        $this->assertEquals($expectedPrice, $this->statsDTO->getAveragePrice());
55
    }
56
57
    /**
58
     * @test
59
     */
60
    public function testYear()
61
    {
62
        $this->statsDTO->setAverageYear(2013.23);
63
        $expectedYear = 2013.23;
64
65
        $this->assertEquals($expectedYear, $this->statsDTO->getAverageYear());
66
    }
67
}
68