Fix bug in test set up
authoreileen <emcnaughton@wikimedia.org>
Tue, 26 Feb 2019 16:28:08 +0000 (05:28 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 26 Feb 2019 16:28:08 +0000 (05:28 +1300)
tests/phpunit/CiviTest/CiviUnitTestCase.php

index 4b82c3f9a558d7581b0d736ab8d6783bcf7d31b7..a0f04fe81af54bcdd21cecc5bc687a573d09c2ef 100644 (file)
@@ -3396,13 +3396,13 @@ AND    ( TABLE_NAME LIKE 'civicrm_value_%' )
       ),
       $params
     );
-    $newPaymentInstrument = $this->callAPISuccess('OptionValue', 'create', $params);
+    $newPaymentInstrument = $this->callAPISuccess('OptionValue', 'create', $params)['id'];
 
     $relationTypeID = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Asset Account is' "));
 
     $financialAccountParams = [
       'entity_table' => 'civicrm_option_value',
-      'entity_id' => key($newPaymentInstrument),
+      'entity_id' => $newPaymentInstrument,
       'account_relationship' => $relationTypeID,
       'financial_account_id' => $this->callAPISuccess('FinancialAccount', 'getValue', ['name' => $financialAccountName, 'return' => 'id']),
     ];