From fadb804f824b3fbc7a2f737cc9a4317055898b3a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 29 Jan 2014 07:35:49 +1300 Subject: [PATCH] test suite - fix signature on GroupCreate call --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 8 +++----- tests/phpunit/api/v3/ContactTest.php | 2 +- tests/phpunit/api/v3/GroupContactTest.php | 2 +- tests/phpunit/api/v3/GroupOrganizationTest.php | 2 +- tests/phpunit/api/v3/GroupTest.php | 2 +- tests/phpunit/api/v3/MailingGroupTest.php | 2 +- tests/phpunit/api/v3/MailingTest.php | 2 +- 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index bdcc2c96bb..44eeef48ab 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -1462,9 +1462,8 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * @return int groupId of created group * */ - function groupCreate($params = NULL) { - if ($params === NULL) { - $params = array( + function groupCreate($params = array()) { + $params = array_merge(array( 'name' => 'Test Group 1', 'domain_id' => 1, 'title' => 'New Test Group Created', @@ -1475,8 +1474,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { '1' => 1, '2' => 1, ), - ); - } + ), $params); $result = $this->callAPISuccess('Group', 'create', $params); return $result['id']; diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index 8627e23fed..7c1ef06a8f 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -596,7 +596,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { } function testGetGroupIDFromContact() { - $groupId = $this->groupCreate(NULL); + $groupId = $this->groupCreate(); $description = "Get all from group and display contacts"; $subfile = "GroupFilterUsingContactAPI"; $params = array( diff --git a/tests/phpunit/api/v3/GroupContactTest.php b/tests/phpunit/api/v3/GroupContactTest.php index 64966bb08e..9e69cb3c0d 100644 --- a/tests/phpunit/api/v3/GroupContactTest.php +++ b/tests/phpunit/api/v3/GroupContactTest.php @@ -70,7 +70,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { 'visibility' => 'User and User Admin Only', ); - $this->_groupId2 = $this->groupCreate($group, 3); + $this->_groupId2 = $this->groupCreate(); $params = array( 'contact_id.1' => $this->_contactId, 'group_id' => $this->_groupId2, diff --git a/tests/phpunit/api/v3/GroupOrganizationTest.php b/tests/phpunit/api/v3/GroupOrganizationTest.php index 1379e289d9..2efe9a9a89 100644 --- a/tests/phpunit/api/v3/GroupOrganizationTest.php +++ b/tests/phpunit/api/v3/GroupOrganizationTest.php @@ -53,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); } diff --git a/tests/phpunit/api/v3/GroupTest.php b/tests/phpunit/api/v3/GroupTest.php index eb28cb11ac..f9961405da 100644 --- a/tests/phpunit/api/v3/GroupTest.php +++ b/tests/phpunit/api/v3/GroupTest.php @@ -49,7 +49,7 @@ class api_v3_GroupTest extends CiviUnitTestCase { $this->_apiversion = 3; parent::setUp(); - $this->_groupID = $this->groupCreate(NULL, 3); + $this->_groupID = $this->groupCreate(); } function tearDown() { diff --git a/tests/phpunit/api/v3/MailingGroupTest.php b/tests/phpunit/api/v3/MailingGroupTest.php index 5fc25f0099..0f007479ab 100644 --- a/tests/phpunit/api/v3/MailingGroupTest.php +++ b/tests/phpunit/api/v3/MailingGroupTest.php @@ -49,7 +49,7 @@ class api_v3_MailingGroupTest extends CiviUnitTestCase { function setUp() { parent::setUp(); $this->_apiversion = 3; - $this->_groupID = $this->groupCreate(NULL); + $this->_groupID = $this->groupCreate(); $this->_email = 'test@test.test'; } diff --git a/tests/phpunit/api/v3/MailingTest.php b/tests/phpunit/api/v3/MailingTest.php index a40847fc7b..c09069d629 100644 --- a/tests/phpunit/api/v3/MailingTest.php +++ b/tests/phpunit/api/v3/MailingTest.php @@ -49,7 +49,7 @@ class api_v3_MailingTest extends CiviUnitTestCase { function setUp() { parent::setUp(); - $this->_groupID = $this->groupCreate(NULL); + $this->_groupID = $this->groupCreate(); $this->_email = 'test@test.test'; $this->_params = array( 'subject' => 'maild', -- 2.25.1