PointTest::testEquals()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
dl 0
loc 10
rs 9.4285
c 1
b 1
f 0
cc 1
eloc 8
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 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