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\Waterfall\Point; |
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\Waterfall\Point |
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\Waterfall\Point\HighchartsEvents(true); |
33
|
|
|
|
34
|
|
|
$this->assertEquals(null, $obj1->getClick()); |
35
|
|
|
$this->assertEquals(null, $obj1->getMouseOut()); |
36
|
|
|
$this->assertEquals(null, $obj1->getMouseOver()); |
37
|
|
|
$this->assertEquals(null, $obj1->getRemove()); |
38
|
|
|
$this->assertEquals(null, $obj1->getSelect()); |
39
|
|
|
$this->assertEquals(null, $obj1->getUnselect()); |
40
|
|
|
$this->assertEquals(null, $obj1->getUpdate()); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Tests the jsonSerialize() method. |
45
|
|
|
* |
46
|
|
|
* @return void |
47
|
|
|
*/ |
48
|
|
|
public function testJsonSerialize() { |
49
|
|
|
|
50
|
|
|
$obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Waterfall\Point\HighchartsEvents(true); |
51
|
|
|
|
52
|
|
|
$this->assertEquals([], $obj->jsonSerialize()); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Tests the toArray() method. |
57
|
|
|
* |
58
|
|
|
* @return void |
59
|
|
|
*/ |
60
|
|
|
public function testToArray() { |
61
|
|
|
|
62
|
|
|
$obj = new \WBW\Bundle\HighchartsBundle\API\Chart\Series\Waterfall\Point\HighchartsEvents(true); |
63
|
|
|
|
64
|
|
|
$obj->setClick("a8affc088cbca89fa20dbd98c91362e4"); |
65
|
|
|
|
66
|
|
|
$res1 = ["click" => "a8affc088cbca89fa20dbd98c91362e4"]; |
67
|
|
|
$this->assertEquals($res1, $obj->toArray()); |
68
|
|
|
|
69
|
|
|
$obj->setMouseOut("efc487f286f5bca976fafe58cb6e7895"); |
70
|
|
|
|
71
|
|
|
$res2 = ["click" => "a8affc088cbca89fa20dbd98c91362e4", "mouseOut" => "efc487f286f5bca976fafe58cb6e7895"]; |
72
|
|
|
$this->assertEquals($res2, $obj->toArray()); |
73
|
|
|
|
74
|
|
|
$obj->setMouseOver("1f1a5f011c50a092eb06446d724dd573"); |
75
|
|
|
|
76
|
|
|
$res3 = ["click" => "a8affc088cbca89fa20dbd98c91362e4", "mouseOut" => "efc487f286f5bca976fafe58cb6e7895", "mouseOver" => "1f1a5f011c50a092eb06446d724dd573"]; |
77
|
|
|
$this->assertEquals($res3, $obj->toArray()); |
78
|
|
|
|
79
|
|
|
$obj->setRemove("0f6969d7052da9261e31ddb6e88c136e"); |
80
|
|
|
|
81
|
|
|
$res4 = ["click" => "a8affc088cbca89fa20dbd98c91362e4", "mouseOut" => "efc487f286f5bca976fafe58cb6e7895", "mouseOver" => "1f1a5f011c50a092eb06446d724dd573", "remove" => "0f6969d7052da9261e31ddb6e88c136e"]; |
82
|
|
|
$this->assertEquals($res4, $obj->toArray()); |
83
|
|
|
|
84
|
|
|
$obj->setSelect("99938282f04071859941e18f16efcf42"); |
85
|
|
|
|
86
|
|
|
$res5 = ["click" => "a8affc088cbca89fa20dbd98c91362e4", "mouseOut" => "efc487f286f5bca976fafe58cb6e7895", "mouseOver" => "1f1a5f011c50a092eb06446d724dd573", "remove" => "0f6969d7052da9261e31ddb6e88c136e", "select" => "99938282f04071859941e18f16efcf42"]; |
87
|
|
|
$this->assertEquals($res5, $obj->toArray()); |
88
|
|
|
|
89
|
|
|
$obj->setUnselect("223f2d725e5f4ddb92b585d87421adbd"); |
90
|
|
|
|
91
|
|
|
$res6 = ["click" => "a8affc088cbca89fa20dbd98c91362e4", "mouseOut" => "efc487f286f5bca976fafe58cb6e7895", "mouseOver" => "1f1a5f011c50a092eb06446d724dd573", "remove" => "0f6969d7052da9261e31ddb6e88c136e", "select" => "99938282f04071859941e18f16efcf42", "unselect" => "223f2d725e5f4ddb92b585d87421adbd"]; |
92
|
|
|
$this->assertEquals($res6, $obj->toArray()); |
93
|
|
|
|
94
|
|
|
$obj->setUpdate("3ac340832f29c11538fbe2d6f75e8bcc"); |
95
|
|
|
|
96
|
|
|
$res7 = ["click" => "a8affc088cbca89fa20dbd98c91362e4", "mouseOut" => "efc487f286f5bca976fafe58cb6e7895", "mouseOver" => "1f1a5f011c50a092eb06446d724dd573", "remove" => "0f6969d7052da9261e31ddb6e88c136e", "select" => "99938282f04071859941e18f16efcf42", "unselect" => "223f2d725e5f4ddb92b585d87421adbd", "update" => "3ac340832f29c11538fbe2d6f75e8bcc"]; |
97
|
|
|
$this->assertEquals($res7, $obj->toArray()); |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
} |
101
|
|
|
|