@@ -57,7 +57,19 @@ test('php file', () => {
5757 expect ( data ) . toEqual ( [ 'foo' , 'bar' ] ) ;
5858} ) ;
5959
60- test ( 'all value types match (arrays strings numbers decimals nulls booleans)' , ( ) => {
60+ test ( 'function calls' , ( ) => {
61+ const data = fromString ( `[
62+ 'func' => env('SOME_VAR', true),
63+ 'another' => substr($var, 0, 5),
64+ 'arrow' => (fn() => 123),
65+ ]` ) ;
66+ expect ( data ) . toEqual ( {
67+ func : "env('SOME_VAR', true)" ,
68+ another : "substr($var, 0, 5)" ,
69+ } ) ;
70+ } )
71+
72+ test ( 'all value types match (arrays strings numbers decimals nulls booleans functions)' , ( ) => {
6173 const data = fromString ( `[
6274 'arrayvalue' => [
6375 'hello', 'world'
@@ -68,6 +80,7 @@ test('all value types match (arrays strings numbers decimals nulls booleans)', (
6880 'nullvalue' => null,
6981 'truevalue' => true,
7082 'falsevalue' => false,
83+ 'functionvalue' => strtoupper('abc'),
7184 ]` ) ;
7285 expect ( data ) . toEqual ( {
7386 arrayvalue : [ 'hello' , 'world' ] ,
@@ -76,6 +89,8 @@ test('all value types match (arrays strings numbers decimals nulls booleans)', (
7689 decimalvalue : 4.2 ,
7790 nullvalue : null ,
7891 truevalue : true ,
79- falsevalue : false
92+ falsevalue : false ,
93+ functionvalue : 'strtoupper(\'abc\')'
8094 } ) ;
8195} ) ;
96+
0 commit comments