StormTest::testLightnings()   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 Storm} test.
16
 *
17
 * @author Krzysztof Piasecki <[email protected]>
18
 */
19
class StormTest extends PHPUnit_Framework_TestCase
20
{
21
    /**
22
     * @covers Component\Remote\BurzeDzisNet\Storm::lightnings
23
     */
24
    public function testLightnings()
25
    {
26
        $storm = new Storm(14, 80.72, 'NE', 10, 50);
27
        $this->assertSame(14, $storm->lightnings());
28
    }
29
30
    /**
31
     * @covers Component\Remote\BurzeDzisNet\Storm::direction
32
     */
33
    public function testDirection()
34
    {
35
        $storm = new Storm(14, 80.72, 'NE', 10, 50);
36
        $this->assertSame('NE', $storm->direction());
37
    }
38
39
    /**
40
     * @covers Component\Remote\BurzeDzisNet\Storm::distance
41
     */
42
    public function testDistance()
43
    {
44
        $storm = new Storm(14, 80.72, 'NE', 10, 50);
45
        $this->assertSame(80.72, $storm->distance());
46
    }
47
48
    /**
49
     * @covers Component\Remote\BurzeDzisNet\Storm::timePeriod
50
     */
51
    public function testPeriod()
52
    {
53
        $storm = new Storm(14, 80.72, 'NE', 10, 50);
54
        $this->assertSame(10, $storm->period());
55
    }
56
57
    /**
58
     * @covers Component\Remote\BurzeDzisNet\Storm::getRadius
59
     */
60
    public function testRadius()
61
    {
62
        $storm = new Storm(14, 80.72, 'NE', 10, 50);
63
        $this->assertSame(50, $storm->radius());
64
    }
65
66
    /**
67
     * @covers Component\Remote\BurzeDzisNet\Storm::__construct
68
     */
69
    public function test__construct()
70
    {
71
        $storm = new Storm(14, 80.72, 'NE', 10, 50);
72
        $this->assertSame(14, $storm->lightnings());
73
        $this->assertSame('NE', $storm->direction());
74
        $this->assertSame(80.72, $storm->distance());
75
        $this->assertSame(10, $storm->period());
76
        $this->assertSame(50, $storm->radius());
77
    }
78
}
79