mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-17 04:15:15 +02:00
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:
parent
eda65296f5
commit
4c28f9cf9c
9 changed files with 301 additions and 43 deletions
|
@ -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' => [
|
||||
|
|
8
tests/datasets/config/transformer/D.node.config.php
Normal file
8
tests/datasets/config/transformer/D.node.config.php
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'string_int_values' => [
|
||||
'string_1_not_true' => '1',
|
||||
'string_0_not_false' => '0',
|
||||
],
|
||||
];
|
7
tests/datasets/config/transformer/object.node.config.php
Normal file
7
tests/datasets/config/transformer/object.node.config.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'object' => [
|
||||
'objects_not_supported' => new stdClass(),
|
||||
],
|
||||
];
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'ressource' => [
|
||||
'ressources_not_allowed' => new \GuzzleHttp\Psr7\AppendStream(),
|
||||
],
|
||||
];
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'small_cat' => [
|
||||
[
|
||||
'key' => 'value',
|
||||
],
|
||||
[
|
||||
'key2' => 'value2',
|
||||
],
|
||||
],
|
||||
];
|
75
tests/datasets/config/transformer/types.node.config.php
Normal file
75
tests/datasets/config/transformer/types.node.config.php
Normal 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',
|
||||
],
|
||||
],
|
||||
];
|
Loading…
Add table
Add a link
Reference in a new issue