chart->getId()}'] = chart;
+ }})(window.onload);
+ JS;
+ }
+
+
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/src/Renderer/Json.php b/pandora_console/vendor/artica/phpchartjs/src/Renderer/Json.php
new file mode 100644
index 0000000000..6e3843b0c0
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/src/Renderer/Json.php
@@ -0,0 +1,64 @@
+ constant(get_class($this->chart).'::TYPE'),
+ 'data' => [],
+ ];
+
+ $labels = $this->chart->labels()->jsonSerialize();
+ if ($labels) {
+ $config['data']['labels'] = $labels;
+ }
+
+ $dataSets = $this->chart->dataSets()->jsonSerialize();
+ if ($dataSets) {
+ $config['data']['datasets'] = $dataSets;
+ }
+
+ $options = $this->chart->options()->jsonSerialize();
+ if (! empty($options)) {
+ $config['options'] = $options;
+ }
+
+ $defaults = $this->chart->defaults()->jsonSerialize();
+ if (! empty($defaults)) {
+ $config['defaults'] = $defaults;
+ }
+
+ $plugins = $this->chart->plugins()->jsonSerialize();
+ if (! empty($plugins)) {
+ $config['plugins'] = $plugins;
+ }
+
+ $output = JsonHelper::encode($config, false, ['enableJsonExprFinder' => true]);
+ if (($flags & Renderer::RENDER_PRETTY)) {
+ $output = JsonHelper::prettyPrint($output);
+ }
+
+ return $output;
+ }
+
+
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/src/Renderer/Renderer.php b/pandora_console/vendor/artica/phpchartjs/src/Renderer/Renderer.php
new file mode 100644
index 0000000000..67131777cf
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/src/Renderer/Renderer.php
@@ -0,0 +1,32 @@
+chart = $chart;
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/src/Renderer/RendererInterface.php b/pandora_console/vendor/artica/phpchartjs/src/Renderer/RendererInterface.php
new file mode 100644
index 0000000000..2fe7659600
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/src/Renderer/RendererInterface.php
@@ -0,0 +1,27 @@
+ $value) {
+ $function = 'set' . ucfirst($key);
+ if (! is_null($value) && method_exists($obj, $function)) {
+ $obj->$function($value);
+ }
+ }
+ }
+
+ /**
+ * this method reads all defined attributes from the input array
+ * $input_data and calls the getter. It returns the resulting array.
+ *
+ * @param $obj
+ * @param array $dataTypes is an associative array that refers fieldnames to values.
+ * The values could be any primitive type, including an array.
+ *
+ * @return array
+ */
+ public static function getAttributes($obj, array $dataTypes)
+ {
+
+ if (! is_object($obj)) {
+ throw new RuntimeException("First param should be an object. ");
+ }
+
+ $array = [];
+ foreach ($dataTypes as $key => $value) {
+ $function = ( gettype($value) == "boolean" ? 'is' : 'get' ) . ucfirst($key);
+ if (method_exists($obj, $function)) {
+ $getResult = $obj->$function($value);
+ $getResult = $getResult instanceof Expr ? $getResult->__toString() : $getResult;
+ $array[ $key ] = $getResult;
+ }
+ }
+
+ return $array;
+ }
+
+ /**
+ * @param $input_array
+ *
+ * @return mixed
+ */
+ public static function removeNullsFromArray($input_array)
+ {
+ $array = $input_array;
+ $keys = array_keys($array);
+ foreach ($keys as $key) {
+ if (is_null($array[ $key ])) {
+ unset($array[ $key ]);
+ }
+ }
+
+ return $array;
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/bootstrap.php b/pandora_console/vendor/artica/phpchartjs/test/bootstrap.php
new file mode 100644
index 0000000000..6c8c4f51b9
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/bootstrap.php
@@ -0,0 +1,3 @@
+setId('myChart');
+
+// Set labels
+$bar->labels()->exchangeArray(["M", "T", "W", "T", "F", "S", "S"]);
+
+// Add Datasets
+$apples = $bar->createDataSet();
+
+$apples->setLabel("apples")
+ ->setBackgroundColor("rgba( 0, 150, 0, .5 )")
+ ->data()->exchangeArray([12, 19, 3, 17, 28, 24, 7]);
+$bar->addDataSet($apples);
+
+$oranges = $bar->createDataSet();
+$oranges->setLabel("oranges")
+ ->setBackgroundColor('rgba( 255, 153, 0, .5 )')
+ ->data()->exchangeArray([30, 29, 5, 5, 20, 3, 10]);
+$bar->addDataSet($oranges);
+
+?>
+
+
+
+ Bar
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/barAndLine.php b/pandora_console/vendor/artica/phpchartjs/test/example/barAndLine.php
new file mode 100644
index 0000000000..d000b7e58b
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/barAndLine.php
@@ -0,0 +1,72 @@
+create($factory::BAR);
+
+// Set labels
+$bar->labels()->exchangeArray(["January", "February", "March", "April", "May", "June", "July"]);
+
+// Add Datasets
+$dataSet = new LineDataSet();
+$dataSet->setLabel('My First dataset')
+ ->setType('line')
+ ->setFill(false)
+ ->setLineTension(0.1)
+ ->setBackgroundColor('rgba(75,192,192,0.4)')
+ ->setBorderColor('rgba(75,192,192,1)')
+ ->setBorderCapStyle('butt')
+ ->setBorderDash([])
+ ->setBorderDashOffset(0.0)
+ ->setBorderJoinStyle('miter')
+ ->setPointBorderColor('rgba(75,192,192,1)')
+ ->setPointBackgroundColor('#fff')
+ ->setPointBorderWidth(1)
+ ->setPointHoverRadius(5)
+ ->setPointHoverBackgroundColor('rgba(75,192,192,1)')
+ ->setPointHoverBorderColor('rgba(220,220,220,1)')
+ ->setPointHoverBorderWidth(2)
+ ->setPointRadius(1)
+ ->setPointHitRadius(10)
+ ->data()->exchangeArray([65, 59, 80, 81, 56, 55, 40]);
+$bar->addDataSet($dataSet);
+
+// Set mode to stacked
+$scales = $bar->options()->getScales();
+$scales->getYAxes()->append($scales->createYAxis()->setStacked(true))
+ ->append($scales->createYAxis()->setPosition('right')->setId('y2'));
+
+// Add even more data
+$apples = $bar->createDataSet();
+$apples->setLabel('apples')
+ ->setYAxisID('y2')
+ ->setBackgroundColor('rgba( 0, 150, 0, .5 )')
+ ->data()->exchangeArray([12, 19, 3, 17, 28, 24, 7]);
+$bar->addDataSet($apples);
+
+$oranges = $bar->createDataSet();
+$oranges->setLabel('oranges')
+ ->setYAxisID('y2')
+ ->setBackgroundColor('rgba( 255, 153, 0, .5 )')
+ ->data()->exchangeArray([30, 29, 5, 5, 20, 3, 10]);
+$bar->addDataSet($oranges);
+
+?>
+
+
+
+ Bar & line
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/barWithoutScales.php b/pandora_console/vendor/artica/phpchartjs/test/example/barWithoutScales.php
new file mode 100644
index 0000000000..3dfa2c468b
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/barWithoutScales.php
@@ -0,0 +1,52 @@
+setId('myChart');
+
+// Set labels
+$bar->labels()->exchangeArray(["M", "T", "W", "T", "F", "S", "S"]);
+
+// Add Datasets
+$apples = $bar->createDataSet();
+
+$apples->setLabel("apples")
+ ->setBackgroundColor("rgba( 0, 150, 0, .5 )")
+ ->data()->exchangeArray([12, 19, 3, 17, 28, 24, 7]);
+$bar->addDataSet($apples);
+
+$oranges = $bar->createDataSet();
+$oranges->setLabel("oranges")
+ ->setBackgroundColor('rgba( 255, 153, 0, .5 )')
+ ->data()->exchangeArray([30, 29, 5, 5, 20, 3, 10]);
+$bar->addDataSet($oranges);
+
+/** @var BarOptions $options */
+$options = $bar->options();
+$xAxis = $options->getScales()->createXAxis();
+$yAxis = $options->getScales()->createYAxis();
+
+$xAxis->setDisplay(false);
+$yAxis->setDisplay(false);
+
+$options->getScales()->getXAxes()->append($xAxis);
+$options->getScales()->getYAxes()->append($yAxis);
+
+?>
+
+
+
+ Bar without scales
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/bubble.php b/pandora_console/vendor/artica/phpchartjs/test/example/bubble.php
new file mode 100644
index 0000000000..b67099d399
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/bubble.php
@@ -0,0 +1,54 @@
+create($factory::BUBBLE);
+
+// Set labels
+$bubble->labels()->exchangeArray(["M", "T", "W", "T", "F", "S", "S"]);
+
+// Add Datasets
+$apples = $bubble->createDataSet();
+$apples->setLabel('My first dataset')
+ ->setBackgroundColor('rgba( 0, 150, 0, .5 )')
+ ->data()->exchangeArray([
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ]);
+$bubble->addDataSet($apples);
+
+$oranges = $bubble->createDataSet();
+$oranges->setLabel('My second dataset')
+ ->setBackgroundColor('rgba( 255, 153, 0, .5 )')
+ ->data()->exchangeArray([
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ]);
+$bubble->addDataSet($oranges);
+
+?>
+
+
+
+ Bubble
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/disableAspectRatio.php b/pandora_console/vendor/artica/phpchartjs/test/example/disableAspectRatio.php
new file mode 100644
index 0000000000..14af2f0392
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/disableAspectRatio.php
@@ -0,0 +1,57 @@
+create($factory::BUBBLE);
+
+// Set labels
+$bubble->labels()->exchangeArray(["M", "T", "W", "T", "F", "S", "S"]);
+
+// Add Datasets
+$apples = $bubble->createDataSet();
+$apples->setLabel('My first dataset')
+ ->setBackgroundColor('rgba( 0, 150, 0, .5 )')
+ ->data()->exchangeArray([
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ]);
+$bubble->addDataSet($apples);
+
+$oranges = $bubble->createDataSet();
+$oranges->setLabel('My second dataset')
+ ->setBackgroundColor('rgba( 255, 153, 0, .5 )')
+ ->data()->exchangeArray([
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ['x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50)],
+ ]);
+$bubble->addDataSet($oranges);
+
+$bubble->options()->setMaintainAspectRatio(false);
+$bubble->setHeight(250);
+
+?>
+
+
+
+ Disable aspect ratio
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/doughnut.php b/pandora_console/vendor/artica/phpchartjs/test/example/doughnut.php
new file mode 100644
index 0000000000..3c708eca58
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/doughnut.php
@@ -0,0 +1,57 @@
+create($factory::DOUGHNUT);
+
+// Set labels
+$doughnut->labels()->exchangeArray([
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ "Sunday",
+]);
+
+// Add Datasets
+$apples = $doughnut->createDataSet();
+$apples->setLabel('apples')
+ ->setBackgroundColor($colors)
+ ->data()->exchangeArray([12, 19, 3, 17, 28, 24, 7,]);
+$doughnut->addDataSet($apples);
+
+$oranges = $doughnut->createDataSet();
+$oranges->setLabel('oranges')
+ ->setBackgroundColor($colors)
+ ->data()->exchangeArray([30, 29, 5, 5, 20, 3, 10,]);
+$doughnut->addDataSet($oranges);
+
+?>
+
+
+
+ Doughnut
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/halfDoughnut.php b/pandora_console/vendor/artica/phpchartjs/test/example/halfDoughnut.php
new file mode 100644
index 0000000000..df33165511
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/halfDoughnut.php
@@ -0,0 +1,63 @@
+create($factory::DOUGHNUT);
+/** @var \Artica\PHPChartJS\Options\PieOptions $options */
+$options = $doughnut->options();
+$options->setCutoutPercentage(50)
+ ->setCircumference(pi())
+ ->setRotation(pi())
+ ->getAnimation()->setDuration(1);
+
+// Set labels
+$doughnut->labels()->exchangeArray([
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ "Sunday",
+]);
+
+// Add Datasets
+$apples = $doughnut->createDataSet();
+$apples->setLabel('apples')
+ ->setBackgroundColor($colors)
+ ->data()->exchangeArray([12, 19, 3, 17, 28, 24, 7,]);
+$doughnut->addDataSet($apples);
+
+$oranges = $doughnut->createDataSet();
+$oranges->setLabel('oranges')
+ ->setBackgroundColor($colors)
+ ->data()->exchangeArray([30, 29, 5, 5, 20, 3, 10,]);
+$doughnut->addDataSet($oranges);
+
+?>
+
+
+
+ Half doughnut
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/hidden.php b/pandora_console/vendor/artica/phpchartjs/test/example/hidden.php
new file mode 100644
index 0000000000..f4ca8d436c
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/hidden.php
@@ -0,0 +1,41 @@
+setId('myChart');
+
+// Set labels
+$bar->labels()->exchangeArray(["M", "T", "W", "T", "F", "S", "S"]);
+
+// Add Datasets
+$apples = $bar->createDataSet();
+
+$apples->setLabel("apples")
+ ->setBackgroundColor("rgba( 0, 150, 0, .5 )")
+ ->data()->exchangeArray([12, 19, 3, 17, 28, 24, 7]);
+$bar->addDataSet($apples);
+
+$oranges = $bar->createDataSet();
+$oranges->setLabel("oranges")
+ ->setBackgroundColor('rgba( 255, 153, 0, .5 )')
+ ->data()->exchangeArray([30, 29, 5, 5, 20, 3, 10]);
+$oranges->setHidden(true);
+$bar->addDataSet($oranges);
+
+?>
+
+
+
+ Bar
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/horizontalBar.php b/pandora_console/vendor/artica/phpchartjs/test/example/horizontalBar.php
new file mode 100644
index 0000000000..94afd655e7
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/horizontalBar.php
@@ -0,0 +1,44 @@
+create($factory::HORIZONTAL_BAR);
+
+// Set labels
+$bar->labels()->exchangeArray(["M", "T", "W", "T", "F", "S", "S"]);
+
+// Add Datasets
+$apples = $bar->createDataSet();
+$apples->setLabel('apples')
+ ->setBackgroundColor('rgba( 0, 150, 0, .5 )')
+ ->data()->exchangeArray([12, 19, 3, 17, 28, 24, 7]);
+$bar->addDataSet($apples);
+
+$oranges = $bar->createDataSet();
+$oranges->setLabel('oranges')
+ ->setBackgroundColor('rgba( 255, 153, 0, .5 )')
+ ->data()->exchangeArray([30, 29, 5, 5, 20, 3, 10]);
+$bar->addDataSet($oranges);
+
+$scales = $bar->options()->getScales();
+$scales->getXAxes()->append($scales->createXAxis()->setStacked(true));
+$scales->getYAxes()->append($scales->createYAxis()->setStacked(true));
+
+?>
+
+
+
+ Horizontal bar
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/index.html b/pandora_console/vendor/artica/phpchartjs/test/example/index.html
new file mode 100644
index 0000000000..9b5a69d186
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/index.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+ Articaam/phpchartjs - examples
+
+
+
+
+
+
Articaam/phpchartjs - examples
+
+
+
+
+
+
+
+
+
Other graphs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/line.php b/pandora_console/vendor/artica/phpchartjs/test/example/line.php
new file mode 100644
index 0000000000..7c8f0571b2
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/line.php
@@ -0,0 +1,71 @@
+create($factory::LINE);
+
+// Set labels
+$line->labels()->exchangeArray(["January", "February", "March", "April", "May", "June", "July"]);
+
+// Add Datasets
+$dataSet = $line->createDataSet();
+$dataSet->setLabel('My First dataset')
+ ->setFill(false)
+ ->setLineTension(0.1)
+ ->setBackgroundColor('rgba(75,192,192,0.4)')
+ ->setBorderColor('rgba(75,192,192,1)')
+ ->setBorderCapStyle('butt')
+ ->setBorderDash([])
+ ->setBorderDashOffset(0.0)
+ ->setBorderJoinStyle('miter')
+ ->setPointBorderColor('rgba(75,192,192,1)')
+ ->setPointBackgroundColor('#fff')
+ ->setPointBorderWidth(1)
+ ->setPointHoverRadius(5)
+ ->setPointHoverBackgroundColor('rgba(75,192,192,1)')
+ ->setPointHoverBorderColor('rgba(220,220,220,1)')
+ ->setPointHoverBorderWidth(2)
+ ->setPointRadius(1)
+ ->setPointHitRadius(10)
+ ->setSpanGaps(false)
+ ->data()->exchangeArray([65, 59, 80, 81, 56, 55, 40]);
+$line->addDataSet($dataSet);
+
+// Set mode to stacked
+$scales = $line->options()->getScales();
+$scales->getYAxes()->append($scales->createYAxis()->setStacked(true))
+ ->append($scales->createYAxis()->setPosition('right')->setId('y2'));
+
+// Add even more data
+$apples = $line->createDataSet();
+$apples->setLabel('apples')
+ ->setYAxisID('y2')
+ ->setBackgroundColor('rgba( 0, 150, 0, .5 )')
+ ->data()->exchangeArray([12, 19, 3, 17, 28, 24, 7]);
+$line->addDataSet($apples);
+
+$oranges = $line->createDataSet();
+$oranges->setLabel('oranges')
+ ->setYAxisID('y2')
+ ->setBackgroundColor('rgba( 255, 153, 0, .5 )')
+ ->data()->exchangeArray([30, 29, 5, 5, 20, 3, 10]);
+$line->addDataSet($oranges);
+
+?>
+
+
+
+ Line
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/lineScatter.php b/pandora_console/vendor/artica/phpchartjs/test/example/lineScatter.php
new file mode 100644
index 0000000000..ae9dfdebba
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/lineScatter.php
@@ -0,0 +1,40 @@
+create($factory::LINE);
+
+// Add Datasets
+$dataSet = $line->createDataSet();
+$dataSet->setLabel('Scatter Dataset')->data()->exchangeArray([
+ ['x' => -10, 'y' => 0],
+ ['x' => 0, 'y' => 10],
+ ['x' => 10, 'y' => 5],
+]);
+$line->addDataSet($dataSet);
+
+$scales = $line->options()->getScales();
+$xAxis = $scales->createXAxis();
+$xAxis->setType('linear')
+ ->setPosition('bottom');
+
+$scales->getXAxes()->append($xAxis);
+
+?>
+
+
+
+ Line scatter
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/onClick.php b/pandora_console/vendor/artica/phpchartjs/test/example/onClick.php
new file mode 100644
index 0000000000..060a0818d5
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/onClick.php
@@ -0,0 +1,49 @@
+setId('myChart');
+
+// Set labels
+$bar->labels()->exchangeArray(["M", "T", "W", "T", "F", "S", "S"]);
+
+// Add Datasets
+$apples = $bar->createDataSet();
+
+$apples->setLabel("apples")
+ ->setBackgroundColor("rgba( 0, 150, 0, .5 )")
+ ->data()->exchangeArray([12, 19, 3, 17, 28, 24, 7]);
+$bar->addDataSet($apples);
+
+$oranges = $bar->createDataSet();
+$oranges->setLabel("oranges")
+ ->setBackgroundColor('rgba( 255, 153, 0, .5 )')
+ ->data()->exchangeArray([30, 29, 5, 5, 20, 3, 10]);
+$bar->addDataSet($oranges);
+$bar->options()->setOnClick('myClickEvent');
+?>
+
+
+
+ onClick
+
+
+
+render();
+?>
+
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/pie.php b/pandora_console/vendor/artica/phpchartjs/test/example/pie.php
new file mode 100644
index 0000000000..4d69523455
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/pie.php
@@ -0,0 +1,52 @@
+create($factory::PIE);
+
+// Set labels
+$pie->labels()->exchangeArray([
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ "Sunday",
+]);
+
+// Add Datasets
+$apples = $pie->createDataSet();
+$apples->setLabel('My First dataset')
+ ->setBackgroundColor($colors)
+ ->data()->exchangeArray([165, 59, 80, 81, 56, 55, 40]);
+$pie->addDataSet($apples);
+
+?>
+
+
+
+ Pie
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/polarArea.php b/pandora_console/vendor/artica/phpchartjs/test/example/polarArea.php
new file mode 100644
index 0000000000..5ff22379e5
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/polarArea.php
@@ -0,0 +1,35 @@
+create($factory::POLAR_AREA);
+
+// Set labels
+$polarArea->labels()->exchangeArray(["Red", "Green", "Yellow", "Grey", "Blue"]);
+
+// Add Datasets
+$dataSet = $polarArea->createDataSet();
+$dataSet->setLabel('My dataset')
+ ->setBackgroundColor($colors)
+ ->data()->exchangeArray([11, 16, 7, 3, 14]);
+$polarArea->addDataSet($dataSet);
+
+?>
+
+
+
+ Polar area
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/radar.php b/pandora_console/vendor/artica/phpchartjs/test/example/radar.php
new file mode 100644
index 0000000000..c6b27766de
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/radar.php
@@ -0,0 +1,58 @@
+create($factory::RADAR);
+
+// Set labels
+$radar->labels()->exchangeArray([
+ "Eating",
+ "Drinking",
+ "Sleeping",
+ "Designing",
+ "Coding",
+ "Cycling",
+ "Running",
+]);
+
+// Add Datasets
+$dataSet1 = $radar->createDataSet();
+$dataSet1->setLabel('My first dataset')
+ ->setBackgroundColor('rgba(179,181,198,0.2)')
+ ->setBorderColor('rgba(179,181,198,1)')
+ ->setPointBackgroundColor('rgba(179,181,198,1)')
+ ->setPointBorderColor('#fff')
+ ->setPointHoverBackgroundColor('#fff')
+ ->setPointHoverBorderColor('rgba(179,181,198,1)')
+ ->data()->exchangeArray([65, 59, 90, 81, 56, 55, 40]);
+$radar->addDataSet($dataSet1);
+
+$dataSet2 = $radar->createDataSet();
+$dataSet2->setLabel('My second dataset')
+ ->setBackgroundColor('rgba(255,99,132,0.2)')
+ ->setBorderColor('rgba(255,99,132,1)')
+ ->setPointBackgroundColor('rgba(255,99,132,1)')
+ ->setPointBorderColor('#fff')
+ ->setPointHoverBackgroundColor('#fff')
+ ->setPointHoverBorderColor('rgba(255,99,132,1)')
+ ->data()->exchangeArray([28, 48, 40, 19, 96, 27, 100]);
+$radar->addDataSet($dataSet2);
+
+?>
+
+
+
+ Radar
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/example/scatter.php b/pandora_console/vendor/artica/phpchartjs/test/example/scatter.php
new file mode 100644
index 0000000000..6d1a9ff0e5
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/example/scatter.php
@@ -0,0 +1,69 @@
+create($factory::SCATTER);
+$scatter->setTitle('Scatter chart');
+
+/** @var ScatterOptions $options */
+$options = $scatter->options();
+$xAxis = $options->getScales()->createXAxis();
+$xAxis->ticks()->setStepSize(1);
+$yAxis = $options->getScales()->createYAxis();
+
+$options->getScales()->getXAxes()->append($xAxis);
+$options->getScales()->getYAxes()->append($yAxis);
+
+// Set labels
+$scatter->labels()->exchangeArray(["M", "T", "W", "T", "F", "S", "S"]);
+
+// Add Datasets
+$apples = $scatter->createDataSet();
+$apples->setLabel('My first dataset')
+ ->setBackgroundColor('rgba( 0, 150, 0, .5 )')
+ ->setPointStyle('rect')
+ ->setPointRadius(10);
+$apples->data()->exchangeArray([
+ ['x' => 0, 'y' => 0],
+ ['x' => 0, 'y' => 1],
+ ['x' => 0, 'y' => 2],
+ ['x' => 0, 'y' => 3],
+ ['x' => 0, 'y' => 4],
+ ['x' => 0, 'y' => 5],
+ ['x' => 0, 'y' => 6],
+]);
+$scatter->addDataSet($apples);
+
+$oranges = $scatter->createDataSet();
+$oranges->setLabel('My second dataset')
+ ->setBackgroundColor('rgba( 255, 153, 0, .5 )');
+$oranges->data()->exchangeArray([
+ ['x' => 1, 'y' => 0],
+ ['x' => 1, 'y' => 1],
+ ['x' => 1, 'y' => 2],
+ ['x' => 1, 'y' => 3],
+ ['x' => 1, 'y' => 4],
+ ['x' => 1, 'y' => 5],
+ ['x' => 1, 'y' => 6],
+]);
+$scatter->addDataSet($oranges);
+
+?>
+
+
+
+ Scatter
+
+
+
+render();
+?>
+
+
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/BarTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/BarTest.php
new file mode 100644
index 0000000000..0c1382f2f5
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/BarTest.php
@@ -0,0 +1,56 @@
+assertInstanceOf(ChartInterface::class, $bar, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Bar::class, $bar, 'The correct class has been created');
+ }
+
+ /**
+ * Test the DataSet created by the Bar chart
+ */
+ public function testDataSet()
+ {
+ $bar = new Bar();
+ $chartData = [ 0, 1, 4, 2, 3, 0, 5, 2, 6 ];
+
+ // DataSet
+ $dataSet = $bar->createDataSet();
+ $this->assertInstanceOf(BarDataSet::class, $dataSet, 'The correct class has been created by the chart');
+
+ // Populate the collection
+ $dataSet->data()->exchangeArray($chartData);
+
+ // Check if data is still correct.
+ $bar->addDataSet($dataSet);
+ $this->assertEquals($chartData, $bar->dataSets()->offsetGet(0)->data()->getArrayCopy());
+ }
+
+ /**
+ *
+ */
+ public function testOptions()
+ {
+ $bar = new Bar();
+ $this->assertInstanceOf(BarOptions::class, $bar->options(), 'The correct class should be created');
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/BubbleTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/BubbleTest.php
new file mode 100644
index 0000000000..40a27148ad
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/BubbleTest.php
@@ -0,0 +1,63 @@
+assertInstanceOf(ChartInterface::class, $bubble, 'The correct interface should be implemented');
+ $this->assertInstanceOf(Bubble::class, $bubble, 'The correct class should be created');
+ }
+
+ /**
+ * Test the DataSet created by the Bar chart
+ */
+ public function testDataSet()
+ {
+ $bubble = new Bubble();
+ $chartData = [
+ [ 'x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50) ],
+ [ 'x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50) ],
+ [ 'x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50) ],
+ [ 'x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50) ],
+ [ 'x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50) ],
+ [ 'x' => rand(0, 40), 'y' => rand(0, 30), 'r' => rand(0, 50) ],
+ ];
+
+ // DataSet
+ $dataSet = $bubble->createDataSet();
+ $this->assertInstanceOf(BubbleDataSet::class, $dataSet, 'The correct class should be created by the chart');
+
+ // Populate the collection
+ $dataSet->data()->exchangeArray($chartData);
+
+ // Check if data is still correct.
+ $bubble->addDataSet($dataSet);
+ $this->assertEquals($chartData, $bubble->dataSets()->offsetGet(0)->data()->getArrayCopy());
+ }
+
+ /**
+ *
+ */
+ public function testOptions()
+ {
+ $bar = new Bubble();
+ $this->assertInstanceOf(BubbleOptions::class, $bar->options(), 'The correct class should be created');
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/DoughnutTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/DoughnutTest.php
new file mode 100644
index 0000000000..7d243e3e16
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/DoughnutTest.php
@@ -0,0 +1,56 @@
+assertInstanceOf(ChartInterface::class, $doughnut, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Doughnut::class, $doughnut, 'The correct class has been created');
+ }
+
+ /**
+ * Test the DataSet created by the Doughnut chart
+ */
+ public function testDataSet()
+ {
+ $Doughnut = new Doughnut();
+ $chartData = [ 0, 1, 4, 2, 3, 0, 5, 2, 6 ];
+
+ // DataSet
+ $dataSet = $Doughnut->createDataSet();
+ $this->assertInstanceOf(PieDataSet::class, $dataSet, 'The correct class has been created by the chart');
+
+ // Populate the collection
+ $dataSet->data()->exchangeArray($chartData);
+
+ // Check if data is still correct.
+ $Doughnut->addDataSet($dataSet);
+ $this->assertEquals($chartData, $Doughnut->dataSets()->offsetGet(0)->data()->getArrayCopy());
+ }
+
+ /**
+ *
+ */
+ public function testOptions()
+ {
+ $Doughnut = new Doughnut();
+ $this->assertInstanceOf(PieOptions::class, $Doughnut->options(), 'The correct class should be created');
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/LineTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/LineTest.php
new file mode 100644
index 0000000000..e023e784d2
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/LineTest.php
@@ -0,0 +1,56 @@
+assertInstanceOf(ChartInterface::class, $Line, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Line::class, $Line, 'The correct class has been created');
+ }
+
+ /**
+ * Test the DataSet created by the Line chart
+ */
+ public function testDataSet()
+ {
+ $Line = new Line();
+ $chartData = [ 0, 1, 4, 2, 3, 0, 5, 2, 6 ];
+
+ // DataSet
+ $dataSet = $Line->createDataSet();
+ $this->assertInstanceOf(LineDataSet::class, $dataSet, 'The correct class has been created by the chart');
+
+ // Populate the collection
+ $dataSet->data()->exchangeArray($chartData);
+
+ // Check if data is still correct.
+ $Line->addDataSet($dataSet);
+ $this->assertEquals($chartData, $Line->dataSets()->offsetGet(0)->data()->getArrayCopy());
+ }
+
+ /**
+ *
+ */
+ public function testOptions()
+ {
+ $Line = new Line();
+ $this->assertInstanceOf(LineOptions::class, $Line->options(), 'The correct class should be created');
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/PieTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/PieTest.php
new file mode 100644
index 0000000000..e6a7be9346
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/PieTest.php
@@ -0,0 +1,56 @@
+assertInstanceOf(ChartInterface::class, $Pie, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Pie::class, $Pie, 'The correct class has been created');
+ }
+
+ /**
+ * Test the DataSet created by the Pie chart
+ */
+ public function testDataSet()
+ {
+ $Pie = new Pie();
+ $chartData = [ 0, 1, 4, 2, 3, 0, 5, 2, 6 ];
+
+ // DataSet
+ $dataSet = $Pie->createDataSet();
+ $this->assertInstanceOf(PieDataSet::class, $dataSet, 'The correct class has been created by the chart');
+
+ // Populate the collection
+ $dataSet->data()->exchangeArray($chartData);
+
+ // Check if data is still correct.
+ $Pie->addDataSet($dataSet);
+ $this->assertEquals($chartData, $Pie->dataSets()->offsetGet(0)->data()->getArrayCopy());
+ }
+
+ /**
+ *
+ */
+ public function testOptions()
+ {
+ $Pie = new Pie();
+ $this->assertInstanceOf(PieOptions::class, $Pie->options(), 'The correct class should be created');
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/PolarAreaTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/PolarAreaTest.php
new file mode 100644
index 0000000000..0b359babd2
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/PolarAreaTest.php
@@ -0,0 +1,60 @@
+assertInstanceOf(ChartInterface::class, $PolarArea, 'The correct interface has been implemented');
+ $this->assertInstanceOf(PolarArea::class, $PolarArea, 'The correct class has been created');
+ }
+
+ /**
+ * Test the DataSet created by the PolarArea chart
+ */
+ public function testDataSet()
+ {
+ $PolarArea = new PolarArea();
+ $chartData = [ 0, 1, 4, 2, 3, 0, 5, 2, 6 ];
+
+ // DataSet
+ $dataSet = $PolarArea->createDataSet();
+ $this->assertInstanceOf(PolarAreaDataSet::class, $dataSet, 'The correct class has been created by the chart');
+
+ // Populate the collection
+ $dataSet->data()->exchangeArray($chartData);
+
+ // Check if data is still correct.
+ $PolarArea->addDataSet($dataSet);
+ $this->assertEquals($chartData, $PolarArea->dataSets()->offsetGet(0)->data()->getArrayCopy());
+ }
+
+ /**
+ *
+ */
+ public function testOptions()
+ {
+ $PolarArea = new PolarArea();
+ $this->assertInstanceOf(
+ PolarAreaOptions::class,
+ $PolarArea->options(),
+ 'The correct class should be created'
+ );
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/RadarTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/RadarTest.php
new file mode 100644
index 0000000000..691f43d1f7
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/RadarTest.php
@@ -0,0 +1,56 @@
+assertInstanceOf(ChartInterface::class, $Radar, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Radar::class, $Radar, 'The correct class has been created');
+ }
+
+ /**
+ * Test the DataSet created by the Radar chart
+ */
+ public function testDataSet()
+ {
+ $Radar = new Radar();
+ $chartData = [ 0, 1, 4, 2, 3, 0, 5, 2, 6 ];
+
+ // DataSet
+ $dataSet = $Radar->createDataSet();
+ $this->assertInstanceOf(RadarDataSet::class, $dataSet, 'The correct class has been created by the chart');
+
+ // Populate the collection
+ $dataSet->data()->exchangeArray($chartData);
+
+ // Check if data is still correct.
+ $Radar->addDataSet($dataSet);
+ $this->assertEquals($chartData, $Radar->dataSets()->offsetGet(0)->data()->getArrayCopy());
+ }
+
+ /**
+ *
+ */
+ public function testOptions()
+ {
+ $Radar = new Radar();
+ $this->assertInstanceOf(RadarOptions::class, $Radar->options(), 'The correct class should be created');
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/ScatterTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/ScatterTest.php
new file mode 100644
index 0000000000..2c60fd5dfb
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Chart/ScatterTest.php
@@ -0,0 +1,57 @@
+assertInstanceOf(ChartInterface::class, $scatter, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Scatter::class, $scatter, 'The correct class has been created');
+ }
+
+ /**
+ * Test the DataSet created by the Scatter chart
+ */
+ public function testDataSet()
+ {
+ $scatter = new Scatter();
+ $chartData = [0, 1, 4, 2, 3, 0, 5, 2, 6];
+
+ // DataSet
+ $dataSet = $scatter->createDataSet();
+ $this->assertInstanceOf(ScatterDataSet::class, $dataSet, 'The correct class has been created by the chart');
+
+ // Populate the collection
+ $dataSet->data()->exchangeArray($chartData);
+
+ // Check if data is still correct.
+ $scatter->addDataSet($dataSet);
+ $this->assertEquals($chartData, $scatter->dataSets()->offsetGet(0)->data()->getArrayCopy());
+ }
+
+ /**
+ *
+ */
+ public function testOptions()
+ {
+ $scatter = new Scatter();
+ $this->assertInstanceOf(ScatterOptions::class, $scatter->options(), 'The correct class should be created');
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/ChartOwnedTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/ChartOwnedTest.php
new file mode 100644
index 0000000000..39768def31
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/ChartOwnedTest.php
@@ -0,0 +1,41 @@
+assertNull($options->owner(), 'Owner should be empty');
+
+ $this->assertSame($options, $options->setOwner($bar = new Bar()));
+ $this->assertSame($bar, $options->owner());
+ }
+
+ /**
+ *
+ */
+ public function testOwnerFromChart()
+ {
+ $bar = new Bar();
+ $this->assertInstanceOf(ChartOwnedInterface::class, $bar->options());
+ $this->assertSame($bar, $bar->options()->owner());
+
+ $this->assertInstanceOf(ChartOwnedInterface::class, $dataSet = $bar->createDataSet());
+ $this->assertSame($dataSet->owner(), $bar);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/ChartTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/ChartTest.php
new file mode 100644
index 0000000000..acf6fbf0c5
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/ChartTest.php
@@ -0,0 +1,318 @@
+ 'height',
+ // int
+ 'width' => 'width',
+ // int
+ 'title' => 'title',
+ // string
+ 'labels' => 'labels',
+ // LabelsCollection
+ 'options' => 'options',
+ // Options
+ 'dataSets' => 'dataSets',
+ // DataSetCollection
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'height' => null,
+ // int
+ 'width' => null,
+ // int
+ 'title' => null,
+ // string
+ ];
+
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->chart = new Bar();
+ }
+
+
+ /**
+ *
+ */
+ public function testGetId()
+ {
+ $result = $this->chart->getId();
+ self::assertNotNull($result);
+ }
+
+
+ /**
+ *
+ */
+ public function testSetId()
+ {
+ $expected = '1203';
+ $this->chart->setId($expected);
+ self::assertSame($expected, $this->chart->getId());
+ }
+
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->chart, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testHeight()
+ {
+ $expected = 15;
+ $this->chart->setHeight($expected);
+ $result = $this->chart->getHeight();
+ self::assertSame($expected, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testWidth()
+ {
+ $expected = 17;
+ $this->chart->setWidth($expected);
+ $result = $this->chart->getWidth();
+ self::assertSame($expected, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testTitle()
+ {
+ $expected = 'no title';
+ $this->chart->setTitle($expected);
+ $result = $this->chart->getTitle();
+ self::assertSame($expected, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testLabels()
+ {
+ $result = $this->chart->labels();
+ self::assertInstanceOf(LabelsCollection::class, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testLabelsAdd()
+ {
+ $labels = new LabelsCollection();
+ $label = 'no label at all';
+ $labels->append($label);
+ $result = $this->chart->addLabel($label)->labels();
+ self::assertNotSame($labels, $result);
+ self::assertEquals($labels, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testGetLabelValid()
+ {
+ $labels = new LabelsCollection();
+ $label = 'no label at all';
+ $labels->append($label);
+ $this->chart->addLabel($label)->labels();
+ $result = $this->chart->getLabel(0);
+ self::assertSame($label, $result);
+ $result1 = $this->chart->getLabel(1);
+ self::assertNull($result1);
+ }
+
+
+ /**
+ *
+ */
+ public function testGetLabelInValid()
+ {
+ $labels = new LabelsCollection();
+ $label = 'only 1 label';
+ $labels->append($label);
+ $this->chart->addLabel($label)->labels();
+ $result1 = $this->chart->getLabel(1);
+ self::assertNull($result1);
+ }
+
+
+ /**
+ *
+ */
+ public function testDataSets()
+ {
+ $expected = new DataSetCollection();
+ $result = $this->chart->dataSets();
+ self::assertNotSame($expected, $result);
+ self::assertEquals($expected, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testAddDataSet()
+ {
+ $expected = new DataSetCollection();
+ $dataSet1 = new DataSet();
+ $expected->append($dataSet1);
+ $dataSet1->setOwner($this->chart);
+ $dataSet2 = new DataSet();
+ $this->chart->addDataSet($dataSet2);
+ self::assertEquals($dataSet1, $dataSet2);
+ }
+
+
+ /**
+ *
+ */
+ public function testGetDataSetEmpty()
+ {
+ $result = $this->chart->getDataSet(0);
+ self::assertNull($result);
+ }
+
+
+ /**
+ *
+ */
+ public function testGetDataSet()
+ {
+ $dataSet = new DataSet();
+ $this->chart->addDataSet($dataSet);
+ $result = $this->chart->getDataSet(0);
+ self::assertSame($dataSet, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testRenderCanvas()
+ {
+ $chartHtml = ''.$this->chart->render().'
';
+ $htmlDoc = new DOMDocument();
+ $htmlDoc->loadXML($chartHtml);
+ $canvas = $htmlDoc->getElementsByTagName('canvas')->item(0);
+ $result = $canvas->getAttribute('id');
+ self::assertStringStartsWith('chart', $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testRenderHeight()
+ {
+ $expected = '500';
+ $this->chart->setHeight($expected);
+ $chartHtml = ''.$this->chart->render(true).'
';
+ $htmlDoc = new DOMDocument();
+ $htmlDoc->loadXML($chartHtml);
+ $canvas = $htmlDoc->getElementsByTagName('canvas')->item(0);
+ $result = $canvas->getAttribute('height');
+ self::assertSame($expected, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testRenderWidth()
+ {
+ $expected = '500';
+ $this->chart->setWidth($expected);
+ $chartHtml = ''.$this->chart->render(true).'
';
+ $htmlDoc = new DOMDocument();
+ $htmlDoc->loadXML($chartHtml);
+ $canvas = $htmlDoc->getElementsByTagName('canvas')->item(0);
+ $result = $canvas->getAttribute('width');
+ self::assertSame($expected, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testRenderScript()
+ {
+ $chartHtml = ''.$this->chart->render(true).'
';
+ $htmlDoc = new DOMDocument();
+ $htmlDoc->loadXML($chartHtml);
+ $script = $htmlDoc->getElementsByTagName('script')->item(0);
+ self::assertNotEmpty($script->nodeValue);
+ }
+
+
+ /**
+ *
+ */
+ public function testCreateDataSet()
+ {
+ $result = $this->chart->createDataSet();
+ self::assertInstanceOf(BarDataSet::class, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testOptions()
+ {
+ $result = $this->chart->options();
+ self::assertInstanceOf(BarOptions::class, $result);
+ }
+
+
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Collection/DataTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Collection/DataTest.php
new file mode 100644
index 0000000000..6245bb44a2
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Collection/DataTest.php
@@ -0,0 +1,42 @@
+data = new Data();
+ }
+
+
+ /**
+ *
+ */
+ public function testJsonSerializeEmpty()
+ {
+ $expected = [];
+ $result = $this->data->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+
+
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/ConfigDefaults/GlobalConfigTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/ConfigDefaults/GlobalConfigTest.php
new file mode 100644
index 0000000000..bc40fabff8
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/ConfigDefaults/GlobalConfigTest.php
@@ -0,0 +1,127 @@
+ '',
+ 'defaultFontFamily' => '',
+ 'defaultFontSize' => 1,
+ 'defaultFontStyle' => '',
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data = [
+ 'defaultFontColor' => 'defaultFontColor',
+ 'defaultFontFamily' => 'defaultFontFamily',
+ 'defaultFontSize' => 2,
+ 'defaultFontStyle' => 'defaultFontStyle',
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'defaultFontColor' => null,
+ 'defaultFontFamily' => null,
+ 'defaultFontSize' => null,
+ 'defaultFontStyle' => null,
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->config = GlobalConfig::getInstance();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $result = TestUtils::getAttributes($this->config, $this->data_types);
+ $expected = $this->empty_data;
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSet()
+ {
+ TestUtils::setAttributes($this->config, $this->input_data);
+ $result = TestUtils::getAttributes($this->config, $this->data_types);
+ $expected = $this->input_data;
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testLayout()
+ {
+ $result = $this->config->layout();
+ self::assertInstanceOf(LayoutConfig::class, $result);
+ }
+
+ /**
+ *
+ */
+ public function testTooltips()
+ {
+ $result = $this->config->tooltips();
+ self::assertInstanceOf(TooltipsConfig::class, $result);
+ }
+
+ /**
+ *
+ */
+ public function testHover()
+ {
+ $result = $this->config->hover();
+ self::assertInstanceOf(HoverConfig::class, $result);
+ }
+
+ /**
+ *
+ */
+ public function testAnimation()
+ {
+ $result = $this->config->animation();
+ self::assertInstanceOf(AnimationConfig::class, $result);
+ }
+
+ /**
+ *
+ */
+ public function testElements()
+ {
+ $result = $this->config->elements();
+ self::assertInstanceOf(ElementsConfig::class, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/DataSetCollectionTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/DataSetCollectionTest.php
new file mode 100644
index 0000000000..5d5252c333
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/DataSetCollectionTest.php
@@ -0,0 +1,66 @@
+dataSetCollection = new DataSetCollection();
+ }
+
+ /**
+ *
+ */
+ public function testGetArrayCopyEmpty()
+ {
+ $expected = [];
+ $result = $this->dataSetCollection->getArrayCopy();
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetArrayCopyNonEmpty()
+ {
+ $expected = [[]];
+ $this->dataSetCollection->append(new DataSet());
+ $result = $this->dataSetCollection->getArrayCopy();
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializeEmpty()
+ {
+ $expected = [];
+ $result = $this->dataSetCollection->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializeNonEmpty()
+ {
+ $expected = [[]];
+ $this->dataSetCollection->append(new DataSet());
+ $result = $this->dataSetCollection->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/DataSetTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/DataSetTest.php
new file mode 100644
index 0000000000..906259448c
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/DataSetTest.php
@@ -0,0 +1,285 @@
+assertInstanceOf(ChartOwnedInterface::class, $dataSet, 'Class implements ChartOwnedInterface');
+ $this->assertInstanceOf(
+ ArraySerializableInterface::class,
+ $dataSet,
+ 'Class implements ArraySerializableInterface'
+ );
+ $this->assertInstanceOf(JsonSerializable::class, $dataSet, 'Class implements JsonSerializable');
+ }
+
+ /**
+ *
+ */
+ public function testOwner()
+ {
+ $dataSet = new DataSet();
+
+ $this->assertNull($dataSet->owner(), 'The dataset has no owner');
+
+ $chart = new Bar();
+ $chart->addDataSet($dataSet);
+
+ $this->assertEquals($chart, $dataSet->owner(), 'The owner of the dataSet is set and returned correctly');
+ $this->assertInstanceOf(
+ ChartInterface::class,
+ $dataSet->owner(),
+ 'The owner of the dataSet implements the correct interface'
+ );
+ }
+
+ /**
+ *
+ */
+ public function testType()
+ {
+ $dataSet = new DataSet();
+
+ $this->assertNull($dataSet->getType(), 'The type is not set');
+
+ $dataSet->setType(Bar::TYPE);
+ $this->assertEquals(Bar::TYPE, $dataSet->getType(), 'The type is set and returned correctly');
+ }
+
+ /**
+ *
+ */
+ public function testData()
+ {
+ $dataSet = new DataSet();
+
+ $dataCollection = $dataSet->data();
+ $this->assertInstanceOf(Data::class, $dataCollection, 'The data collection is the right class');
+ $this->assertInstanceOf(ArrayAccess::class, $dataCollection, 'The data collection extends Collection');
+ $this->assertInstanceOf(
+ JsonSerializable::class,
+ $dataCollection,
+ 'The data collection implements JsonSerializable'
+ );
+ }
+
+ /**
+ *
+ */
+ public function testLabel()
+ {
+ $dataSet = new DataSet();
+
+ $this->assertNull($dataSet->getLabel(), 'The label should not be set');
+
+ $dataSet->setLabel('Foo');
+ $this->assertEquals('Foo', $dataSet->getLabel(), 'The label should have been set correctly');
+ }
+
+ /**
+ *
+ */
+ public function testBackgroundColor()
+ {
+ $dataSet = new DataSet();
+
+ $this->assertNull($dataSet->getBackgroundColor(), 'The background color is not set');
+
+ $dataSet->setBackgroundColor('#fff');
+ $this->assertEquals('#fff', $dataSet->getBackgroundColor());
+
+ $backgroundColorArray = ['#fff', 'rgb( 255, 255, 255 )', 'rgba( 255, 255, 255, .5 )', 'white'];
+ $dataSet->setBackgroundColor($backgroundColorArray);
+ $this->assertEquals(
+ $backgroundColorArray,
+ $dataSet->getBackgroundColor(),
+ 'The background color is set again and returned correctly'
+ );
+ }
+
+ /**
+ *
+ */
+ public function testBorderColor()
+ {
+ $dataSet = new DataSet();
+
+ $this->assertNull($dataSet->getBorderColor(), 'The border color is not set');
+
+ $dataSet->setBorderColor('#fff');
+ $this->assertEquals('#fff', $dataSet->getBorderColor(), 'The border color is set and returned correctly');
+
+ $borderColorArray = ['#fff', 'rgb( 255, 255, 255 )', 'rgba( 255, 255, 255, .5 )', 'white'];
+ $dataSet->setBorderColor($borderColorArray);
+ $this->assertEquals(
+ $borderColorArray,
+ $dataSet->getBorderColor(),
+ 'The border color is set again and returned correctly'
+ );
+ }
+
+ /**
+ * Test setting and getting the border width.
+ */
+ public function testBorderWidth()
+ {
+ $dataSet = new DataSet();
+ $this->assertNull($dataSet->getBorderWidth(), 'The border width is not set');
+
+ $this->assertEquals(
+ $dataSet,
+ $dataSet->setBorderWidth(10),
+ 'Setting the border width should return the DataSet instance'
+ );
+ $this->assertTrue(is_int($dataSet->getBorderWidth()), 'Return type should be int');
+ $this->assertEquals(10, $dataSet->getBorderWidth(), 'The border width should equal int 10');
+
+ $dataSet->setBorderWidth('20');
+ $this->assertTrue(is_int($dataSet->getBorderWidth()), 'Return type should be int');
+ $this->assertEquals(20, $dataSet->getBorderWidth(), 'The border width should equal int 20');
+
+ $dataSet->setBorderWidth('30abc');
+ $this->assertTrue(is_int($dataSet->getBorderWidth()), 'Return type should be int');
+ $this->assertEquals(30, $dataSet->getBorderWidth(), 'The border width should equal int 30');
+
+ $dataSet->setBorderWidth(40.00);
+ $this->assertTrue(is_int($dataSet->getBorderWidth()), 'Return type should be int');
+ $this->assertEquals(40, $dataSet->getBorderWidth(), 'The border width should equal int 40');
+
+ $dataSet->setBorderWidth('abc50');
+ $this->assertTrue(is_int($dataSet->getBorderWidth()), 'Return type should be int');
+ $this->assertEquals(0, $dataSet->getBorderWidth(), 'The border width should equal int 0');
+
+ $dataSet->setBorderWidth([10, '20', '30abc', 40.00, 'abc50']);
+ $this->assertTrue(is_array($dataSet->getBorderWidth()), 'Return type should be array');
+ $this->assertEquals([10, 20, 30, 40, 0], $dataSet->getBorderWidth(), 'Return value should be array of int');
+ }
+
+ /**
+ *
+ */
+ public function testBorderSkipped()
+ {
+ $dataSet = new DataSet();
+
+ $this->assertNull($dataSet->getBorderSkipped(), 'The border skipped value is not set');
+
+ $this->assertInstanceOf(
+ DataSet::class,
+ $dataSet->setBorderSkipped('bottom'),
+ 'The correct class is returned'
+ );
+ $this->assertEquals('bottom', $dataSet->getBorderSkipped(), 'The correct value is returned');
+ }
+
+ /**
+ *
+ */
+ public function testAxes()
+ {
+ $dataSet = new DataSet();
+
+ $this->assertNull($dataSet->getXAxisID(), 'The xAxisID value should not be set');
+
+ $this->assertInstanceOf(DataSet::class, $dataSet->setXAxisID('myXAxis'));
+ $this->assertEquals('myXAxis', $dataSet->getXAxisID(), 'The correct value is returned');
+ $this->assertEquals('myXAxis', $dataSet->getArrayCopy()['xAxisID'], 'getArrayCopy is failing');
+ $this->assertEquals('myXAxis', $dataSet->jsonSerialize()['xAxisID'], 'Serialized data is not correct');
+
+ $this->assertNull($dataSet->getYAxisID(), 'The yAxisID value is not set');
+
+ $this->assertInstanceOf(DataSet::class, $dataSet->setYAxisID('myYAxis'));
+ $this->assertEquals('myYAxis', $dataSet->getYAxisID(), 'The correct value is not returned');
+ $this->assertEquals('myXAxis', $dataSet->jsonSerialize()['xAxisID'], 'Serialized data is not correct');
+ }
+
+ /**
+ *
+ */
+ public function testHoverBackgroundColor()
+ {
+ $dataSet = new DataSet();
+
+ $this->assertNull($dataSet->getHoverBackgroundColor(), 'The hoverBackgroundColor value is not set');
+
+ $this->assertInstanceOf(DataSet::class, $dataSet->setHoverBackgroundColor('#fff'));
+ $this->assertEquals('#fff', $dataSet->getHoverBackgroundColor(), 'The correct value is returned');
+
+ $newColors = ['silver', '#fff', 'rgb( 0, 0, 0 )', 'rgba( 255, 255, 255, .5 )'];
+ $dataSet->setHoverBackgroundColor($newColors);
+ $this->assertEquals($newColors, $dataSet->getHoverBackgroundColor(), 'The correct value is returned');
+ }
+
+ /**
+ *
+ */
+ public function testHoverBorderColor()
+ {
+ $dataSet = new DataSet();
+
+ $this->assertNull($dataSet->getHoverBorderColor(), 'The hoverBorderColor value is not set');
+
+ $this->assertInstanceOf(DataSet::class, $dataSet->setHoverBorderColor('#fff'));
+ $this->assertEquals('#fff', $dataSet->getHoverBorderColor(), 'The correct value is returned');
+
+ $dataSet->setHoverBorderColor(['silver', '#fff', 'rgb( 0, 0, 0 )', 'rgba( 255, 255, 255, .5 )', 0]);
+ $this->assertEquals(
+ ['silver', '#fff', 'rgb( 0, 0, 0 )', 'rgba( 255, 255, 255, .5 )', '0'],
+ $dataSet->getHoverBorderColor(),
+ 'The correct value is returned'
+ );
+ }
+
+ /**
+ *
+ */
+ public function testHoverBorderWidth()
+ {
+ $dataSet = new DataSet();
+
+ $this->assertNull($dataSet->getHoverBorderWidth(), 'The hoverBorderWidth value is not set');
+
+ $this->assertInstanceOf(DataSet::class, $dataSet->setHoverBorderWidth(1));
+ $this->assertEquals(1, $dataSet->getHoverBorderWidth(), 'The correct value is returned');
+
+ $dataSet->setHoverBorderWidth([1, 10, '5a', 0]);
+ $this->assertEquals([1, 10, 5, 0], $dataSet->getHoverBorderWidth(), 'The correct value is returned');
+ }
+
+ /**
+ *
+ */
+ public function testVisibility()
+ {
+ $dataSet = new DataSet();
+ $this->assertArrayNotHasKey('hidden', $dataSet->jsonSerialize(), 'Value should not be present');
+ $this->assertFalse($dataSet->isHidden(), 'Default value should be false');
+ $this->assertArrayHasKey('hidden', $dataSet->jsonSerialize(), 'Value should be present');
+ $this->assertInstanceOf(DataSet::class, $dataSet->setHidden(true));
+ $this->assertTrue($dataSet->isHidden(), 'Value should be true');
+ $this->assertTrue($dataSet->jsonSerialize()['hidden'], 'Value should be true');
+ $this->assertInstanceOf(DataSet::class, $dataSet->setHidden(null));
+ $this->assertArrayNotHasKey('hidden', $dataSet->jsonSerialize(), 'Value should not be present');
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Delegate/ArraySerializableTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Delegate/ArraySerializableTest.php
new file mode 100644
index 0000000000..371a47a164
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Delegate/ArraySerializableTest.php
@@ -0,0 +1,202 @@
+classA = new A(1, 2);
+ $this->classB = new B(3, 4, 5, 6);
+ }
+
+ /**
+ *
+ */
+ public function testSuperclass()
+ {
+ $expected = [ 'a' => 1, 'b' => 2 ];
+ ksort($expected);
+ $result = $this->classA->getArrayCopy();
+ ksort($result);
+ self::assertSame($expected, $result);
+ }
+}
+
+/**
+ * Class A
+ * @package Test\Delegate
+ */
+class A
+{
+ use ArraySerializable;
+
+ /**
+ * @var int
+ */
+ protected $a;
+
+ /**
+ * @var int
+ */
+ protected $b;
+
+ /**
+ *
+ * should not show (private)
+ * @var int
+ */
+ private $x;
+
+ /**
+ * should not show (private)
+ * @var int
+ */
+ private $y;
+
+ /**
+ * A constructor.
+ *
+ * @param $a int
+ * @param $b int
+ */
+ public function __construct($a, $b)
+ {
+ $this->a = $a;
+ $this->b = $b;
+ }
+
+ /**
+ * @return int
+ */
+ public function getA()
+ {
+ return $this->a;
+ }
+
+ /**
+ * @param int $a
+ */
+ public function setA($a)
+ {
+ $this->a = $a;
+ }
+
+ /**
+ * @return int
+ */
+ public function getB()
+ {
+ return $this->b;
+ }
+
+ /**
+ * @param int $b
+ */
+ public function setB($b)
+ {
+ $this->b = $b;
+ }
+
+ /**
+ * @return int
+ */
+ public function getX()
+ {
+ return $this->x;
+ }
+
+ /**
+ * this method should never be called by jsonSerialize because it is not
+ * a boolean.
+ *
+ * @return int
+ */
+ public function getY()
+ {
+ return $this->y;
+ }
+}
+
+/**
+ * Class B
+ * @package Test\Delegate
+ */
+class B extends A
+{
+ /**
+ * @var int
+ */
+ protected $c;
+
+ /**
+ * @var int
+ */
+ protected $d;
+
+ /**
+ * B constructor.
+ *
+ * @param $a int
+ * @param $b int
+ * @param $c int
+ * @param $d int
+ */
+ public function __construct($a, $b, $c, $d)
+ {
+ parent::__construct($a, $b);
+ $this->c = $c;
+ $this->d = $d;
+ }
+
+ /**
+ * @return int
+ */
+ public function getC()
+ {
+ return $this->c;
+ }
+
+ /**
+ * @param int $c
+ */
+ public function setC($c)
+ {
+ $this->c = $c;
+ }
+
+ /**
+ * @return int
+ */
+ public function getD()
+ {
+ return $this->d;
+ }
+
+ /**
+ * @param int $d
+ */
+ public function setD($d)
+ {
+ $this->d = $d;
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/FactoryTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/FactoryTest.php
new file mode 100644
index 0000000000..5d8df1308b
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/FactoryTest.php
@@ -0,0 +1,140 @@
+assertInstanceOf(Factory::class, $factory, 'Factory is correct class');
+ }
+
+ /**
+ *
+ */
+ public function testBar()
+ {
+ $factory = new Factory();
+ $chart = $factory->create($factory::BAR);
+
+ $this->assertInstanceOf(ChartInterface::class, $chart, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Bar::class, $chart, 'The correct class has been created');
+ }
+
+ /**
+ *
+ */
+ public function testBubble()
+ {
+ $factory = new Factory();
+ $chart = $factory->create($factory::BUBBLE);
+
+ $this->assertInstanceOf(ChartInterface::class, $chart, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Bubble::class, $chart, 'The correct class has been created');
+ }
+
+ /**
+ *
+ */
+ public function testDoughnut()
+ {
+ $factory = new Factory();
+ $chart = $factory->create($factory::DOUGHNUT);
+
+ $this->assertInstanceOf(ChartInterface::class, $chart, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Pie::class, $chart, 'The correct class has been extended');
+ $this->assertInstanceOf(Doughnut::class, $chart, 'The correct class has been created');
+ }
+
+ /**
+ *
+ */
+ public function testHorizontalBar()
+ {
+ $factory = new Factory();
+ $chart = $factory->create($factory::HORIZONTAL_BAR);
+
+ $this->assertInstanceOf(ChartInterface::class, $chart, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Bar::class, $chart, 'The correct class has been extended');
+ $this->assertInstanceOf(HorizontalBar::class, $chart, 'The correct class has been created');
+ }
+
+ /**
+ *
+ */
+ public function testLine()
+ {
+ $factory = new Factory();
+ $chart = $factory->create($factory::LINE);
+
+ $this->assertInstanceOf(ChartInterface::class, $chart, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Line::class, $chart, 'The correct class has been created');
+ }
+
+ /**
+ *
+ */
+ public function testPie()
+ {
+ $factory = new Factory();
+ $chart = $factory->create($factory::PIE);
+
+ $this->assertInstanceOf(ChartInterface::class, $chart, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Pie::class, $chart, 'The correct class has been created');
+ }
+
+ /**
+ *
+ */
+ public function testPolarArea()
+ {
+ $factory = new Factory();
+ $chart = $factory->create($factory::POLAR_AREA);
+
+ $this->assertInstanceOf(ChartInterface::class, $chart, 'The correct interface has been implemented');
+ $this->assertInstanceOf(PolarArea::class, $chart, 'The correct class has been created');
+ }
+
+ /**
+ *
+ */
+ public function testRadar()
+ {
+ $factory = new Factory();
+ $chart = $factory->create($factory::RADAR);
+
+ $this->assertInstanceOf(ChartInterface::class, $chart, 'The correct interface has been implemented');
+ $this->assertInstanceOf(Radar::class, $chart, 'The correct class has been created');
+ }
+
+ /**
+ *
+ */
+ public function testNonExisting()
+ {
+ $factory = new Factory();
+ $this->expectException(\InvalidArgumentException::class);
+
+ $factory->create('foo');
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/LabelsCollectionTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/LabelsCollectionTest.php
new file mode 100644
index 0000000000..68f3a572e9
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/LabelsCollectionTest.php
@@ -0,0 +1,69 @@
+labelsCollectionEmpty = new LabelsCollection();
+ $this->labelsCollection = new LabelsCollection($this->labelsArray);
+ }
+
+
+ /**
+ *
+ */
+ public function testJsonSerializeEmpty()
+ {
+ $expected = [];
+ $result = $this->labelsCollectionEmpty->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+
+
+ /**
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $expected = $this->labelsArray;
+ $result = $this->labelsCollection->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+
+
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/AnimationTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/AnimationTest.php
new file mode 100644
index 0000000000..7034596b7a
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/AnimationTest.php
@@ -0,0 +1,100 @@
+ 1,
+ 'easing' => '',
+ 'onProgress' => '',
+ 'onComplete' => '',
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data_no_expressions = [
+ 'duration' => 1,
+ 'easing' => '',
+ 'onProgress' => null,
+ 'onComplete' => null,
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data_with_expressions = [
+ 'duration' => 1,
+ 'easing' => '',
+ 'onProgress' => 'function() { echo "onProgress"; }',
+ 'onComplete' => 'function() { echo "onComplete"; }',
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'duration' => null,
+ 'easing' => null,
+ 'onProgress' => null,
+ 'onComplete' => null,
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->animation = new Animation();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->animation, $this->data_types);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetWithExpressions()
+ {
+ $expected = $this->input_data_with_expressions;
+ TestUtils::setAttributes($this->animation, $this->input_data_with_expressions);
+ $result = TestUtils::getAttributes($this->animation, $this->data_types);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializeNoExpressions()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data_no_expressions);
+ TestUtils::setAttributes($this->animation, $this->input_data_no_expressions);
+ $result = $this->animation->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ClickTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ClickTest.php
new file mode 100644
index 0000000000..ed31e5dcfb
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ClickTest.php
@@ -0,0 +1,70 @@
+ null,
+ ];
+
+ private $input_data_no_expressions = ['onClick' => null];
+ private $input_data_with_expressions = null;
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->options = new Options();
+ $this->input_data_with_expressions = ['onClick' => new Expr('function(event, array) { echo "onClick"; }')];
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->input_data_no_expressions;
+ TestUtils::setAttributes($this->options, $this->input_data_no_expressions);
+ $result = TestUtils::getAttributes($this->options, $this->data_types);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetWithExpressions()
+ {
+ $expected = $this->input_data_with_expressions;
+ TestUtils::setAttributes($this->options, $this->input_data_with_expressions);
+ $result = TestUtils::getAttributes($this->options, $this->data_types);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializeWithoutExpressions()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data_no_expressions);
+ TestUtils::setAttributes($this->options, $this->input_data_no_expressions);
+ $result = $this->options->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/ArcTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/ArcTest.php
new file mode 100644
index 0000000000..e890568bfd
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/ArcTest.php
@@ -0,0 +1,87 @@
+ '', /* string */
+ 'borderColor' => '', /* string */
+ 'borderWidth' => 1, /* int */
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'backgroundColor' => null, /* string */
+ 'borderColor' => null, /* string */
+ 'borderWidth' => null, /* int */
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data = [
+ 'backgroundColor' => 'backgroundColor', /* string */
+ 'borderColor' => 'borderColor', /* string */
+ 'borderWidth' => 2, /* int */
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->arc = new Arc();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->arc, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetNoObjects()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->arc, $this->input_data);
+ $result = TestUtils::getAttributes($this->arc, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data);
+ TestUtils::setAttributes($this->arc, $this->input_data);
+ $result = $this->arc->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/LineTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/LineTest.php
new file mode 100644
index 0000000000..88795b2970
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/LineTest.php
@@ -0,0 +1,111 @@
+ 1.0, /* float */
+ 'backgroundColor' => '', /* string */
+ 'borderWidth' => 1, /* int */
+ 'borderColor' => '', /* string */
+ 'borderCapStyle' => '', /* string */
+ 'borderDash' => [1, 2], /* int[] */
+ 'borderDashOffset' => 1.0, /* float */
+ 'borderJoinStyle' => '', /* string */
+ 'capBezierPoints' => false, /* bool */
+ 'fill' => '', /* string */
+ 'stepped' => false, /* bool */
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'tension' => null, /* float */
+ 'backgroundColor' => null, /* string */
+ 'borderWidth' => null, /* int */
+ 'borderColor' => null, /* string */
+ 'borderCapStyle' => null, /* string */
+ 'borderDash' => null, /* int[] */
+ 'borderDashOffset' => null, /* float */
+ 'borderJoinStyle' => null, /* string */
+ 'capBezierPoints' => null, /* bool */
+ 'fill' => null, /* bool */
+ 'stepped' => null, /* bool */
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data = [
+ 'tension' => 0.2, /* float */
+ 'backgroundColor' => 'backgroundColor', /* string */
+ 'borderWidth' => 2, /* int */
+ 'borderColor' => 'borderColor', /* string */
+ 'borderCapStyle' => 'borderCapStyle', /* string */
+ 'borderDash' => [5, 6], /* int[] */
+ 'borderDashOffset' => 0.1, /* float */
+ 'borderJoinStyle' => 'borderJoinStyle', /* string */
+ 'capBezierPoints' => true, /* bool */
+ 'fill' => true, /* bool */
+ 'stepped' => true, /* bool */
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->line = new Line();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->line, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetNoObjects()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->line, $this->input_data);
+ $result = TestUtils::getAttributes($this->line, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data);
+ TestUtils::setAttributes($this->line, $this->input_data);
+ $result = $this->line->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/PointTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/PointTest.php
new file mode 100644
index 0000000000..7f42cbe048
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/PointTest.php
@@ -0,0 +1,105 @@
+ 1, /* int */
+ 'pointStyle' => '', /* string */
+ 'rotation' => 1, /* int */
+ 'backgroundColor' => '', /* string */
+ 'borderWidth' => 1, /* int */
+ 'borderColor' => '', /* string */
+ 'hitRadius' => 1, /* int */
+ 'hoverRadius' => 1, /* int */
+ 'hoverBorderWidth' => 1, /* int */
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'radius' => null, /* int */
+ 'pointStyle' => null, /* string */
+ 'rotation' => null, /* int */
+ 'backgroundColor' => null, /* string */
+ 'borderWidth' => null, /* int */
+ 'borderColor' => null, /* string */
+ 'hitRadius' => null, /* int */
+ 'hoverRadius' => null, /* int */
+ 'hoverBorderWidth' => null, /* int */
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data = [
+ 'radius' => 2, /* int */
+ 'pointStyle' => 'pointStyle', /* string */
+ 'rotation' => 2, /* int */
+ 'backgroundColor' => 'backgroundColor', /* string */
+ 'borderWidth' => 2, /* int */
+ 'borderColor' => 'borderColor', /* string */
+ 'hitRadius' => 2, /* int */
+ 'hoverRadius' => 2, /* int */
+ 'hoverBorderWidth' => 2, /* int */
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->point = new Point();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->point, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetNoObjects()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->point, $this->input_data);
+ $result = TestUtils::getAttributes($this->point, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data);
+ TestUtils::setAttributes($this->point, $this->input_data);
+ $result = $this->point->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/RectangleTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/RectangleTest.php
new file mode 100644
index 0000000000..34bdccd439
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Elements/RectangleTest.php
@@ -0,0 +1,90 @@
+ '', /* string */
+ 'borderWidth' => 1, /* int */
+ 'borderColor' => '', /* string */
+ 'borderSkipped' => '', /* string */
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'backgroundColor' => null, /* string */
+ 'borderWidth' => null, /* int */
+ 'borderColor' => null, /* string */
+ 'borderSkipped' => null, /* string */
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data = [
+ 'backgroundColor' => 'backgroundColor', /* string */
+ 'borderWidth' => 2, /* int */
+ 'borderColor' => 'borderColor', /* string */
+ 'borderSkipped' => 'borderSkipped', /* string */
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->rectangle = new Rectangle();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->rectangle, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetNoObjects()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->rectangle, $this->input_data);
+ $result = TestUtils::getAttributes($this->rectangle, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data);
+ TestUtils::setAttributes($this->rectangle, $this->input_data);
+ $result = $this->rectangle->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ElementsTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ElementsTest.php
new file mode 100644
index 0000000000..81bb02af3d
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ElementsTest.php
@@ -0,0 +1,123 @@
+ '', /* Rectangle */
+ 'line' => '', /* Line */
+ 'point' => '', /* Point */
+ 'arc' => '', /* Arc */
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'rectangle' => null, /* Rectangle */
+ 'line' => null, /* Line */
+ 'point' => null, /* Point */
+ 'arc' => null, /* Arc */
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data = [
+ 'rectangle' => null, /* Rectangle */
+ 'line' => null, /* Line */
+ 'point' => null, /* Point */
+ 'arc' => null, /* Arc */
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->elements = new Elements();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->elements, $this->data_types);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testRectangle()
+ {
+ $rectangle = $this->elements->rectangle();
+ self::assertNotNull($rectangle);
+ self::assertInstanceOf(Rectangle::class, $rectangle);
+ }
+
+ /**
+ *
+ */
+ public function testLine()
+ {
+ $line = $this->elements->line();
+ self::assertNotNull($line);
+ self::assertInstanceOf(Line::class, $line);
+ }
+
+ /**
+ *
+ */
+ public function testPoint()
+ {
+ $point = $this->elements->point();
+ self::assertNotNull($point);
+ self::assertInstanceOf(Point::class, $point);
+ }
+
+ /**
+ *
+ */
+ public function testArc()
+ {
+ $arc = $this->elements->arc();
+ self::assertNotNull($arc);
+ self::assertInstanceOf(Arc::class, $arc);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data);
+ TestUtils::setAttributes($this->elements, $this->input_data);
+ $result = $this->elements->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/HoverTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/HoverTest.php
new file mode 100644
index 0000000000..b55a4e9ae3
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/HoverTest.php
@@ -0,0 +1,100 @@
+ '',
+ 'intersect' => false,
+ 'animationDuration' => 1,
+ 'onHover' => '',
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data_no_expressions = [
+ 'mode' => 'mode',
+ 'intersect' => true,
+ 'animationDuration' => 2,
+ 'onHover' => null,
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data_with_expressions = [
+ 'mode' => 'mode',
+ 'intersect' => true,
+ 'animationDuration' => 2,
+ 'onHover' => 'function() { echo "onHover"; }',
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'mode' => null,
+ 'intersect' => null,
+ 'animationDuration' => null,
+ 'onHover' => null,
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->hover = new Hover();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->hover, $this->data_types);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetWithExpressions()
+ {
+ $expected = $this->input_data_with_expressions;
+ TestUtils::setAttributes($this->hover, $this->input_data_with_expressions);
+ $result = TestUtils::getAttributes($this->hover, $this->data_types);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializeWithoutExpressions()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data_no_expressions);
+ TestUtils::setAttributes($this->hover, $this->input_data_no_expressions);
+ $result = $this->hover->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Layout/PaddingTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Layout/PaddingTest.php
new file mode 100644
index 0000000000..9f2b365d98
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Layout/PaddingTest.php
@@ -0,0 +1,86 @@
+padding = new Padding();
+ }
+
+
+ /**
+ *
+ */
+ public function testBottom()
+ {
+ $this->assertNull($this->padding->getBottom());
+ $this->padding->setBottom(20);
+ $this->assertSame(20, $this->padding->getBottom());
+ }
+
+
+ /**
+ *
+ */
+ public function testLeft()
+ {
+ $this->assertNull($this->padding->getLeft());
+ $this->padding->setLeft(20);
+ $this->assertSame(20, $this->padding->getLeft());
+ }
+
+
+ /**
+ *
+ */
+ public function testRight()
+ {
+ $this->assertNull($this->padding->getRight());
+ $this->padding->setRight(20);
+ $this->assertSame(20, $this->padding->getRight());
+ }
+
+
+ /**
+ *
+ */
+ public function testTop()
+ {
+ $this->assertNull($this->padding->getTop());
+ $this->padding->setTop(20);
+ $this->assertSame(20, $this->padding->getTop());
+ }
+
+
+ /**
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $this->padding->setTop(20);
+ $result = $this->padding->jsonSerialize();
+ $this->assertEquals(20, $result['top']);
+ }
+
+
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/LayoutTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/LayoutTest.php
new file mode 100644
index 0000000000..198e00c7c1
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/LayoutTest.php
@@ -0,0 +1,109 @@
+ 1,
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data = [
+ 'padding' => 2,
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'padding' => null,
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->layout = new Layout();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->layout, $this->data_types);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testPaddingInt()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->layout, $this->input_data);
+ $result = TestUtils::getAttributes($this->layout, $this->data_types);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ * Test whether Layout stores the Padding object correctly and
+ * relays changes correctly. We are *not* testing Padding
+ */
+ public function testPaddingObject()
+ {
+ self::assertInstanceOf(Layout\Padding::class, $this->layout->padding());
+ $this->layout->padding()->setLeft(2.1);
+ self::assertEquals(2, $this->layout->padding()->getLeft());
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializeAllInt()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->layout, $this->input_data);
+ self::assertEquals($expected, $this->layout->jsonSerialize());
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializePaddingObj()
+ {
+ $expected = $this->empty_data;
+ $expected['padding'] = [
+ "bottom" => null,
+ "left" => null,
+ "right" => 5,
+ "top" => null,
+ ];
+
+ $this->layout->padding()->setRight(5);
+ $result = $this->layout->jsonSerialize();
+ self::assertEquals(5, $result['padding']['right']);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Legend/LabelsTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Legend/LabelsTest.php
new file mode 100644
index 0000000000..540baba46e
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Legend/LabelsTest.php
@@ -0,0 +1,132 @@
+ 1,
+ 'fontSize' => 1,
+ 'fontStyle' => '',
+ 'fontColor' => '',
+ 'fontFamily' => '',
+ 'generateLabels' => '',
+ 'padding' => 1,
+ 'usePointStyle' => false,
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data_1 = [
+ 'boxWidth' => 12,
+ 'fontSize' => 13,
+ 'fontStyle' => 'fontStyle',
+ 'fontColor' => 'fontColor',
+ 'fontFamily' => 'fontFamily',
+ 'generateLabels' => null,
+ 'padding' => 14,
+ 'usePointStyle' => true,
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data_2 = [
+ 'boxWidth' => 12,
+ 'fontSize' => 13,
+ 'fontStyle' => 'fontStyle',
+ 'fontColor' => 'fontColor',
+ 'fontFamily' => 'fontFamily',
+ 'generateLabels' => 'generateLabels',
+ 'padding' => 14,
+ 'usePointStyle' => true,
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'boxWidth' => null,
+ 'fontSize' => null,
+ 'fontStyle' => null,
+ 'fontColor' => null,
+ 'fontFamily' => null,
+ 'generateLabels' => null,
+ 'padding' => null,
+ 'usePointStyle' => null,
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->labels = new Labels();
+ }
+
+ /**
+ *
+ */
+ public function testEmptyData()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->labels, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetWithoutExpr()
+ {
+ $expected = $this->input_data_1;
+ TestUtils::setAttributes($this->labels, $this->input_data_1);
+ $result = TestUtils::getAttributes($this->labels, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testExpr()
+ {
+ TestUtils::setAttributes($this->labels, $this->input_data_2);
+ $result = $this->labels->getGenerateLabels()->__toString();
+ $expected = $this->input_data_2['generateLabels'];
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ * This test uses assertEquals in stead of assertSame because json_encode / json_decode
+ * transform the float numbers to string, after which the decimal zero's disappear. It is
+ * still a float, but will be recognized by assertSame as an int. For that reason assertSame
+ * will not work as expected.
+ *
+ */
+ public function testJsonSerializeWithoutExpr()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data_1);
+ TestUtils::setAttributes($this->labels, $expected);
+ $result = $this->labels->jsonSerialize();
+ self::assertEquals($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/LegendTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/LegendTest.php
new file mode 100644
index 0000000000..9f29a6501d
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/LegendTest.php
@@ -0,0 +1,125 @@
+ false,
+ 'position' => '',
+ 'fullWidth' => false,
+ 'onClick' => '',
+ 'onHover' => '',
+ 'reverse' => false,
+ 'labels' => '', /* LabelsCollection */
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data_with_expressions = [
+ 'display' => true,
+ 'position' => 'position',
+ 'fullWidth' => true,
+ 'onClick' => 'onClick',
+ 'onHover' => 'onHover',
+ 'reverse' => true,
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data_no_expressions = [
+ 'display' => true,
+ 'position' => 'position',
+ 'fullWidth' => true,
+ 'onClick' => null,
+ 'onHover' => null,
+ 'labels' => null,
+ 'reverse' => true,
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'display' => null,
+ 'position' => null,
+ 'fullWidth' => null,
+ 'onClick' => null,
+ 'onHover' => null,
+ 'reverse' => null,
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->legend = new Legend();
+
+ $this->input_data_with_expressions['onClick'] = new Expr($this->input_data_with_expressions['onClick']);
+ $this->input_data_with_expressions['onHover'] = new Expr($this->input_data_with_expressions['onHover']);
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->legend, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetWithExpr()
+ {
+ $expected = $this->input_data_with_expressions;
+ TestUtils::setAttributes($this->legend, $this->input_data_with_expressions);
+ $result = TestUtils::getAttributes($this->legend, $this->data_types);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testLabelsCollection()
+ {
+ $labels = $this->legend->labels();
+ self::assertNotNull($labels);
+ self::assertInstanceOf(LabelsCollection::class, $labels);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializeWithoutExpressions()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data_no_expressions);
+ TestUtils::setAttributes($this->legend, $this->input_data_no_expressions);
+ $result = $this->legend->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ScaleTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ScaleTest.php
new file mode 100644
index 0000000000..cd4826e088
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ScaleTest.php
@@ -0,0 +1,186 @@
+ '', /* string */
+ 'display' => false, /* bool */
+ 'id' => '', /* string */
+ 'stacked' => false, /* bool */
+ 'barThickness' => 1, /* int */
+ 'position' => '', /* string */
+ 'beforeUpdate' => '', /* string */
+ 'beforeSetDimensions' => '', /* string */
+ 'afterSetDimensions' => '', /* string */
+ 'beforeDataLimits' => '', /* string */
+ 'afterDataLimits' => '', /* string */
+ 'beforeBuildTicks' => '', /* string */
+ 'afterBuildTicks' => '', /* string */
+ 'beforeTickToLabelConversion' => '', /* string */
+ 'afterTickToLabelConversion' => '', /* string */
+ 'beforeCalculateTickRotation' => '', /* string */
+ 'afterCalculateTickRotation' => '', /* string */
+ 'beforeFit' => '', /* string */
+ 'afterFit' => '', /* string */
+ 'afterUpdate' => '', /* string */
+ 'gridLines' => '', /* GridLines */
+ 'scaleLabel' => '', /* ScaleLabel */
+ 'ticks' => '', /* Ticks */
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data = [
+ 'type' => 'type', /* string */
+ 'display' => true, /* bool */
+ 'id' => 'id', /* string */
+ 'stacked' => true, /* bool */
+ 'barThickness' => 2, /* int */
+ 'position' => 'position', /* string */
+ 'beforeUpdate' => 'beforeUpdate', /* string */
+ 'beforeSetDimensions' => 'beforeSetDimensions', /* string */
+ 'afterSetDimensions' => 'afterSetDimensions', /* string */
+ 'beforeDataLimits' => 'beforeDataLimits', /* string */
+ 'afterDataLimits' => 'afterDataLimits', /* string */
+ 'beforeBuildTicks' => 'beforeBuildTicks', /* string */
+ 'afterBuildTicks' => 'afterBuildTicks', /* string */
+ 'beforeTickToLabelConversion' => 'beforeTickToLabelConversion', /* string */
+ 'afterTickToLabelConversion' => 'afterTickToLabelConversion', /* string */
+ 'beforeCalculateTickRotation' => 'beforeCalculateTickRotation', /* string */
+ 'afterCalculateTickRotation' => 'afterCalculateTickRotation', /* string */
+ 'beforeFit' => 'beforeFit', /* string */
+ 'afterFit' => 'afterFit', /* string */
+ 'afterUpdate' => 'afterUpdate', /* string */
+ 'gridLines' => null, /* GridLines */
+ 'scaleLabel' => null, /* ScaleLabel */
+ 'ticks' => null, /* Ticks */
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'type' => null, /* string */
+ 'display' => null, /* bool */
+ 'id' => null, /* string */
+ 'stacked' => null, /* bool */
+ 'barThickness' => null, /* int */
+ 'position' => null, /* string */
+ 'beforeUpdate' => null, /* string */
+ 'beforeSetDimensions' => null, /* string */
+ 'afterSetDimensions' => null, /* string */
+ 'beforeDataLimits' => null, /* string */
+ 'afterDataLimits' => null, /* string */
+ 'beforeBuildTicks' => null, /* string */
+ 'afterBuildTicks' => null, /* string */
+ 'beforeTickToLabelConversion' => null, /* string */
+ 'afterTickToLabelConversion' => null, /* string */
+ 'beforeCalculateTickRotation' => null, /* string */
+ 'afterCalculateTickRotation' => null, /* string */
+ 'beforeFit' => null, /* string */
+ 'afterFit' => null, /* string */
+ 'afterUpdate' => null, /* string */
+ 'gridLines' => null, /* GridLines */
+ 'scaleLabel' => null, /* ScaleLabel */
+ 'ticks' => null, /* Ticks */
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->scale = new AScale();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->scale, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetNoObjects()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->scale, $this->input_data);
+ $result = TestUtils::getAttributes($this->scale, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGridLines()
+ {
+ $g = $this->scale->gridLines();
+ self::assertInstanceOf(GridLines::class, $g);
+ }
+
+ /**
+ *
+ */
+ public function testScaleLabel()
+ {
+ $s = $this->scale->scaleLabel();
+ self::assertInstanceOf(ScaleLabel::class, $s);
+ }
+
+ /**
+ *
+ */
+ public function testTicks()
+ {
+ $t = $this->scale->ticks();
+ self::assertInstanceOf(Ticks::class, $t);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializeNoObjects()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data);
+ TestUtils::setAttributes($this->scale, $this->input_data);
+ $result = $this->scale->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/GridLinesTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/GridLinesTest.php
new file mode 100644
index 0000000000..56de5f7d30
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/GridLinesTest.php
@@ -0,0 +1,141 @@
+ false,
+ 'color' => '',
+ 'borderDash' => 1.0,
+ 'borderDashOffset' => [1.0],
+ 'lineWidth' => 1,
+ 'drawBorder' => false,
+ 'drawOnChartArea' => false,
+ 'drawTicks' => false,
+ 'tickMarkLength' => 1,
+ 'zeroLineWidth' => 1,
+ 'zeroLineColor' => '',
+ 'offsetGridLines' => false,
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data_single_value = [
+ 'display' => true,
+ 'color' => 'color',
+ 'borderDash' => [2.0],
+ 'borderDashOffset' => 3.0,
+ 'lineWidth' => 4,
+ 'drawBorder' => true,
+ 'drawOnChartArea' => true,
+ 'drawTicks' => true,
+ 'tickMarkLength' => 5,
+ 'zeroLineWidth' => 6,
+ 'zeroLineColor' => 'zeroLineColor',
+ 'offsetGridLines' => true,
+ ];
+
+ private $input_data_nested_arrays = [
+ 'display' => true,
+ 'color' => ['color1', 'color2', ['color3', 'color4']],
+ 'borderDash' => [2.0, 3.0, [4.0, 5.0]],
+ 'borderDashOffset' => 3.0,
+ 'lineWidth' => [4, 5, [6, 7], 8],
+ 'drawBorder' => true,
+ 'drawOnChartArea' => true,
+ 'drawTicks' => true,
+ 'tickMarkLength' => 5,
+ 'zeroLineWidth' => 6,
+ 'zeroLineColor' => 'zeroLineColor',
+ 'offsetGridLines' => true,
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'display' => null,
+ 'color' => null,
+ 'borderDash' => null,
+ 'borderDashOffset' => null,
+ 'lineWidth' => null,
+ 'drawBorder' => null,
+ 'drawOnChartArea' => null,
+ 'drawTicks' => null,
+ 'tickMarkLength' => null,
+ 'zeroLineWidth' => null,
+ 'zeroLineColor' => null,
+ 'offsetGridLines' => null,
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->gridLines = new GridLines();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->gridLines, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetSingleValues()
+ {
+ $expected = $this->input_data_single_value;
+ TestUtils::setAttributes($this->gridLines, $this->input_data_single_value);
+ $result = TestUtils::getAttributes($this->gridLines, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ public function testGetAndSetNestedArrayValues()
+ {
+ $expected = $this->input_data_nested_arrays;
+ TestUtils::setAttributes($this->gridLines, $this->input_data_nested_arrays);
+ $result = TestUtils::getAttributes($this->gridLines, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ * This test uses assertEquals in stead of assertSame because json_encode / json_decode
+ * transform the float numbers to string, after which the decimal zero's disappear. It is
+ * still a float, but will be recognized by assertSame as an int. For that reason assertSame
+ * will not work as expected.
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $expected = $this->input_data_single_value;
+ TestUtils::setAttributes($this->gridLines, $this->input_data_single_value);
+ $result = $this->gridLines->jsonSerialize();
+ self::assertEquals($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/ScaleLabelTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/ScaleLabelTest.php
new file mode 100644
index 0000000000..9d8fd8df85
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/ScaleLabelTest.php
@@ -0,0 +1,100 @@
+ false,
+ 'labelString' => '',
+ 'fontColor' => '',
+ 'fontFamily' => '',
+ 'fontSize' => 1,
+ 'fontStyle' => '',
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data = [
+ 'display' => false,
+ 'labelString' => 'labelString',
+ 'fontColor' => 'fontColor',
+ 'fontFamily' => 'fontFamily',
+ 'fontSize' => 1,
+ 'fontStyle' => 'fontStyle',
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'display' => null,
+ 'labelString' => null,
+ 'fontColor' => null,
+ 'fontFamily' => null,
+ 'fontSize' => null,
+ 'fontStyle' => null,
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->scaleLabel = new ScaleLabel();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->scaleLabel, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSet()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->scaleLabel, $this->input_data);
+ $result = TestUtils::getAttributes($this->scaleLabel, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ * This test uses assertEquals in stead of assertSame because json_encode / json_decode
+ * transform the float numbers to string, after which the decimal zero's disappear. It is
+ * still a float, but will be recognized by assertSame as an int. For that reason assertSame
+ * will not work as expected.
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->scaleLabel, $this->input_data);
+ $result = $this->scaleLabel->jsonSerialize();
+ self::assertEquals($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/TicksTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/TicksTest.php
new file mode 100644
index 0000000000..616c47986f
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/TicksTest.php
@@ -0,0 +1,167 @@
+ 1.0,
+ 'beginAtZero' => false,
+ 'stepSize' => 1.0,
+ 'autoSkip' => false,
+ 'autoSkipPadding' => 1,
+ 'callback' => '',
+ 'display' => false,
+ 'fontColor' => '',
+ 'fontFamily' => '',
+ 'fontSize' => 1,
+ 'fontStyle' => '',
+ 'labelOffset' => 1,
+ 'maxRotation' => 1,
+ 'minRotation' => 1,
+ 'mirror' => false,
+ 'padding' => 1,
+ 'reverse' => false,
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data_1 = [
+ 'suggestedMin' => 2.0,
+ 'beginAtZero' => true,
+ 'stepSize' => 3.0,
+ 'autoSkip' => true,
+ 'autoSkipPadding' => 4,
+ 'callback' => null,
+ 'display' => true,
+ 'fontColor' => 'fontColor',
+ 'fontFamily' => 'fontFamily',
+ 'fontSize' => 5,
+ 'fontStyle' => 'fontStyle',
+ 'labelOffset' => 6,
+ 'maxRotation' => 7,
+ 'minRotation' => 8,
+ 'mirror' => true,
+ 'padding' => 9,
+ 'reverse' => true,
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data_2 = [
+ 'suggestedMin' => 2.0,
+ 'beginAtZero' => true,
+ 'stepSize' => 3.0,
+ 'autoSkip' => true,
+ 'autoSkipPadding' => 4,
+ 'callback' => "function () { console.log('Hello'); }",
+ 'display' => true,
+ 'fontColor' => 'fontColor',
+ 'fontFamily' => 'fontFamily',
+ 'fontSize' => 5,
+ 'fontStyle' => 'fontStyle',
+ 'labelOffset' => 6,
+ 'maxRotation' => 7,
+ 'minRotation' => 8,
+ 'mirror' => true,
+ 'padding' => 9,
+ 'reverse' => true,
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'suggestedMin' => null,
+ 'beginAtZero' => null,
+ 'stepSize' => null,
+ 'autoSkip' => null,
+ 'autoSkipPadding' => null,
+ 'callback' => null,
+ 'display' => null,
+ 'fontColor' => null,
+ 'fontFamily' => null,
+ 'fontSize' => null,
+ 'fontStyle' => null,
+ 'labelOffset' => null,
+ 'maxRotation' => null,
+ 'minRotation' => null,
+ 'mirror' => null,
+ 'padding' => null,
+ 'reverse' => null,
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->ticks = new Ticks();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->ticks, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSetWithoutExpr()
+ {
+ $expected = $this->input_data_1;
+ TestUtils::setAttributes($this->ticks, $this->input_data_1);
+ $result = TestUtils::getAttributes($this->ticks, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testExpr()
+ {
+ TestUtils::setAttributes($this->ticks, $this->input_data_2);
+ $result = $this->ticks->getCallback()->__toString();
+ $expected = $this->input_data_2['callback'];
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ * This test uses assertEquals in stead of assertSame because json_encode / json_decode
+ * transform the float numbers to string, after which the decimal zero's disappear. It is
+ * still a float, but will be recognized by assertSame as an int. For that reason assertSame
+ * will not work as expected.
+ *
+ */
+ public function testJsonSerializeWithoutExpr()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data_1);
+ TestUtils::setAttributes($this->ticks, $expected);
+ $result = $this->ticks->jsonSerialize();
+ self::assertEquals($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/XAxisCollectionTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/XAxisCollectionTest.php
new file mode 100644
index 0000000000..01aaca8ec9
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Scales/XAxisCollectionTest.php
@@ -0,0 +1,84 @@
+xAxisCollection = new XAxisCollection();
+ $this->input_data = [];
+ foreach ($this->input_data as $value) {
+ $this->xAxisCollection[] = $value;
+ }
+ }
+
+ /**
+ *
+ */
+ public function testGetArrayCopyEmpty()
+ {
+ $expected = [];
+ $xAxisCollection = new XAxisCollection();
+ $result = $xAxisCollection->getArrayCopy();
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetArrayCopyNonEmpty()
+ {
+ $expected = [];
+ $x = new XAxis();
+ $expected[] = $x->getArrayCopy();
+ $this->xAxisCollection[] = $x;
+ $result = $this->xAxisCollection->getArrayCopy();
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializeEmpty()
+ {
+ $expected = [];
+ $result = $this->xAxisCollection->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializeNonEmpty()
+ {
+ $expected = [];
+ $x = new XAxis();
+ $expected[] = $x->getArrayCopy();
+ $this->xAxisCollection[] = $x;
+ $result = $this->xAxisCollection->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ScalesTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ScalesTest.php
new file mode 100644
index 0000000000..a609d634aa
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/ScalesTest.php
@@ -0,0 +1,89 @@
+scales = new Scales();
+ }
+
+ /**
+ *
+ */
+ public function testCreateXAxis()
+ {
+ self::assertInstanceOf(Scales\XAxis::class, $this->scales->createXAxis());
+ }
+
+ /**
+ *
+ */
+ public function testCreateYAxis()
+ {
+ self::assertInstanceOf(Scales\YAxis::class, $this->scales->createYAxis());
+ }
+
+ /**
+ *
+ */
+ public function testEmptyXAxis()
+ {
+ $expected = new Scales\XAxisCollection();
+ $result = $this->scales->getXAxes();
+ self::assertInstanceOf(Scales\XAxisCollection::class, $result);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testEmptyYAxis()
+ {
+ $expected = new Scales\YAxisCollection();
+ $result = $this->scales->getYAxes();
+ self::assertInstanceOf(Scales\YAxisCollection::class, $result);
+ self::assertEquals($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $xc = new Scales\XAxisCollection();
+ $x1 = new Scales\XAxis();
+ $x1->setBarThickness(2);
+ $xc[] = $x1;
+ $expected['xAxes'] = $xc->jsonSerialize();
+
+ $yc = new Scales\YAxisCollection();
+ $y1 = new Scales\YAxis();
+ $y1->setBarThickness(3);
+ $yc[] = $y1;
+
+ $expected['xAxes'] = $xc->jsonSerialize();
+ $expected['yAxes'] = $yc->jsonSerialize();
+ $this->scales->getXAxes()[] = $x1;
+ $this->scales->getYAxes()[] = $y1;
+ $result = $this->scales->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/TitleTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/TitleTest.php
new file mode 100644
index 0000000000..350dcaf68a
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/TitleTest.php
@@ -0,0 +1,104 @@
+ false, /* bool */
+ 'position' => '', /* string */
+ 'fullWidth' => false, /* bool */
+ 'fontSize' => 1, /* int */
+ 'fontFamily' => '', /* string */
+ 'fontColor' => '', /* string */
+ 'fontStyle' => '', /* string */
+ 'padding' => 1, /* int */
+ 'text' => '', /* string */
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data = [
+ 'display' => true, /* bool */
+ 'position' => 'position', /* string */
+ 'fullWidth' => true, /* bool */
+ 'fontSize' => 2, /* int */
+ 'fontFamily' => 'fontFamily', /* string */
+ 'fontColor' => 'fontColor', /* string */
+ 'fontStyle' => 'fontStyle', /* string */
+ 'padding' => 3, /* int */
+ 'text' => 'text', /* string */
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'display' => null, /* bool */
+ 'position' => null, /* string */
+ 'fullWidth' => null, /* bool */
+ 'fontSize' => null, /* int */
+ 'fontFamily' => null, /* string */
+ 'fontColor' => null, /* string */
+ 'fontStyle' => null, /* string */
+ 'padding' => null, /* int */
+ 'text' => null, /* string */
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->title = new Title();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->title, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSet()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->title, $this->input_data);
+ $result = TestUtils::getAttributes($this->title, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->title, $this->input_data);
+ $result = $this->title->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Tooltips/CallbacksTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Tooltips/CallbacksTest.php
new file mode 100644
index 0000000000..006cf4dc07
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/Tooltips/CallbacksTest.php
@@ -0,0 +1,125 @@
+ '',
+ 'title' => '',
+ 'afterTitle' => '',
+ 'beforeLabel' => '',
+ 'label' => '',
+ 'labelColor' => '',
+ 'afterLabel' => '',
+ 'afterBody' => '',
+ 'beforeFooter' => '',
+ 'footer' => '',
+ 'afterFooter' => '',
+ 'dataPoints' => '',
+ ];
+
+ /**
+ * @var array
+ */
+ private $input_data = [
+ 'beforeTitle' => "function() { alert( 'Hello' ); }",
+ 'title' => "function() { alert( 'Hello' ); }",
+ 'afterTitle' => "function() { alert( 'Hello' ); }",
+ 'beforeLabel' => "function() { alert( 'Hello' ); }",
+ 'label' => "function() { alert( 'Hello' ); }",
+ 'labelColor' => "function() { alert( 'Hello' ); }",
+ 'afterLabel' => "function() { alert( 'Hello' ); }",
+ 'afterBody' => "function() { alert( 'Hello' ); }",
+ 'beforeFooter' => "function() { alert( 'Hello' ); }",
+ 'footer' => "function() { alert( 'Hello' ); }",
+ 'afterFooter' => "function() { alert( 'Hello' ); }",
+ 'dataPoints' => "function() { alert( 'Hello' ); }",
+ ];
+
+ /**
+ * @var array
+ */
+ private $empty_data = [
+ 'beforeTitle' => null,
+ 'title' => null,
+ 'afterTitle' => null,
+ 'beforeLabel' => null,
+ 'label' => null,
+ 'labelColor' => null,
+ 'afterLabel' => null,
+ 'afterBody' => null,
+ 'beforeFooter' => null,
+ 'footer' => null,
+ 'afterFooter' => null,
+ 'dataPoints' => null,
+ ];
+
+ private $initial_data = [];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->callbacks = new Callbacks();
+
+ // Re-initialize Expr properties
+ $keys = array_keys($this->empty_data);
+ foreach ($keys as $key) {
+ $this->initial_data[$key] = new Expr('');
+ }
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->callbacks, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSet()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->callbacks, $this->input_data);
+ $result = TestUtils::getAttributes($this->callbacks, $this->data_types);
+ array_walk(
+ $result,
+ function (&$value) {
+ $value = strval($value);
+ }
+ );
+ self::assertSame($expected, $result);
+ }
+
+ public function testJsonSerializeEmpty()
+ {
+ $expected = [];
+ $result = $this->callbacks->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/Options/TooltipsTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/TooltipsTest.php
new file mode 100644
index 0000000000..f640eb1180
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/Options/TooltipsTest.php
@@ -0,0 +1,227 @@
+ false, /* bool */
+ 'custom' => '', /* Expr */
+ 'mode' => '', /* string */
+ 'intersect' => false, /* bool */
+ 'position' => '', /* string */
+ 'itemSort' => '', /* Expr */
+ 'filter' => '', /* Expr */
+ 'backgroundColor' => '', /* string */
+ 'titleFontFamily' => '', /* string */
+ 'titleFontSize' => 1, /* int */
+ 'titleFontStyle' => '', /* string */
+ 'titleFontColor' => '', /* string */
+ 'titleSpacing' => '', /* int */
+ 'titleMarginBottom' => '', /* int */
+ 'bodyFontFamily' => '', /* string */
+ 'bodyFontSize' => '', /* int */
+ 'bodyFontStyle' => '', /* string */
+ 'bodyFontColor' => '', /* string */
+ 'bodySpacing' => '', /* int */
+ 'footerFontFamily' => '', /* string */
+ 'footerFontSize' => 1, /* int */
+ 'footerFontStyle' => '', /* string */
+ 'footerFontColor' => '', /* string */
+ 'footerSpacing' => 1, /* int */
+ 'footerMarginTop' => 1, /* int */
+ 'xPadding' => 1, /* int */
+ 'yPadding' => 1, /* int */
+ 'caretSize' => 1, /* int */
+ 'cornerRadius' => 1, /* int */
+ 'multiKeyBackground' => '', /* string */
+ 'displayColors' => false, /* bool */
+ ];
+
+ /**
+ * @var array
+ */
+ public $input_data = [
+ 'enabled' => true, /* bool */
+ 'custom' => 'custom', /* Expr */
+ 'mode' => 'mode', /* string */
+ 'intersect' => true, /* bool */
+ 'position' => 'position', /* string */
+ 'itemSort' => 'itemSort', /* Expr */
+ 'filter' => 'filter', /* Expr */
+ 'backgroundColor' => 'backgroundColor', /* string */
+ 'titleFontFamily' => 'titleFontFamily', /* string */
+ 'titleFontSize' => 2, /* int */
+ 'titleFontStyle' => 'titleFontStyle', /* string */
+ 'titleFontColor' => 'titleFontColor', /* string */
+ 'titleSpacing' => 3, /* int */
+ 'titleMarginBottom' => 4, /* int */
+ 'bodyFontFamily' => 'bodyFontFamily', /* string */
+ 'bodyFontSize' => 5, /* int */
+ 'bodyFontStyle' => 'bodyFontStyle', /* string */
+ 'bodyFontColor' => 'bodyFontColor', /* string */
+ 'bodySpacing' => 6, /* int */
+ 'footerFontFamily' => 'footerFontFamily', /* string */
+ 'footerFontSize' => 7, /* int */
+ 'footerFontStyle' => 'footerFontStyle', /* string */
+ 'footerFontColor' => 'footerFontColor', /* string */
+ 'footerSpacing' => 8, /* int */
+ 'footerMarginTop' => 9, /* int */
+ 'xPadding' => 10, /* int */
+ 'yPadding' => 11, /* int */
+ 'caretSize' => 12, /* int */
+ 'cornerRadius' => 13, /* int */
+ 'multiKeyBackground' => 'multiKeyBackground', /* string */
+ 'displayColors' => true, /* bool */
+ ];
+
+ /**
+ * @var array
+ */
+ public $input_data_no_expressions = [
+ 'enabled' => true, /* bool */
+ 'custom' => null, /* Expr */
+ 'mode' => 'mode', /* string */
+ 'intersect' => true, /* bool */
+ 'position' => 'position', /* string */
+ 'itemSort' => null, /* Expr */
+ 'filter' => null, /* Expr */
+ 'backgroundColor' => 'backgroundColor', /* string */
+ 'titleFontFamily' => 'titleFontFamily', /* string */
+ 'titleFontSize' => 2, /* int */
+ 'titleFontStyle' => 'titleFontStyle', /* string */
+ 'titleFontColor' => 'titleFontColor', /* string */
+ 'titleSpacing' => 3, /* int */
+ 'titleMarginBottom' => 4, /* int */
+ 'bodyFontFamily' => 'bodyFontFamily', /* string */
+ 'bodyFontSize' => 5, /* int */
+ 'bodyFontStyle' => 'bodyFontStyle', /* string */
+ 'bodyFontColor' => 'bodyFontColor', /* string */
+ 'bodySpacing' => 6, /* int */
+ 'footerFontFamily' => 'footerFontFamily', /* string */
+ 'footerFontSize' => 7, /* int */
+ 'footerFontStyle' => 'footerFontStyle', /* string */
+ 'footerFontColor' => 'footerFontColor', /* string */
+ 'footerSpacing' => 8, /* int */
+ 'footerMarginTop' => 9, /* int */
+ 'xPadding' => 10, /* int */
+ 'yPadding' => 11, /* int */
+ 'caretSize' => 12, /* int */
+ 'cornerRadius' => 13, /* int */
+ 'multiKeyBackground' => 'multiKeyBackground', /* string */
+ 'displayColors' => true, /* bool */
+ ];
+
+ /**
+ * @var array
+ */
+ public $empty_data = [
+ 'enabled' => null, /* bool */
+ 'custom' => null, /* Expr */
+ 'mode' => null, /* string */
+ 'intersect' => null, /* bool */
+ 'position' => null, /* string */
+ 'itemSort' => null, /* Expr */
+ 'filter' => null, /* Expr */
+ 'backgroundColor' => null, /* string */
+ 'titleFontFamily' => null, /* string */
+ 'titleFontSize' => null, /* int */
+ 'titleFontStyle' => null, /* string */
+ 'titleFontColor' => null, /* string */
+ 'titleSpacing' => null, /* int */
+ 'titleMarginBottom' => null, /* int */
+ 'bodyFontFamily' => null, /* string */
+ 'bodyFontSize' => null, /* int */
+ 'bodyFontStyle' => null, /* string */
+ 'bodyFontColor' => null, /* string */
+ 'bodySpacing' => null, /* int */
+ 'footerFontFamily' => null, /* string */
+ 'footerFontSize' => null, /* int */
+ 'footerFontStyle' => null, /* string */
+ 'footerFontColor' => null, /* string */
+ 'footerSpacing' => null, /* int */
+ 'footerMarginTop' => null, /* int */
+ 'xPadding' => null, /* int */
+ 'yPadding' => null, /* int */
+ 'caretSize' => null, /* int */
+ 'cornerRadius' => null, /* int */
+ 'multiKeyBackground' => null, /* string */
+ 'displayColors' => null, /* bool */
+ ];
+
+ /**
+ *
+ */
+ public function setUp(): void
+ {
+ $this->tooltips = new Tooltips();
+ }
+
+ /**
+ *
+ */
+ public function testEmpty()
+ {
+ $expected = $this->empty_data;
+ $result = TestUtils::getAttributes($this->tooltips, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testGetAndSet()
+ {
+ $expected = $this->input_data;
+ TestUtils::setAttributes($this->tooltips, $this->input_data);
+ $result = TestUtils::getAttributes($this->tooltips, $this->data_types);
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testCallbackInstance()
+ {
+ $result = $this->tooltips->callbacks();
+ self::assertInstanceOf(Tooltips\Callbacks::class, $result);
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerializeNoExpressions()
+ {
+ $expected = TestUtils::removeNullsFromArray($this->input_data_no_expressions);
+ TestUtils::setAttributes($this->tooltips, $expected);
+ $result = $this->tooltips->jsonSerialize();
+ self::assertSame($expected, $result);
+ }
+
+ /**
+ *
+ */
+ public function testCallbackEmpty()
+ {
+ $expected = new Tooltips\Callbacks();
+ $result = $this->tooltips->callbacks();
+ self::assertEquals($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/OptionsTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/OptionsTest.php
new file mode 100644
index 0000000000..59921b533e
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/OptionsTest.php
@@ -0,0 +1,139 @@
+options = new Options();
+ }
+
+ /**
+ *
+ */
+ public function testTitle()
+ {
+ $title = $this->options->getTitle();
+ self::assertInstanceOf(Title::class, $title);
+ }
+
+ /**
+ *
+ */
+ public function testLayout()
+ {
+ $layout = $this->options->getLayout();
+ self::assertInstanceOf(Layout::class, $layout);
+ }
+
+ /**
+ *
+ */
+ public function testElements()
+ {
+ $layout = $this->options->getElements();
+ self::assertInstanceOf(Elements::class, $layout);
+ }
+
+ /**
+ *
+ */
+ public function testAnimation()
+ {
+ $animation = $this->options->getAnimation();
+ self::assertInstanceOf(Animation::class, $animation);
+ }
+
+ /**
+ *
+ */
+ public function testHover()
+ {
+ $hover = $this->options->getHover();
+ self::assertInstanceOf(Hover::class, $hover);
+ }
+
+ /**
+ *
+ */
+ public function testScales()
+ {
+ $scales = $this->options->getScales();
+ self::assertInstanceOf(Scales::class, $scales);
+ }
+
+ /**
+ *
+ */
+ public function testLagend()
+ {
+ $legend = $this->options->getLegend();
+ self::assertInstanceOf(Legend::class, $legend);
+ }
+
+ /**
+ *
+ */
+ public function testTooltips()
+ {
+ $tooltips = $this->options->getTooltips();
+ self::assertInstanceOf(Tooltips::class, $tooltips);
+ }
+
+ /**
+ *
+ */
+ public function testAspectRatio()
+ {
+ // Test default value. Should be true.
+ self::assertTrue($this->options->isMaintainAspectRatio());
+
+ // Set to false.
+ self::assertSame($this->options, $this->options->setMaintainAspectRatio(false));
+ self::assertFalse($this->options->isMaintainAspectRatio());
+
+ // Set to true again.
+ self::assertSame($this->options, $this->options->setMaintainAspectRatio(true));
+ self::assertTrue($this->options->isMaintainAspectRatio());
+ }
+
+ /**
+ *
+ */
+ public function testJsonSerialize()
+ {
+ $expected = $this->empty_options;
+ $result = $this->options->jsonSerialize();
+ self::assertEquals($expected, $result);
+ }
+}
diff --git a/pandora_console/vendor/artica/phpchartjs/test/unit/RendererTest.php b/pandora_console/vendor/artica/phpchartjs/test/unit/RendererTest.php
new file mode 100644
index 0000000000..a406fed450
--- /dev/null
+++ b/pandora_console/vendor/artica/phpchartjs/test/unit/RendererTest.php
@@ -0,0 +1,81 @@
+setId('myChart')
+ ->addLabel('Label 1')->addLabel('Label 2')
+ ->setTitle('My beautiful chart')
+ ->setHeight(320)
+ ->setWidth(480);
+
+ /** @var DataSet $dataSet */
+ $chart->addDataSet($dataSet = $chart->createDataSet());
+ $dataSet->setLabel('My First Dataset');
+
+ $chart->options()->getTitle()->setText('My cool graph');
+ $chart->options()->getLegend()->setDisplay(false);
+
+ $this->chart = $chart;
+ }
+
+ /**
+ * Test and validate generated JSON. See http://www.ietf.org/rfc/rfc4627.txt and http://json.org/.
+ * JavaScript functions will not be recognized and will result in failures of this test.
+ */
+ public function testJson()
+ {
+ $renderer = new Json($this->chart);
+ $json = $renderer->render();
+ $regex = << -? (?= [1-9]|0(?!\d) ) \d+ (\.\d+)? ([eE] [+-]? \d+)? )
+ (? true | false | null )
+ (? " ([^"\\\\]* | \\\\ ["\\\\bfnrt\/] | \\\\ u [0-9a-f]{4} )* " )
+ (? \[ (?: (?&json) (?: , (?&json) )* )? \s* \] )
+ (? \s* (?&string) \s* : (?&json) )
+ (?