@@ -42,13 +42,20 @@ public function fill(array $properties): static
4242 $ this ->addToAssertionCount (1 );
4343});
4444
45- test ('fill does not fill hubspot types ' , function (string $ type ) {
45+ test ('fill does not fill hubspot types except email ' , function (string $ type ) {
4646 $ baseData = ['test_name ' => $ this ->getName ()];
4747 $ model = (new class extends AbstractApiModel {
4848 })->fill ([$ type => sha1 (random_bytes (11 )), ...$ baseData ]);
4949
5050 $ properties = new ReflectionProperty ($ model , 'properties ' );
51- expect ($ properties ->getValue ($ model ))->toBe ($ baseData );
51+ if ($ type === 'email ' ) {
52+ expect ($ properties ->getValue ($ model ))
53+ ->toBeArray ()
54+ ->toHaveKey ('email ' )
55+ ->toHaveKey ('test_name ' );
56+ } else {
57+ expect ($ properties ->getValue ($ model ))->toBe ($ baseData );
58+ }
5259})->with ('SdkTypes-both ' );
5360
5461test ('update calls fill & save ' , function () {
@@ -104,11 +111,16 @@ protected function assertBacktraceIsUpdate(): void
104111
105112 $ model ->$ propName = $ propValue ;
106113
107- expect ($ attributes ->getValue ($ model ))
108- ->toBeArray ()
109- ->toBeEmpty ();
110- })
111- ->with ('SdkTypes-both ' );
114+ if ($ propName === 'email ' ) {
115+ expect ($ attributes ->getValue ($ model ))
116+ ->toBeArray ()
117+ ->toHaveKey ('email ' , $ propValue );
118+ } else {
119+ expect ($ attributes ->getValue ($ model ))
120+ ->toBeArray ()
121+ ->toBeEmpty ();
122+ }
123+ })->with ('SdkTypes-both ' );
112124
113125test ('builder returns api builder ' , function () {
114126 $ model = new class extends AbstractApiModel {
0 commit comments