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
|
|
|
|