From 15e981efbca1cae8eed47f7fe4486358ed42d250 Mon Sep 17 00:00:00 2001 From: twoldanski <66474451+twoldanski@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:18:31 +0200 Subject: [PATCH] [TASK] Add tests for `ifEmptyUnsetKey` in JSON Content Object (#657) --- Tests/Unit/ContentObject/JsonContentObjectTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/Unit/ContentObject/JsonContentObjectTest.php b/Tests/Unit/ContentObject/JsonContentObjectTest.php index d570b929..d028bf20 100644 --- a/Tests/Unit/ContentObject/JsonContentObjectTest.php +++ b/Tests/Unit/ContentObject/JsonContentObjectTest.php @@ -145,6 +145,8 @@ public function dataProvider(): array return [ [[], '[]'], [null, '[]'], + [['fields.' => ['test' => 'TEXT', 'test.' => ['value' => '', 'ifEmptyUnsetKey' => 1]]], json_encode([])], + [['fields.' => ['test' => 'INT', 'test.' => ['value' => '1', 'ifEmptyUnsetKey' => 1]]], json_encode(['test' => 1])], [['if.' => ['isTrue' => 0], 'fields.' => ['test' => 'TEXT', 'test.' => ['value' => '1']]], ''], [['if.' => ['isTrue' => 1], 'fields.' => ['test' => 'TEXT', 'test.' => ['value' => '1']]], json_encode(['test' => '1'])], [['stdWrap.' => ['wrap' => '{"wrapped":|}']], json_encode(['wrapped' => []])],