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

HighchartsHoverTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 85
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 85
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\PlotOptions\Areaspline\Marker\States;
13
14
use PHPUnit_Framework_TestCase;
15
16
/**
17
 * Highcharts hover test.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Bundle\HighchartsBundle\Tests\API\Chart\PlotOptions\Areaspline\Marker\States
21
 * @version 5.0.14
22
 */
23
final class HighchartsHoverTest 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\PlotOptions\Areaspline\Marker\States\HighchartsHover(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->getLineWidthPlus());
39
        $this->assertEquals(null, $obj1->getRadius());
40
        $this->assertEquals(null, $obj1->getRadiusPlus());
41
42
        $obj0 = new \WBW\Bundle\HighchartsBundle\API\Chart\PlotOptions\Areaspline\Marker\States\HighchartsHover(false);
43
44
        $this->assertEquals(true, $obj0->getEnabled());
45
        $this->assertEquals(null, $obj0->getFillColor());
46
        $this->assertEquals("#ffffff", $obj0->getLineColor());
47
        $this->assertEquals(0, $obj0->getLineWidth());
48
        $this->assertEquals(1, $obj0->getLineWidthPlus());
49
        $this->assertEquals(null, $obj0->getRadius());
50
        $this->assertEquals(2, $obj0->getRadiusPlus());
51
    }
52
53
    /**
54
     * Tests the jsonSerialize() method.
55
     *
56
     * @return void
57
     */
58
    public function testJsonSerialize() {
59
60
        $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\PlotOptions\Areaspline\Marker\States\HighchartsHover(true);
61
62
        $this->assertEquals([], $obj->jsonSerialize());
63
    }
64
65
    /**
66
     * Tests the toArray() method.
67
     *
68
     * @return void
69
     */
70
    public function testToArray() {
71
72
        $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\PlotOptions\Areaspline\Marker\States\HighchartsHover(true);
73
74
        $obj->setEnabled(1);
75
76
        $res1 = ["enabled" => 1];
77
        $this->assertEquals($res1, $obj->toArray());
78
79
        $obj->setFillColor("1fde055d3ff900e04ca08bc82066d7fd");
80
81
        $res2 = ["enabled" => 1, "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd"];
82
        $this->assertEquals($res2, $obj->toArray());
83
84
        $obj->setLineColor("c2580eebfdbdb9fc629f50cc147c3f63");
85
86
        $res3 = ["enabled" => 1, "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd", "lineColor" => "c2580eebfdbdb9fc629f50cc147c3f63"];
87
        $this->assertEquals($res3, $obj->toArray());
88
89
        $obj->setLineWidth(86);
90
91
        $res4 = ["enabled" => 1, "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd", "lineColor" => "c2580eebfdbdb9fc629f50cc147c3f63", "lineWidth" => 86];
92
        $this->assertEquals($res4, $obj->toArray());
93
94
        $obj->setLineWidthPlus(60);
95
96
        $res5 = ["enabled" => 1, "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd", "lineColor" => "c2580eebfdbdb9fc629f50cc147c3f63", "lineWidth" => 86, "lineWidthPlus" => 60];
97
        $this->assertEquals($res5, $obj->toArray());
98
99
        $obj->setRadius(65);
100
101
        $res6 = ["enabled" => 1, "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd", "lineColor" => "c2580eebfdbdb9fc629f50cc147c3f63", "lineWidth" => 86, "lineWidthPlus" => 60, "radius" => 65];
102
        $this->assertEquals($res6, $obj->toArray());
103
104
        $obj->setRadiusPlus(89);
105
106
        $res7 = ["enabled" => 1, "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd", "lineColor" => "c2580eebfdbdb9fc629f50cc147c3f63", "lineWidth" => 86, "lineWidthPlus" => 60, "radius" => 65, "radiusPlus" => 89];
107
        $this->assertEquals($res7, $obj->toArray());
108
    }
109
110
}
111