|
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\PlotOptions\Columnrange; |
|
13
|
|
|
|
|
14
|
|
|
use PHPUnit_Framework_TestCase; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Highcharts zones test. |
|
18
|
|
|
* |
|
19
|
|
|
* @author webeweb <https://github.com/webeweb/> |
|
20
|
|
|
* @package WBW\Bundle\HighchartsBundle\Tests\API\Chart\PlotOptions\Columnrange |
|
21
|
|
|
* @version 5.0.14 |
|
22
|
|
|
*/ |
|
23
|
|
|
final class HighchartsZonesTest 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\PlotOptions\Columnrange\HighchartsZones(true); |
|
33
|
|
|
|
|
34
|
|
|
$this->assertEquals(null, $obj1->getClassName()); |
|
35
|
|
|
$this->assertEquals(null, $obj1->getColor()); |
|
36
|
|
|
$this->assertEquals(null, $obj1->getDashStyle()); |
|
37
|
|
|
$this->assertEquals(null, $obj1->getFillColor()); |
|
38
|
|
|
$this->assertEquals(null, $obj1->getValue()); |
|
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\PlotOptions\Columnrange\HighchartsZones(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\PlotOptions\Columnrange\HighchartsZones(true); |
|
61
|
|
|
|
|
62
|
|
|
$obj->setClassName("6f66e878c62db60568a3487869695820"); |
|
63
|
|
|
|
|
64
|
|
|
$res1 = ["className" => "6f66e878c62db60568a3487869695820"]; |
|
65
|
|
|
$this->assertEquals($res1, $obj->toArray()); |
|
66
|
|
|
|
|
67
|
|
|
$obj->setColor("70dda5dfb8053dc6d1c492574bce9bfd"); |
|
68
|
|
|
|
|
69
|
|
|
$res2 = ["className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd"]; |
|
70
|
|
|
$this->assertEquals($res2, $obj->toArray()); |
|
71
|
|
|
|
|
72
|
|
|
$obj->setDashStyle("5ad5e24042182b1974cdf57345defe8e"); |
|
73
|
|
|
|
|
74
|
|
|
$res3 = ["className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "dashStyle" => "5ad5e24042182b1974cdf57345defe8e"]; |
|
75
|
|
|
$this->assertEquals($res3, $obj->toArray()); |
|
76
|
|
|
|
|
77
|
|
|
$obj->setFillColor("1fde055d3ff900e04ca08bc82066d7fd"); |
|
78
|
|
|
|
|
79
|
|
|
$res4 = ["className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "dashStyle" => "5ad5e24042182b1974cdf57345defe8e", "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd"]; |
|
80
|
|
|
$this->assertEquals($res4, $obj->toArray()); |
|
81
|
|
|
|
|
82
|
|
|
$obj->setValue(41); |
|
83
|
|
|
|
|
84
|
|
|
$res5 = ["className" => "6f66e878c62db60568a3487869695820", "color" => "70dda5dfb8053dc6d1c492574bce9bfd", "dashStyle" => "5ad5e24042182b1974cdf57345defe8e", "fillColor" => "1fde055d3ff900e04ca08bc82066d7fd", "value" => 41]; |
|
85
|
|
|
$this->assertEquals($res5, $obj->toArray()); |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
} |
|
89
|
|
|
|