From 658ff7a8bb1aa8bdc5816f245d985d74f3b29515 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Tue, 23 Jul 2024 12:05:48 +0200 Subject: [PATCH] list tests --- tests/Integration/Normalizer/NormalizerTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/Integration/Normalizer/NormalizerTest.php b/tests/Integration/Normalizer/NormalizerTest.php index e761ce2d..8a884c25 100644 --- a/tests/Integration/Normalizer/NormalizerTest.php +++ b/tests/Integration/Normalizer/NormalizerTest.php @@ -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' => [