test fixes
authorKurund Jalmi <kurundjalmi@thirdsectordesign.org>
Tue, 19 Sep 2023 16:34:44 +0000 (17:34 +0100)
committerKurund Jalmi <kurundjalmi@thirdsectordesign.org>
Wed, 6 Dec 2023 00:23:33 +0000 (00:23 +0000)
ext/afform/mock/tests/phpunit/api/v4/Afform/AfformContactUsageTest.php

index e63c67e50dc0046a9e124ccd056abcfedcbf1b8f..06733ad126a20de90bbc2afe6a6bfb557ad9dac0 100644 (file)
@@ -179,11 +179,11 @@ EOHTML;
 
     $this->assertEquals($this->formName, $submission['afform_name']);
     $this->assertIsInt($submission['data']['Activity1'][0]['id']);
-    $this->assertEquals('Individual1', $submission['data']['Activity1'][0]['subject']);
+    $this->assertEquals('Individual1', $submission['data']['Activity1'][0]['fields']['subject']);
     $this->assertIsInt($submission['data']['Individual1'][0]['id']);
-    $this->assertEquals($firstName, $submission['data']['Individual1'][0]['first_name']);
-    $this->assertEquals('site', $submission['data']['Individual1'][0]['last_name']);
-    $this->assertEquals('This field is set in the data array', $submission['data']['Individual1'][0]['source']);
+    $this->assertEquals($firstName, $submission['data']['Individual1'][0]['fields']['first_name']);
+    $this->assertEquals('site', $submission['data']['Individual1'][0]['fields']['last_name']);
+    $this->assertEquals('This field is set in the data array', $submission['data']['Individual1'][0]['fields']['source']);
 
     // Check that Activity was submitted correctly.
     $activity = \Civi\Api4\Activity::get(FALSE)
@@ -392,7 +392,7 @@ EOHTML;
       ->execute()->single();
     $this->assertEquals($contact['id'], $submission['data']['Individual1'][0]['id']);
     $this->assertEquals($contact['org.id'], $submission['data']['Organization1'][0]['id']);
-    $this->assertEquals('Organization1', $submission['data']['Individual1'][0]['employer_id']);
+    $this->assertEquals('Organization1', $submission['data']['Individual1'][0]['fields']['employer_id']);
     $this->assertEquals($contact['email_primary'], $submission['data']['Individual1'][0]['joins']['Email'][0]['id']);
     $this->assertEquals($individualEmail, $submission['data']['Individual1'][0]['joins']['Email'][0]['email']);
     $this->assertEquals($locationType, $submission['data']['Individual1'][0]['joins']['Email'][0]['location_type_id']);