X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fapi%2Fv3%2FGroupOrganizationTest.php;h=2efe9a9a89cd0434334ef39a3c21f6b5716ccfd8;hb=fadb804f824b3fbc7a2f737cc9a4317055898b3a;hp=c4362c717048110230334076fc71a6eb11745dc9;hpb=cdeb4bdffdfc26d382057594206ed1f39721f6f6;p=civicrm-core.git diff --git a/tests/phpunit/api/v3/GroupOrganizationTest.php b/tests/phpunit/api/v3/GroupOrganizationTest.php index c4362c7170..2efe9a9a89 100644 --- a/tests/phpunit/api/v3/GroupOrganizationTest.php +++ b/tests/phpunit/api/v3/GroupOrganizationTest.php @@ -1,7 +1,7 @@ _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 */