AlertTest::testLevel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 1
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/*
4
 * For the full copyright and license information, please view the LICENSE file
5
 * that was distributed with this source code.
6
 */
7
8
declare (strict_types = 1);
9
10
namespace Component\Remote\BurzeDzisNet;
11
12
use PHPUnit_Framework_TestCase;
13
14
/**
15
 * {@see Alert} test
16
 *
17
 * @author Krzysztof Piasecki <[email protected]>
18
 */
19
class AlertTest extends PHPUnit_Framework_TestCase
20
{
21
    /**
22
     * @covers Component\Remote\BurzeDzisNet\Alert::startDate
23
     */
24
    public function testStartDate()
25
    {
26
        $alert = new Alert(1, '2015-02-12', '2015-02-18');
27
        $this->assertSame('2015-02-12', $alert->startDate());
28
    }
29
30
    /**
31
     * @covers Component\Remote\BurzeDzisNet\Alert::endDate
32
     */
33
    public function testEndDate()
34
    {
35
        $alert = new Alert(1, '2015-02-12', '2015-02-18');
36
        $this->assertSame('2015-02-18', $alert->endDate());
37
    }
38
39
    /**
40
     * @covers Component\Remote\BurzeDzisNet\Alert::level
41
     */
42
    public function testLevel()
43
    {
44
        $alert = new Alert(1, '2015-02-12', '2015-02-18');
45
        $this->assertSame(1, $alert->level());
46
    }
47
48
    /**
49
     * @covers Component\Remote\BurzeDzisNet\Alert::__construct
50
     */
51
    public function test__construct()
52
    {
53
        $alert = new Alert(1, '2015-02-12', '2015-02-18');
54
        $this->assertSame(1, $alert->level());
55
        $this->assertSame('2015-02-12', $alert->startDate());
56
        $this->assertSame('2015-02-18', $alert->endDate());
57
    }
58
}
59