Skip to content

Commit

Permalink
list tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Jul 23, 2024
1 parent 0c34cdc commit 658ff7a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Integration/Normalizer/NormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,21 @@ public static function normalize_basic_values_yields_expected_output_data_provid
JSON_FORCE_OBJECT
];

yield 'list' => [
'input' => ['foo', 'bar'],
'expected array' => ['foo', 'bar'],
'expected json' => '["foo","bar"]',
];

yield 'list kept as object in json' => [
'input' => ['foo', 'bar'],
'expected array' => ['foo', 'bar'],
'expected json' => '{"0":"foo","1":"bar"}',
[],
[],
JSON_FORCE_OBJECT
];

yield 'ArrayObject' => [
'input' => new ArrayObject(['foo' => 'foo', 'bar' => 'bar']),
'expected array' => [
Expand Down

0 comments on commit 658ff7a

Please sign in to comment.