AlertTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 40
rs 10
c 1
b 1
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testStartDate() 0 5 1
A testEndDate() 0 5 1
A testLevel() 0 5 1
A test__construct() 0 7 1
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