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\ZAxis; |
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\ZAxis |
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\ZAxis\HighchartsEvents(true); |
33
|
|
|
|
34
|
|
|
$this->assertEquals(null, $obj1->getAfterBreaks()); |
35
|
|
|
$this->assertEquals(null, $obj1->getAfterSetExtremes()); |
36
|
|
|
$this->assertEquals(null, $obj1->getPointBreak()); |
37
|
|
|
$this->assertEquals(null, $obj1->getPointInBreak()); |
38
|
|
|
$this->assertEquals(null, $obj1->getSetExtremes()); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Tests the jsonSerialize() method. |
43
|
|
|
* |
44
|
|
|
* @return void |
45
|
|
|
*/ |
46
|
|
|
public function testJsonSerialize() { |
47
|
|
|
|
48
|
|
|
$obj = new \WBW\Bundle\HighchartsBundle\API\Chart\ZAxis\HighchartsEvents(true); |
49
|
|
|
|
50
|
|
|
$this->assertEquals([], $obj->jsonSerialize()); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Tests the toArray() method. |
55
|
|
|
* |
56
|
|
|
* @return void |
57
|
|
|
*/ |
58
|
|
|
public function testToArray() { |
59
|
|
|
|
60
|
|
|
$obj = new \WBW\Bundle\HighchartsBundle\API\Chart\ZAxis\HighchartsEvents(true); |
61
|
|
|
|
62
|
|
|
$obj->setAfterBreaks("2aee0ecaa51b86ca6fb2f52e53055d9c"); |
63
|
|
|
|
64
|
|
|
$res1 = ["afterBreaks" => "2aee0ecaa51b86ca6fb2f52e53055d9c"]; |
65
|
|
|
$this->assertEquals($res1, $obj->toArray()); |
66
|
|
|
|
67
|
|
|
$obj->setAfterSetExtremes("782a209aa49fe0f760e3d9379f843e13"); |
68
|
|
|
|
69
|
|
|
$res2 = ["afterBreaks" => "2aee0ecaa51b86ca6fb2f52e53055d9c", "afterSetExtremes" => "782a209aa49fe0f760e3d9379f843e13"]; |
70
|
|
|
$this->assertEquals($res2, $obj->toArray()); |
71
|
|
|
|
72
|
|
|
$obj->setPointBreak("0b72c42e9ef65da30a50c4374ac0ea59"); |
73
|
|
|
|
74
|
|
|
$res3 = ["afterBreaks" => "2aee0ecaa51b86ca6fb2f52e53055d9c", "afterSetExtremes" => "782a209aa49fe0f760e3d9379f843e13", "pointBreak" => "0b72c42e9ef65da30a50c4374ac0ea59"]; |
75
|
|
|
$this->assertEquals($res3, $obj->toArray()); |
76
|
|
|
|
77
|
|
|
$obj->setPointInBreak("84525ae3843d52f899c93a7e8d266492"); |
78
|
|
|
|
79
|
|
|
$res4 = ["afterBreaks" => "2aee0ecaa51b86ca6fb2f52e53055d9c", "afterSetExtremes" => "782a209aa49fe0f760e3d9379f843e13", "pointBreak" => "0b72c42e9ef65da30a50c4374ac0ea59", "pointInBreak" => "84525ae3843d52f899c93a7e8d266492"]; |
80
|
|
|
$this->assertEquals($res4, $obj->toArray()); |
81
|
|
|
|
82
|
|
|
$obj->setSetExtremes("057f72c70fe8778e16e200860308778c"); |
83
|
|
|
|
84
|
|
|
$res5 = ["afterBreaks" => "2aee0ecaa51b86ca6fb2f52e53055d9c", "afterSetExtremes" => "782a209aa49fe0f760e3d9379f843e13", "pointBreak" => "0b72c42e9ef65da30a50c4374ac0ea59", "pointInBreak" => "84525ae3843d52f899c93a7e8d266492", "setExtremes" => "057f72c70fe8778e16e200860308778c"]; |
85
|
|
|
$this->assertEquals($res5, $obj->toArray()); |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
} |
89
|
|
|
|