File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 20
20
- name : Setup PHP with PECL extension
21
21
uses : shivammathur/setup-php@v2
22
22
with :
23
- php-version : ' 8.2 '
23
+ php-version : ' 8.3 '
24
24
25
25
- name : Validate composer.json and composer.lock
26
26
run : composer validate --strict
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public function __construct(array $attributes = [])
17
17
* @param string $name
18
18
* @return mixed
19
19
*/
20
- public function __get ($ name )
20
+ public function & __get ($ name )
21
21
{
22
22
return $ this ->attributes [$ name ];
23
23
}
@@ -29,7 +29,7 @@ public function __get($name)
29
29
* @param mixed $value
30
30
* @return $this
31
31
*/
32
- public function __set ($ name , $ value )
32
+ public function & __set ($ name , $ value )
33
33
{
34
34
$ this ->attributes [$ name ] = $ value ;
35
35
Original file line number Diff line number Diff line change @@ -302,4 +302,31 @@ public function test_can_create_mixed_chart_types()
302
302
303
303
$ this ->assertEquals ($ expected , $ this ->chart ->get ());
304
304
}
305
+
306
+ /**
307
+ * Test if the chart dataset can be set as an array without using a method.
308
+ */
309
+ public function test_can_set_dataset_as_an_array ()
310
+ {
311
+ $ this ->chart ->type = 'bar ' ;
312
+
313
+ $ data = new Data ;
314
+ $ dataset = new Dataset ();
315
+ $ dataset ->data = [5 , 10 , 20 ];
316
+ $ data ->datasets [] = $ dataset ->data ;
317
+
318
+ $ this ->chart ->data ($ data );
319
+
320
+ $ expected = [
321
+ 'type ' => 'bar ' ,
322
+ 'data ' => [
323
+ 'datasets ' => [
324
+ [5 , 10 , 20 ],
325
+ ],
326
+ ],
327
+ 'options ' => []
328
+ ];
329
+
330
+ $ this ->assertEquals ($ expected , $ this ->chart ->get ());
331
+ }
305
332
}
You can’t perform that action at this time.
0 commit comments