Config: Improve the node.config.php transformation

- Add more types
- Improvement for assoziative arrays and key-value arrays
- Add a lot more tests
This commit is contained in:
Philipp 2023-01-15 00:53:51 +01:00
parent eda65296f5
commit 4c28f9cf9c
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
9 changed files with 301 additions and 43 deletions

View file

@ -23,9 +23,13 @@ return [
'string2' => 'false',
],
],
'v' => true,
'v3' => 1,
'bool_true' => true,
'bool_false' => false,
'int_1_not_true' => 1,
'int_0_not_false' => 0,
'v4' => 5.6443,
'string_1_not_true' => '1',
'string_0_not_false' => '0',
],
],
'system' => [

View file

@ -0,0 +1,8 @@
<?php
return [
'string_int_values' => [
'string_1_not_true' => '1',
'string_0_not_false' => '0',
],
];

View file

@ -0,0 +1,7 @@
<?php
return [
'object' => [
'objects_not_supported' => new stdClass(),
],
];

View file

@ -0,0 +1,7 @@
<?php
return [
'ressource' => [
'ressources_not_allowed' => new \GuzzleHttp\Psr7\AppendStream(),
],
];

View file

@ -0,0 +1,12 @@
<?php
return [
'small_cat' => [
[
'key' => 'value',
],
[
'key2' => 'value2',
],
],
];

View file

@ -0,0 +1,75 @@
<?php
return [
'type_test' => [
'bool_true' => true,
'bool_false' => false,
'int_1' => 1,
'int_0' => 2,
'int_12345' => 12345,
'float' => 1.234,
'double_E+' => 1.24E+20,
'double_E-' => 7.0E-10,
'null' => null,
'array' => [1, '2', '3', 4.0E-10, 12345, 0, false, 'true', true],
'array_keys' => [
'int_1' => 1,
'string_2' => '2',
'string_3' => '3',
'double' => 4.0E-10,
'int' => 12345,
'int_0' => 0,
'false' => false,
'string_true' => 'true',
'true' => true,
],
'array_extended' => [
[
'key_1' => 'value_1',
'key_2' => 'value_2',
'key_3' => [
'inner_key' => 'inner_value',
],
],
[
'key_2' => false,
'0' => [
'is_that' => true,
'0' => [
'working' => '?',
],
],
'inner_array' => [
[
'key' => 'value',
'key2' => 12,
],
],
'key_3' => true,
],
['value', 'value2'],
[
[
'key' => 123,
],
'test',
'test52',
'test23',
[
'key' => 456,
],
],
],
],
'other_cat' => [
'key' => 'value',
],
'other_cat2' => [
[
'key' => 'value',
],
[
'key2' => 'value2',
],
],
];