Add v4 order api, access it via order
[civicrm-core.git] / tests / phpunit / api / v3 / MembershipTest.php
index f8f8e026dae36c6d47f3e7a9948593915cd413dd..83d7846f4c45af316a45a9126d6063c294c227d3 100644 (file)
@@ -315,8 +315,10 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
    * Test civicrm_membership_get with params not array.
    *
    * Gets treated as contact_id, memberships expected.
+   *
+   * @throws \CRM_Core_Exception
    */
-  public function testGetInSyntax() {
+  public function testGetInSyntax(): void {
     $this->_membershipID = $this->contactMembershipCreate($this->_params);
     $this->_membershipID2 = $this->contactMembershipCreate($this->_params);
     $this->_membershipID3 = $this->contactMembershipCreate($this->_params);
@@ -913,23 +915,6 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
     );
   }
 
-  public function testMembershipCreateWithInvalidStatus() {
-    $params = $this->_params;
-    $params['status_id'] = 999;
-    $this->callAPIFailure('membership', 'create', $params,
-      "'999' is not a valid option for field status_id"
-    );
-  }
-
-  public function testMembershipCreateWithInvalidType() {
-    $params = $this->_params;
-    $params['membership_type_id'] = 999;
-
-    $this->callAPIFailure('membership', 'create', $params,
-      "'999' is not a valid option for field membership_type_id"
-    );
-  }
-
   /**
    * Check with complete array + custom field
    * Note that the test is written on purpose without any
@@ -980,9 +965,11 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
   /**
    * Test civicrm_contact_memberships_create with membership id (edit
    * membership).
-   * success expected.
+   *
+   * @dataProvider versionThreeAndFour
    */
-  public function testMembershipCreateWithId() {
+  public function testMembershipCreateWithId($version): void {
+    $this->_apiversion = $version;
     $membershipID = $this->contactMembershipCreate($this->_params);
     $params = [
       'id' => $membershipID,