Passed
Push — master ( 802754...f898ad )
by WEBEWEB
07:59 queued 25s
created

HighchartsSelectTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 71
rs 10
c 0
b 0
f 0
wmc 3
1
<?php
2
3
/**
4
 * This file is part of the highcharts-bundle package.
5
 *
6
 * (c) 2017 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\HighchartsBundle\Tests\API\Chart\Series\Polygon\Data\Marker\States;
13
14
use PHPUnit_Framework_TestCase;
15
16
/**
17
 * Highcharts select test.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Bundle\HighchartsBundle\Tests\API\Chart\Series\Polygon\Data\Marker\States
21
 * @version 5.0.14
22
 */
23
final class HighchartsSelectTest extends PHPUnit_Framework_TestCase {
24
25
    /**
26
     * Tests the __construct() method.
27
     *
28
     * @return void
29
     */
30
    public function testConstructor() {
31
32
        $obj1 = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Polygon\Data\Marker\States\HighchartsSelect(true);
33
34
        $this->assertEquals(null, $obj1->getEnabled());
35
        $this->assertEquals(null, $obj1->getFillColor());
36
        $this->assertEquals(null, $obj1->getLineColor());
37
        $this->assertEquals(null, $obj1->getLineWidth());
38
        $this->assertEquals(null, $obj1->getRadius());
39
40
        $obj0 = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Polygon\Data\Marker\States\HighchartsSelect(false);
41
42
        $this->assertEquals(true, $obj0->getEnabled());
43
        $this->assertEquals(null, $obj0->getFillColor());
44
        $this->assertEquals("#000000", $obj0->getLineColor());
45
        $this->assertEquals(0, $obj0->getLineWidth());
46
        $this->assertEquals(null, $obj0->getRadius());
47
    }
48
49
    /**
50
     * Tests the jsonSerialize() method.
51
     *
52
     * @return void
53
     */
54
    public function testJsonSerialize() {
55
56
        $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Polygon\Data\Marker\States\HighchartsSelect(true);
57
58
        $this->assertEquals([], $obj->jsonSerialize());
59
    }
60
61
    /**
62
     * Tests the toArray() method.
63
     *
64
     * @return void
65
     */
66
    public function testToArray() {
67
68
        $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Polygon\Data\Marker\States\HighchartsSelect(true);
69
70
        $obj->setEnabled(1);
71
72
        $res1 = ["enabled" => 1];
73
        $this->assertEquals($res1, $obj->toArray());
74
75
        $obj->setFillColor("1fde055d3ff900e04ca08bc82066d7fd");
76
77
        $res2 = ["enabled" => 1, "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd"];
78
        $this->assertEquals($res2, $obj->toArray());
79
80
        $obj->setLineColor("c2580eebfdbdb9fc629f50cc147c3f63");
81
82
        $res3 = ["enabled" => 1, "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd", "lineColor" => "c2580eebfdbdb9fc629f50cc147c3f63"];
83
        $this->assertEquals($res3, $obj->toArray());
84
85
        $obj->setLineWidth(87);
86
87
        $res4 = ["enabled" => 1, "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd", "lineColor" => "c2580eebfdbdb9fc629f50cc147c3f63", "lineWidth" => 87];
88
        $this->assertEquals($res4, $obj->toArray());
89
90
        $obj->setRadius(17);
91
92
        $res5 = ["enabled" => 1, "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd", "lineColor" => "c2580eebfdbdb9fc629f50cc147c3f63", "lineWidth" => 87, "radius" => 17];
93
        $this->assertEquals($res5, $obj->toArray());
94
    }
95
96
}
97