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

HighchartsStatesTest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 69
rs 10
c 0
b 0
f 0
wmc 5
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\Treemap;
13
14
use PHPUnit_Framework_TestCase;
15
16
/**
17
 * Highcharts states test.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Bundle\HighchartsBundle\Tests\API\Chart\Series\Treemap
21
 * @version 5.0.14
22
 */
23
final class HighchartsStatesTest 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\Treemap\HighchartsStates(true);
33
34
        $this->assertEquals(null, $obj1->getHover());
35
    }
36
37
    /**
38
     * Tests the clear() method.
39
     *
40
     * @return void
41
     */
42
    public function testClear() {
43
44
        $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Treemap\HighchartsStates(false);
45
46
        $obj->newHover();
47
48
        $obj->clear();
49
50
        $res = ["hover" => []];
51
        $this->assertEquals($res, $obj->toArray());
52
    }
53
54
    /**
55
     * Tests the jsonSerialize() method.
56
     *
57
     * @return void
58
     */
59
    public function testJsonSerialize() {
60
61
        $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Treemap\HighchartsStates(true);
62
63
        $this->assertEquals([], $obj->jsonSerialize());
64
    }
65
66
    /**
67
     * Tests the newHover() method.
68
     *
69
     * @return void.
70
     */
71
    public function testNewHover() {
72
73
        $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Treemap\HighchartsStates(false);
74
75
        $res = $obj->newHover();
76
        $this->assertInstanceOf(\WBW\Bundle\HighchartsBundle\API\Chart\Series\Treemap\States\HighchartsHover::class, $res);
77
    }
78
79
    /**
80
     * Tests the toArray() method.
81
     *
82
     * @return void
83
     */
84
    public function testToArray() {
85
86
        $obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Treemap\HighchartsStates(true);
87
88
        $obj->setHover(new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Treemap\States\HighchartsHover());
89
90
        $res1 = ["hover" => []];
91
        $this->assertEquals($res1, $obj->toArray());
92
    }
93
94
}
95