[NFC] Fix PHP8.2 issues in the Mailing Contact Test
authorSeamus Lee <seamuslee001@gmail.com>
Fri, 10 Mar 2023 20:55:20 +0000 (07:55 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Fri, 10 Mar 2023 20:55:20 +0000 (07:55 +1100)
tests/phpunit/api/v3/MailingContactTest.php

index 9fe67eb990674aa73424e52836211a3d54244a26..f9e72752a71bc035aa5431cadb1c474504d35415 100644 (file)
@@ -24,7 +24,7 @@
  * @group headless
  */
 class api_v3_MailingContactTest extends CiviUnitTestCase {
-  protected $_entity = 'mailing';
+  protected $contact;
 
   public function setUp(): void {
     parent::setUp();
@@ -33,11 +33,11 @@ class api_v3_MailingContactTest extends CiviUnitTestCase {
       'contact_type' => 'Individual',
       'last_name' => 'xyz1',
     ];
-    $this->_contact = $this->callAPISuccess("contact", "create", $params);
+    $this->contact = $this->callAPISuccess("contact", "create", $params);
   }
 
   public function tearDown(): void {
-    $this->callAPISuccess("contact", "delete", ['id' => $this->_contact['id']]);
+    $this->callAPISuccess("contact", "delete", ['id' => $this->contact['id']]);
     parent::tearDown();
   }
 
@@ -88,7 +88,7 @@ class api_v3_MailingContactTest extends CiviUnitTestCase {
    */
   public function testMailingContactNoMailings() {
     $params = [
-      'contact_id' => $this->_contact['id'],
+      'contact_id' => $this->contact['id'],
     ];
     $result = $this->callAPISuccess('MailingContact', 'get', $params);
     $this->assertEquals($result['count'], 0);