File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ public function process($data): string|array
7171 return $ dictionary ->handle ();
7272 }
7373
74- return array_merge (['type ' => $ dictionary ->handle ()], $ values ->all ());
74+ return array_merge (['type ' => $ dictionary ->handle ()], $ values ->filter ()-> all ());
7575 }
7676
7777 public function extraRules (): array
Original file line number Diff line number Diff line change @@ -116,6 +116,23 @@ public function it_processes_dictionary_fields_into_a_string_when_dictionary_has
116116 $ this ->assertEquals ('fake_dictionary ' , $ process );
117117 }
118118
119+ #[Test]
120+ public function it_processes_dictionary_fields_and_filters_out_null_values ()
121+ {
122+ $ fieldtype = FieldtypeRepository::find ('dictionary_fields ' );
123+
124+ $ process = $ fieldtype ->process ([
125+ 'type ' => 'fake_dictionary ' ,
126+ 'category ' => 'foo ' ,
127+ 'foo ' => null ,
128+ ]);
129+
130+ $ this ->assertEquals ([
131+ 'type ' => 'fake_dictionary ' ,
132+ 'category ' => 'foo ' ,
133+ ], $ process );
134+ }
135+
119136 #[Test]
120137 public function it_returns_validation_rules ()
121138 {
You can’t perform that action at this time.
0 commit comments