Fix contribution page test to create & check line-items
authoreileen <emcnaughton@wikimedia.org>
Mon, 22 Aug 2016 08:22:55 +0000 (20:22 +1200)
committereileen <emcnaughton@wikimedia.org>
Mon, 22 Aug 2016 08:23:51 +0000 (20:23 +1200)
tests/phpunit/api/v3/ContributionPageTest.php

index b40d3b8a519b84f41219a7f33c727fa86c860a9e..f789eb0b89f7da0ed2557ed4ee26c89d7011e893 100644 (file)
@@ -305,7 +305,8 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
     $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
     $contribution = $this->callAPISuccess('contribution', 'getsingle', array('contribution_page_id' => $this->_ids['contribution_page']));
-    $this->callAPISuccess('membership_payment', 'getsingle', array('contribution_id' => $contribution['id']));
+    $membershipPayment = $this->callAPISuccess('membership_payment', 'getsingle', array('contribution_id' => $contribution['id']));
+    $this->callAPISuccessGetSingle('LineItem', array('contribution_id' => $contribution['id'], 'entity_id' => $membershipPayment['id']));
   }
 
   /**
@@ -837,7 +838,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
         'membership_type_id' => $membershipTypeID,
         'price_field_id' => $priceField['id'],
       ));
-      $this->_ids['price_field_value'][] = $priceFieldValue['id'];
+      $this->_ids['price_field_value'][] = $priceFieldValue;
     }
   }