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

HighchartsHaloTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 57
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\Scatter\States\Hover;
13
14
use PHPUnit_Framework_TestCase;
15
16
/**
17
 * Highcharts halo test.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Bundle\HighchartsBundle\Tests\API\Chart\Series\Scatter\States\Hover
21
 * @version 5.0.14
22
 */
23
final class HighchartsHaloTest 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\Scatter\States\Hover\HighchartsHalo(true);
33
34
        $this->assertEquals(null, $obj1->getAttributes());
35
        $this->assertEquals(null, $obj1->getOpacity());
36
        $this->assertEquals(null, $obj1->getSize());
37
38
        $obj0 = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Scatter\States\Hover\HighchartsHalo(false);
39
40
        $this->assertEquals(null, $obj0->getAttributes());
41
        $this->assertEquals(0.25, $obj0->getOpacity());
42
        $this->assertEquals(10, $obj0->getSize());
43
    }
44
45
    /**
46
     * Tests the jsonSerialize() method.
47
     *
48
     * @return void
49
     */
50
    public function testJsonSerialize() {
51
52
        $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Scatter\States\Hover\HighchartsHalo(true);
53
54
        $this->assertEquals([], $obj->jsonSerialize());
55
    }
56
57
    /**
58
     * Tests the toArray() method.
59
     *
60
     * @return void
61
     */
62
    public function testToArray() {
63
64
        $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Scatter\States\Hover\HighchartsHalo(true);
65
66
        $obj->setAttributes(["attributes" => "736b91750e516139acc13c5eb6564f92"]);
67
68
        $res1 = ["attributes" => ["attributes" => "736b91750e516139acc13c5eb6564f92"]];
69
        $this->assertEquals($res1, $obj->toArray());
70
71
        $obj->setOpacity(50);
72
73
        $res2 = ["attributes" => ["attributes" => "736b91750e516139acc13c5eb6564f92"], "opacity" => 50];
74
        $this->assertEquals($res2, $obj->toArray());
75
76
        $obj->setSize(61);
77
78
        $res3 = ["attributes" => ["attributes" => "736b91750e516139acc13c5eb6564f92"], "opacity" => 50, "size" => 61];
79
        $this->assertEquals($res3, $obj->toArray());
80
    }
81
82
}
83