dev/core#2039 Fix test to use set up method with more data integrity
authoreileen <emcnaughton@wikimedia.org>
Thu, 17 Sep 2020 04:22:20 +0000 (16:22 +1200)
committereileen <emcnaughton@wikimedia.org>
Thu, 17 Sep 2020 04:22:20 +0000 (16:22 +1200)
Using the api rather than CRM_Core_DAO::createTestObject to create the phone ensures it is created with is_primary.

We might need to fix CRM_Core_DAO::createTestObject but for this case simply using the api suffices

tests/phpunit/api/v3/ACLPermissionTest.php

index 36b2a8aea75717823f43c59dba817482c4e9834e..fdbdabea1c3c10742681bfcae5b831b5ae8649ac 100644 (file)
@@ -31,7 +31,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase {
   public function setUp() {
     parent::setUp();
     CRM_Core_DAO::createTestObject('CRM_Pledge_BAO_Pledge', [], 1, 0);
-    CRM_Core_DAO::createTestObject('CRM_Core_BAO_Phone', [], 1, 0);
+    $this->callAPISuccess('Phone', 'create', ['id' => $this->individualCreate(['email' => '']), 'phone' => '911', 'location_type_id' => 'Home']);
     $this->prepareForACLs();
   }