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\Funnel; |
13
|
|
|
|
14
|
|
|
use PHPUnit_Framework_TestCase; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Highcharts events test. |
18
|
|
|
* |
19
|
|
|
* @author webeweb <https://github.com/webeweb/> |
20
|
|
|
* @package WBW\Bundle\HighchartsBundle\Tests\API\Chart\Series\Funnel |
21
|
|
|
* @version 5.0.14 |
22
|
|
|
*/ |
23
|
|
|
final class HighchartsEventsTest 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\Funnel\HighchartsEvents(true); |
33
|
|
|
|
34
|
|
|
$this->assertEquals(null, $obj1->getAfterAnimate()); |
35
|
|
|
$this->assertEquals(null, $obj1->getCheckboxClick()); |
36
|
|
|
$this->assertEquals(null, $obj1->getClick()); |
37
|
|
|
$this->assertEquals(null, $obj1->getHide()); |
38
|
|
|
$this->assertEquals(null, $obj1->getLegendItemClick()); |
39
|
|
|
$this->assertEquals(null, $obj1->getMouseOut()); |
40
|
|
|
$this->assertEquals(null, $obj1->getMouseOver()); |
41
|
|
|
$this->assertEquals(null, $obj1->getShow()); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Tests the jsonSerialize() method. |
46
|
|
|
* |
47
|
|
|
* @return void |
48
|
|
|
*/ |
49
|
|
|
public function testJsonSerialize() { |
50
|
|
|
|
51
|
|
|
$obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Funnel\HighchartsEvents(true); |
52
|
|
|
|
53
|
|
|
$this->assertEquals([], $obj->jsonSerialize()); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Tests the toArray() method. |
58
|
|
|
* |
59
|
|
|
* @return void |
60
|
|
|
*/ |
61
|
|
|
public function testToArray() { |
62
|
|
|
|
63
|
|
|
$obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Funnel\HighchartsEvents(true); |
64
|
|
|
|
65
|
|
|
$obj->setAfterAnimate("ebdf113b6f659f6f3ea3c6b93e658235"); |
66
|
|
|
|
67
|
|
|
$res1 = ["afterAnimate" => "ebdf113b6f659f6f3ea3c6b93e658235"]; |
68
|
|
|
$this->assertEquals($res1, $obj->toArray()); |
69
|
|
|
|
70
|
|
|
$obj->setCheckboxClick("27e3160a9be50f7b44b7bb9086d94964"); |
71
|
|
|
|
72
|
|
|
$res2 = ["afterAnimate" => "ebdf113b6f659f6f3ea3c6b93e658235", "checkboxClick" => "27e3160a9be50f7b44b7bb9086d94964"]; |
73
|
|
|
$this->assertEquals($res2, $obj->toArray()); |
74
|
|
|
|
75
|
|
|
$obj->setClick("a8affc088cbca89fa20dbd98c91362e4"); |
76
|
|
|
|
77
|
|
|
$res3 = ["afterAnimate" => "ebdf113b6f659f6f3ea3c6b93e658235", "checkboxClick" => "27e3160a9be50f7b44b7bb9086d94964", "click" => "a8affc088cbca89fa20dbd98c91362e4"]; |
78
|
|
|
$this->assertEquals($res3, $obj->toArray()); |
79
|
|
|
|
80
|
|
|
$obj->setHide("a88f05b6c963e145a45b58c47cd42a41"); |
81
|
|
|
|
82
|
|
|
$res4 = ["afterAnimate" => "ebdf113b6f659f6f3ea3c6b93e658235", "checkboxClick" => "27e3160a9be50f7b44b7bb9086d94964", "click" => "a8affc088cbca89fa20dbd98c91362e4", "hide" => "a88f05b6c963e145a45b58c47cd42a41"]; |
83
|
|
|
$this->assertEquals($res4, $obj->toArray()); |
84
|
|
|
|
85
|
|
|
$obj->setLegendItemClick("56c962f18312c892a25fdf27904bd24b"); |
86
|
|
|
|
87
|
|
|
$res5 = ["afterAnimate" => "ebdf113b6f659f6f3ea3c6b93e658235", "checkboxClick" => "27e3160a9be50f7b44b7bb9086d94964", "click" => "a8affc088cbca89fa20dbd98c91362e4", "hide" => "a88f05b6c963e145a45b58c47cd42a41", "legendItemClick" => "56c962f18312c892a25fdf27904bd24b"]; |
88
|
|
|
$this->assertEquals($res5, $obj->toArray()); |
89
|
|
|
|
90
|
|
|
$obj->setMouseOut("efc487f286f5bca976fafe58cb6e7895"); |
91
|
|
|
|
92
|
|
|
$res6 = ["afterAnimate" => "ebdf113b6f659f6f3ea3c6b93e658235", "checkboxClick" => "27e3160a9be50f7b44b7bb9086d94964", "click" => "a8affc088cbca89fa20dbd98c91362e4", "hide" => "a88f05b6c963e145a45b58c47cd42a41", "legendItemClick" => "56c962f18312c892a25fdf27904bd24b", "mouseOut" => "efc487f286f5bca976fafe58cb6e7895"]; |
93
|
|
|
$this->assertEquals($res6, $obj->toArray()); |
94
|
|
|
|
95
|
|
|
$obj->setMouseOver("1f1a5f011c50a092eb06446d724dd573"); |
96
|
|
|
|
97
|
|
|
$res7 = ["afterAnimate" => "ebdf113b6f659f6f3ea3c6b93e658235", "checkboxClick" => "27e3160a9be50f7b44b7bb9086d94964", "click" => "a8affc088cbca89fa20dbd98c91362e4", "hide" => "a88f05b6c963e145a45b58c47cd42a41", "legendItemClick" => "56c962f18312c892a25fdf27904bd24b", "mouseOut" => "efc487f286f5bca976fafe58cb6e7895", "mouseOver" => "1f1a5f011c50a092eb06446d724dd573"]; |
98
|
|
|
$this->assertEquals($res7, $obj->toArray()); |
99
|
|
|
|
100
|
|
|
$obj->setShow("a7dd12b1dab17d25467b0b0a4c8d4a92"); |
101
|
|
|
|
102
|
|
|
$res8 = ["afterAnimate" => "ebdf113b6f659f6f3ea3c6b93e658235", "checkboxClick" => "27e3160a9be50f7b44b7bb9086d94964", "click" => "a8affc088cbca89fa20dbd98c91362e4", "hide" => "a88f05b6c963e145a45b58c47cd42a41", "legendItemClick" => "56c962f18312c892a25fdf27904bd24b", "mouseOut" => "efc487f286f5bca976fafe58cb6e7895", "mouseOver" => "1f1a5f011c50a092eb06446d724dd573", "show" => "a7dd12b1dab17d25467b0b0a4c8d4a92"]; |
103
|
|
|
$this->assertEquals($res8, $obj->toArray()); |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
} |
107
|
|
|
|