File tree 1 file changed +49
-0
lines changed
1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,55 @@ public function testContactToRequest(UnitTester $I)
163
163
$ I ->assertEquals ($ expected ['contact ' ], $ contact ->toRequest ($ prependKey = false ));
164
164
}
165
165
166
+ public function testContactFieldsCanBeCleared (UnitTester $ I )
167
+ {
168
+ $ I ->wantTo ('clear contact fields ' );
169
+
170
+ $ values = [
171
+ 'FirstName ' => null ,
172
+ 'LastName ' => null ,
173
+ 'custom_fields ' => [
174
+ [
175
+ 'kind ' => 'Age ' ,
176
+ 'value ' => null ,
177
+ 'fieldType ' => 'integer ' ,
178
+ ],
179
+ [
180
+ 'kind ' => 'Birthday ' ,
181
+ 'value ' => null ,
182
+ 'fieldType ' => 'date ' ,
183
+ ],
184
+ [
185
+ 'kind ' => 'Category ' ,
186
+ 'value ' => null ,
187
+ 'fieldType ' => 'string ' ,
188
+ ],
189
+ [
190
+ 'kind ' => 'Completed Status ' ,
191
+ 'value ' => null ,
192
+ 'fieldType ' => 'float ' ,
193
+ ],
194
+ ],
195
+ ];
196
+
197
+ $ contact = new AutopilotContact ($ values );
198
+
199
+ $ expected = [
200
+ 'contact ' => [
201
+ 'FirstName ' => null ,
202
+ 'LastName ' => null ,
203
+ 'custom ' => [
204
+ 'integer--Age ' => null ,
205
+ 'date--Birthday ' => null ,
206
+ 'string--Category ' => null ,
207
+ 'float--Completed--Status ' => null ,
208
+ ],
209
+ ],
210
+ ];
211
+
212
+ $ I ->assertEquals ($ expected , $ contact ->toRequest ());
213
+ }
214
+
166
215
public function testContactMagicGettersAndSetters (UnitTester $ I )
167
216
{
168
217
$ I ->wantTo ('set and get values using magic methods ' );
You can’t perform that action at this time.
0 commit comments