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 Point} test. |
16
|
|
|
* |
17
|
|
|
* @author Krzysztof Piasecki <[email protected]> |
18
|
|
|
*/ |
19
|
|
|
class PointTest extends PHPUnit_Framework_TestCase |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @covers Component\Remote\BurzeDzisNet\Point::x |
23
|
|
|
*/ |
24
|
|
|
public function testX() |
25
|
|
|
{ |
26
|
|
|
$point = new Point(17.02, 51.07); |
27
|
|
|
$this->assertSame(17.02, $point->x()); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @covers Component\Remote\BurzeDzisNet\Point::y |
32
|
|
|
*/ |
33
|
|
|
public function testY() |
34
|
|
|
{ |
35
|
|
|
$point = new Point(17.02, 51.07); |
36
|
|
|
$this->assertSame(51.07, $point->y()); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @covers Component\Remote\BurzeDzisNet\Point::__construct |
41
|
|
|
*/ |
42
|
|
|
public function test__construct() |
43
|
|
|
{ |
44
|
|
|
$point = new Point(17.02, 51.07); |
45
|
|
|
$this->assertSame(17.02, $point->x()); |
46
|
|
|
$this->assertSame(51.07, $point->y()); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @covers Component\Remote\BurzeDzisNet\Point::equals |
51
|
|
|
*/ |
52
|
|
|
public function testEquals() |
53
|
|
|
{ |
54
|
|
|
$point = new Point(17.02, 51.07); |
55
|
|
|
$point2 = new Point(17.02, 51.07); |
56
|
|
|
$point3 = new Point(51.07, 17.02); |
57
|
|
|
$this->assertTrue($point->equals($point)); |
58
|
|
|
$this->assertTrue($point->equals($point2)); |
59
|
|
|
$this->assertFalse($point->equals($point3)); |
60
|
|
|
$this->assertFalse($point2->equals($point3)); |
61
|
|
|
} |
62
|
|
|
} |
63
|
|
|
|