test suite - fix signature on GroupCreate call
[civicrm-core.git] / tests / phpunit / api / v3 / GroupOrganizationTest.php
index c4362c717048110230334076fc71a6eb11745dc9..2efe9a9a89cd0434334ef39a3c21f6b5716ccfd8 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -35,7 +35,6 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  */
 class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
   protected $_apiversion;
-  public $_eNoticeCompliant = True;
 
   function get_info() {
     return array(
@@ -54,7 +53,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
   protected function setUp() {
     $this->_apiversion = 3;
     parent::setUp();
-    $this->_groupID = $this->groupCreate(NULL);
+    $this->_groupID = $this->groupCreate();
 
     $this->_orgID = $this->organizationCreate(NULL);
   }
@@ -155,6 +154,17 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
     $result = $this->callAPIAndDocument('group_organization', 'create', $params, __FUNCTION__, __FILE__);
   }
 
+  /**
+   * CRM-13841 - Load Group Org before save
+   */
+  public function testGroupOrganizationCreateTwice() {
+    $params = array(
+        'organization_id' => $this->_orgID,
+        'group_id' => $this->_groupID,    );
+    $result = $this->callAPISuccess('group_organization', 'create', $params);
+    $result2 = $this->callAPISuccess('group_organization', 'create', $params);
+    $this->assertEquals($result['values'], $result2['values']);
+  }
   /**
    * check with empty params array
    */