Test fix
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 24 May 2022 05:19:27 +0000 (17:19 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 24 May 2022 05:20:12 +0000 (17:20 +1200)
tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php

index 57ce7109044206ec6cfa0f370becb1b0d6a2cbf5..16348ad33412f11e7ee9d7ecff538fad97739a0c 100644 (file)
@@ -53,7 +53,6 @@ class CRM_Contact_Import_Parser_ContactTest extends CiviUnitTestCase {
    * @throws \API_Exception
    * @throws \CRM_Core_Exception
    * @throws \CiviCRM_API3_Exception
-   * @throws \Civi\API\Exception\UnauthorizedException
    */
   public function testImportParserWithEmployeeOfRelationship(): void {
     $this->organizationCreate([
@@ -70,15 +69,15 @@ class CRM_Contact_Import_Parser_ContactTest extends CiviUnitTestCase {
     $values = array_values($contactImportValues);
     $userJobID = $this->getUserJobID([
       'mapper' => [['first_name'], ['last_name'], ['5_a_b', 'organization_name']],
+      'onDuplicate' => CRM_Import_Parser::DUPLICATE_UPDATE,
     ]);
 
     $parser = new CRM_Contact_Import_Parser_Contact($fields);
     $parser->setUserJobID($userJobID);
-    $parser->_onDuplicate = CRM_Import_Parser::DUPLICATE_UPDATE;
     $parser->init();
 
     $this->assertEquals(CRM_Import_Parser::VALID, $parser->import(CRM_Import_Parser::DUPLICATE_UPDATE, $values), 'Return code from parser import was not as expected');
-    $this->callAPISuccess('Contact', 'get', [
+    $this->callAPISuccessGetSingle('Contact', [
       'first_name' => 'Alok',
       'last_name' => 'Patel',
       'organization_name' => 'Agileware',