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 2020 - name : Setup PHP with PECL extension
2121 uses : shivammathur/setup-php@v2
2222 with :
23- php-version : ' 8.2 '
23+ php-version : ' 8.3 '
2424
2525 - name : Validate composer.json and composer.lock
2626 run : composer validate --strict
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public function __construct(array $attributes = [])
1717 * @param string $name
1818 * @return mixed
1919 */
20- public function __get ($ name )
20+ public function & __get ($ name )
2121 {
2222 return $ this ->attributes [$ name ];
2323 }
@@ -29,7 +29,7 @@ public function __get($name)
2929 * @param mixed $value
3030 * @return $this
3131 */
32- public function __set ($ name , $ value )
32+ public function & __set ($ name , $ value )
3333 {
3434 $ this ->attributes [$ name ] = $ value ;
3535
Original file line number Diff line number Diff line change @@ -302,4 +302,31 @@ public function test_can_create_mixed_chart_types()
302302
303303 $ this ->assertEquals ($ expected , $ this ->chart ->get ());
304304 }
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+ }
305332}
You can’t perform that action at this time.
0 commit comments