From ae8bd424d16d9a5683e43d8ce40ffc93c88c61cc Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 20 May 2019 15:32:38 +1200 Subject: [PATCH 1/3] Remove some use of dbunit from tests --- tests/phpunit/api/v3/ContactTest.php | 174 ++++++++------------------- 1 file changed, 49 insertions(+), 125 deletions(-) diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index 818068d0363a..bd178c7300ad 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -1479,16 +1479,10 @@ public function testCreateHouseholdInadequateDetails() { * Verify successful update of individual contact. */ public function testUpdateIndividualWithAll() { - // Insert a row in civicrm_contact creating individual contact. - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/contact_ind.xml' - ) - ); + $contactID = $this->individualCreate(); - $params = array( - 'id' => 23, + $params = [ + 'id' => $contactID, 'first_name' => 'abcd', 'contact_type' => 'Individual', 'nick_name' => 'This is nickname first', @@ -1500,8 +1494,7 @@ public function testUpdateIndividualWithAll() { 'external_identifier' => '1928837465', 'image_URL' => 'http://some.url.com/image.jpg', 'home_url' => 'http://www.example.org', - - ); + ]; $this->callAPISuccess('Contact', 'Update', $params); $getResult = $this->callAPISuccess('Contact', 'Get', $params); @@ -1510,50 +1503,28 @@ public function testUpdateIndividualWithAll() { //reducing this test partially back to api v2 level to get it through unset($params['home_url']); foreach ($params as $key => $value) { - $this->assertEquals($value, $getResult['values'][23][$key]); + $this->assertEquals($value, $getResult['values'][$contactID][$key]); } - // Check updated civicrm_contact against expected. - $expected = $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/contact_ind_upd.xml' - ); - $actual = new PHPUnit_Extensions_Database_DataSet_QueryDataSet( - $this->_dbconn - ); - $actual->addTable('civicrm_contact'); - $expected->matches($actual); } /** * Verify successful update of organization contact. + * + * @throws \Exception */ public function testUpdateOrganizationWithAll() { - // Insert a row in civicrm_contact creating organization contact - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/contact_org.xml' - ) - ); + $contactID = $this->organizationCreate(); - $params = array( - 'id' => 24, + $params = [ + 'id' => $contactID, 'organization_name' => 'WebAccess India Pvt Ltd', 'legal_name' => 'WebAccess', 'sic_code' => 'ABC12DEF', 'contact_type' => 'Organization', - ); + ]; $this->callAPISuccess('Contact', 'Update', $params); - - // Check updated civicrm_contact against expected. - $expected = $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/contact_org_upd.xml' - ); - $actual = new PHPUnit_Extensions_Database_DataSet_QueryDataSet( - $this->_dbconn - ); - $actual->addTable('civicrm_contact'); - $expected->matches($actual); + $this->getAndCheck($params, $contactID, 'Contact'); } /** @@ -1629,30 +1600,24 @@ private function createEmployerOfMembership() { * Verify successful update of household contact. */ public function testUpdateHouseholdWithAll() { - // Insert a row in civicrm_contact creating household contact - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/contact_hld.xml' - ) - ); + $contactID = $this->householdCreate(); - $params = array( - 'id' => 25, + $params = [ + 'id' => $contactID , 'household_name' => 'ABC household', 'nick_name' => 'ABC House', 'contact_type' => 'Household', - ); + ]; $result = $this->callAPISuccess('Contact', 'Update', $params); - $expected = array( + $expected = [ 'contact_type' => 'Household', 'is_opt_out' => 0, 'sort_name' => 'ABC household', 'display_name' => 'ABC household', 'nick_name' => 'ABC House', - ); + ]; $this->getAndCheck($expected, $result['id'], 'contact'); } @@ -1664,20 +1629,12 @@ public function testUpdateHouseholdWithAll() { * CRM-7645. */ public function testUpdateCreateWithID() { - // Insert a row in civicrm_contact creating individual contact. - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/contact_ind.xml' - ) - ); - - $params = array( - 'id' => 23, + $contactID = $this->individualCreate(); + $this->callAPISuccess('Contact', 'Update', [ + 'id' => $contactID, 'first_name' => 'abcd', 'last_name' => 'wxyz', - ); - $this->callAPISuccess('Contact', 'Update', $params); + ]); } /** @@ -1788,55 +1745,31 @@ public function testContactGetRetDefault() { * Test civicrm_contact_getquick() with empty name param. */ public function testContactGetQuick() { - // Insert a row in civicrm_contact creating individual contact. - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/contact_17.xml' - ) - ); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/email_contact_17.xml' - ) - ); - $params = array( - 'name' => "T", - ); + $contactID = $this->individualCreate(['first_name' => 'Test', 'last_name' => 'Contact', 'email' => 'TestContact@example.com']); - $result = $this->callAPISuccess('contact', 'getquick', $params); - $this->assertEquals(17, $result['values'][0]['id']); - $params = array( + $result = $this->callAPISuccess('contact', 'getquick', ['name' => 'T']); + $this->assertEquals($contactID, $result['values'][0]['id']); + $params = [ 'name' => "TestContact@example.com", 'field_name' => 'sort_name', - ); + ]; $result = $this->callAPISuccess('contact', 'getquick', $params); - $this->assertEquals(17, $result['values'][0]['id']); + $this->assertEquals($contactID, $result['values'][0]['id']); } /** * Test civicrm_contact_get) with empty params. */ public function testContactGetEmptyParams() { - $this->callAPISuccess('contact', 'get', array()); + $this->callAPISuccess('contact', 'get', []); } /** * Test civicrm_contact_get(,true) with no matches. */ public function testContactGetOldParamsNoMatches() { - // Insert a row in civicrm_contact creating contact 17. - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/contact_17.xml' - ) - ); - - $params = array( - 'first_name' => 'Fred', - ); - $result = $this->callAPISuccess('contact', 'get', $params); + $this->individualCreate(); + $result = $this->callAPISuccess('contact', 'get', ['first_name' => 'Fred']); $this->assertEquals(0, $result['count']); } @@ -1844,19 +1777,11 @@ public function testContactGetOldParamsNoMatches() { * Test civicrm_contact_get(,true) with one match. */ public function testContactGetOldParamsOneMatch() { - // Insert a row in civicrm_contact creating contact 17 - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet(dirname(__FILE__) . '/dataset/contact_17.xml' - ) - ); + $contactID = $this->individualCreate(['first_name' => 'Test', 'last_name' => 'Contact']); - $params = array( - 'first_name' => 'Test', - ); - $result = $this->callAPISuccess('contact', 'get', $params); - $this->assertEquals(17, $result['values'][17]['contact_id']); - $this->assertEquals(17, $result['id']); + $result = $this->callAPISuccess('contact', 'get', ['first_name' => 'Test']); + $this->assertEquals($contactID, $result['values'][$contactID]['contact_id']); + $this->assertEquals($contactID, $result['id']); } /** @@ -2488,11 +2413,11 @@ public function testChainingValuesCreate() { * Test TrueFalse format - I couldn't come up with an easy way to get an error on Get. */ public function testContactGetFormatIsSuccessTrue() { - $this->createContactFromXML(); + $contactID = $this->individualCreate(['first_name' => 'Test', 'last_name' => 'Contact']); $description = "This demonstrates use of the 'format.is_success' param. This param causes only the success or otherwise of the function to be returned as BOOLEAN"; $subfile = "FormatIsSuccess_True"; - $params = array('id' => 17, 'format.is_success' => 1); + $params = ['id' => $contactID, 'format.is_success' => 1]; $result = $this->callAPIAndDocument('Contact', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile); $this->assertEquals(1, $result); $this->callAPISuccess('Contact', 'Delete', $params); @@ -2562,25 +2487,24 @@ public function killTheJusticeLeague($op, $entity, $id, &$params) { * Test Single Entity format. */ public function testContactGetSingleEntityArray() { - $this->createContactFromXML(); + $contactID = $this->individualCreate(['first_name' => 'Test', 'last_name' => 'Contact']); $description = "This demonstrates use of the 'format.single_entity_array' param. This param causes the only contact to be returned as an array without the other levels. It will be ignored if there is not exactly 1 result"; $subfile = "GetSingleContact"; - $params = array('id' => 17); - $result = $this->callAPIAndDocument('Contact', 'GetSingle', $params, __FUNCTION__, __FILE__, $description, $subfile); - $this->assertEquals('Test Contact', $result['display_name']); - $this->callAPISuccess('Contact', 'Delete', $params); + $result = $this->callAPIAndDocument('Contact', 'GetSingle', ['id' => $contactID], __FUNCTION__, __FILE__, $description, $subfile); + $this->assertEquals('Mr. Test Contact II', $result['display_name']); + $this->callAPISuccess('Contact', 'Delete', ['id' => $contactID]); } /** * Test Single Entity format. */ public function testContactGetFormatCountOnly() { - $this->createContactFromXML(); + $contactID = $this->individualCreate(['first_name' => 'Test', 'last_name' => 'Contact']); $description = "This demonstrates use of the 'getCount' action. This param causes the count of the only function to be returned as an integer."; - $params = array('id' => 17); + $params = ['id' => $contactID]; $result = $this->callAPIAndDocument('Contact', 'GetCount', $params, __FUNCTION__, __FILE__, $description, 'GetCountContact'); $this->assertEquals('1', $result); @@ -2591,14 +2515,14 @@ public function testContactGetFormatCountOnly() { * Test id only format. */ public function testContactGetFormatIDOnly() { - $this->createContactFromXML(); + $contactID = $this->individualCreate(['first_name' => 'Test', 'last_name' => 'Contact']); $description = "This demonstrates use of the 'format.id_only' param. This param causes the id of the only entity to be returned as an integer. It will be ignored if there is not exactly 1 result"; $subfile = "FormatOnlyID"; - $params = array('id' => 17, 'format.only_id' => 1); + $params = ['id' => $contactID, 'format.only_id' => 1]; $result = $this->callAPIAndDocument('Contact', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile); - $this->assertEquals('17', $result); + $this->assertEquals($contactID, $result); $this->callAPISuccess('Contact', 'Delete', $params); } @@ -2606,14 +2530,14 @@ public function testContactGetFormatIDOnly() { * Test id only format. */ public function testContactGetFormatSingleValue() { - $this->createContactFromXML(); + $contactID = $this->individualCreate(['first_name' => 'Test', 'last_name' => 'Contact']); $description = "This demonstrates use of the 'format.single_value' param. This param causes only a single value of the only entity to be returned as an string. It will be ignored if there is not exactly 1 result"; $subFile = "FormatSingleValue"; - $params = array('id' => 17, 'return' => 'display_name'); + $params = ['id' => $contactID, 'return' => 'display_name']; $result = $this->callAPIAndDocument('Contact', 'getvalue', $params, __FUNCTION__, __FILE__, $description, $subFile); - $this->assertEquals('Test Contact', $result); + $this->assertEquals('Mr. Test Contact II', $result); $this->callAPISuccess('Contact', 'Delete', $params); } From ae2103eaab47e7f14b2e26ea2a287899c5d1a89b Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 20 May 2019 15:48:07 +1200 Subject: [PATCH 2/3] More dbunit removal --- .../phpunit/CRM/Utils/DeprecatedUtilsTest.php | 19 +++---------- .../api/v3/dataset/email_contact_17.xml | 28 ------------------- 2 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 tests/phpunit/api/v3/dataset/email_contact_17.xml diff --git a/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php b/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php index 9c7277504c36..e202473a214b 100644 --- a/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php +++ b/tests/phpunit/CRM/Utils/DeprecatedUtilsTest.php @@ -38,28 +38,17 @@ public function testCheckParamsWithNoContactType() { * and request the error in array format */ public function testCheckParamsWithDuplicateContact2() { - // Insert a row in civicrm_contact creating individual contact - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/../../api/v3/dataset/contact_17.xml' - ) - ); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/../../api/v3/dataset/email_contact_17.xml' - ) - ); + $this->individualCreate(['first_name' => 'Test', 'last_name' => 'Contact', 'email' => 'TestContact@example.com']); - $params = array( + $params = [ 'first_name' => 'Test', 'last_name' => 'Contact', 'email' => 'TestContact@example.com', 'contact_type' => 'Individual', - ); + ]; $contact = _civicrm_api3_deprecated_contact_check_params($params, TRUE); $this->assertEquals(1, $contact['is_error']); - $this->assertRegexp("/matching contacts.*17/s", + $this->assertRegexp("/matching contacts.*1/s", $contact['error_message']['message'] ); } diff --git a/tests/phpunit/api/v3/dataset/email_contact_17.xml b/tests/phpunit/api/v3/dataset/email_contact_17.xml deleted file mode 100644 index 4239ae0f6f20..000000000000 --- a/tests/phpunit/api/v3/dataset/email_contact_17.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - id - contact_id - location_type_id - email - is_primary - is_billing - on_hold - is_bulkmail - hold_date - reset_date - - 100 - 17 - 1 - TestContact@example.com - 1 - 1 - 0 - 0 - - - -
-
From f9a5aadd7b63cb308f4da3dfd067b266d7978e56 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 20 May 2019 16:46:07 +1200 Subject: [PATCH 3/3] Clean up groupNesting Test to not use dbunit --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 10 ++ tests/phpunit/api/v3/CustomValueTest.php | 2 +- tests/phpunit/api/v3/GroupNestingTest.php | 184 +++++++++----------- 3 files changed, 98 insertions(+), 98 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index c6c473e4303a..4afdb9b3952d 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -118,6 +118,16 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { */ private $tx = NULL; + /** + * Array of IDs created to support the test. + * + * e.g + * $this->ids = ['Contact' => ['descriptive_key' => $contactID], 'Group' => [$groupID]]; + * + * @var array + */ + protected $ids = []; + /** * Class used for hooks during tests. * diff --git a/tests/phpunit/api/v3/CustomValueTest.php b/tests/phpunit/api/v3/CustomValueTest.php index 6b29420744fe..c99b72debb03 100644 --- a/tests/phpunit/api/v3/CustomValueTest.php +++ b/tests/phpunit/api/v3/CustomValueTest.php @@ -31,7 +31,7 @@ */ class api_v3_CustomValueTest extends CiviUnitTestCase { protected $_apiversion = 3; - protected $ids; + protected $optionGroup; public $DBResetRequired = FALSE; diff --git a/tests/phpunit/api/v3/GroupNestingTest.php b/tests/phpunit/api/v3/GroupNestingTest.php index 30820f486283..5b00f456290c 100644 --- a/tests/phpunit/api/v3/GroupNestingTest.php +++ b/tests/phpunit/api/v3/GroupNestingTest.php @@ -32,171 +32,162 @@ * @group headless */ class api_v3_GroupNestingTest extends CiviUnitTestCase { - protected $_apiversion; /** * Sets up the fixture, for example, opens a network connection. + * * This method is called before a test is executed. */ protected function setUp() { - $this->_apiversion = 3; parent::setUp(); - // Insert a row in civicrm_group creating option group - // from_email_address group - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/group_admins.xml' - ) - ); - - // Insert a row in civicrm_group creating option group - // from_email_address group - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/group_subscribers.xml' - ) - ); + $this->ids['Group'] = []; + $this->ids['Group']['parent'] = $this->callAPISuccess('Group', 'create', [ + 'name' => 'Administrators', + 'title' => 'Administrators', + ])['id']; + $this->ids['Group']['child'] = $this->callAPISuccess('Group', 'create', [ + 'name' => 'Newsletter Subscribers', + 'title' => 'Newsletter Subscribers', + 'parents' => $this->ids['Group']['parent'], + ])['id']; + $this->ids['Group']['child2'] = $this->callAPISuccess('Group', 'create', [ + 'name' => 'Another Newsletter Subscribers', + 'title' => 'Another Newsletter Subscribers', + 'parents' => $this->ids['Group']['parent'], + ])['id']; + $this->ids['Group']['child3'] = $this->callAPISuccess('Group', 'create', [ + 'name' => 'Super Special Newsletter Subscribers', + 'title' => 'Super Special Newsletter Subscribers', + 'parents' => [$this->ids['Group']['parent'], $this->ids['Group']['child']], + ])['id']; - // Insert a row in civicrm_group creating option group - // from_email_address group - $op = new PHPUnit_Extensions_Database_Operation_Insert(); - $op->execute($this->_dbconn, - $this->createXMLDataSet( - dirname(__FILE__) . '/dataset/group_nesting.xml' - ) - ); } /** - * Tears down the fixture, for example, closes a network connection. + * Tears down the fixture. + * * This method is called after a test is executed. + * + * @throws \Exception */ protected function tearDown() { - // Truncate the tables $this->quickCleanup( - array( + [ 'civicrm_group', 'civicrm_group_nesting', 'civicrm_contact', 'civicrm_uf_group', 'civicrm_uf_join', 'civicrm_uf_match', - ) + ] ); } - ///////////////// civicrm_group_nesting_get methods - /** * Test civicrm_group_nesting_get. */ public function testGet() { - $params = array( - 'parent_group_id' => 1, - 'child_group_id' => 2, - ); + $params = [ + 'parent_group_id' => $this->ids['Group']['parent'], + 'child_group_id' => $this->ids['Group']['child'], + ]; $result = $this->callAPIAndDocument('group_nesting', 'get', $params, __FUNCTION__, __FILE__); - // expected data loaded in setUp - $expected = array( - 1 => array( + $expected = [ + 1 => [ 'id' => 1, - 'child_group_id' => 2, - 'parent_group_id' => 1, - ), - ); + 'child_group_id' => $this->ids['Group']['child'], + 'parent_group_id' => $this->ids['Group']['parent'], + ], + ]; $this->assertEquals($expected, $result['values']); } /** - * Test civicrm_group_nesting_get with just one - * param (child_group_id). + * Test civicrm_group_nesting_get with just one param (child_group_id). */ public function testGetWithChildGroupId() { - $params = array( - 'child_group_id' => 4, - ); + $params = [ + 'child_group_id' => $this->ids['Group']['child3'], + ]; $result = $this->callAPISuccess('group_nesting', 'get', $params); // expected data loaded in setUp - $expected = array( - 3 => array( + $expected = [ + 3 => [ 'id' => 3, - 'child_group_id' => 4, - 'parent_group_id' => 1, - ), - 4 => array( + 'child_group_id' => $this->ids['Group']['child3'], + 'parent_group_id' => $this->ids['Group']['parent'], + ], + 4 => [ 'id' => 4, - 'child_group_id' => 4, - 'parent_group_id' => 2, - ), - ); + 'child_group_id' => $this->ids['Group']['child3'], + 'parent_group_id' => $this->ids['Group']['child'], + ], + ]; $this->assertEquals($expected, $result['values']); } /** - * Test civicrm_group_nesting_get with just one - * param (parent_group_id). + * Test civicrm_group_nesting_get with just one param (parent_group_id). */ public function testGetWithParentGroupId() { - $params = array( - 'parent_group_id' => 1, - ); + $params = [ + 'parent_group_id' => $this->ids['Group']['parent'], + ]; $result = $this->callAPISuccess('group_nesting', 'get', $params); // expected data loaded in setUp - $expected = array( - 1 => array( + $expected = [ + 1 => [ 'id' => 1, - 'child_group_id' => 2, - 'parent_group_id' => 1, - ), - 2 => array( + 'child_group_id' => $this->ids['Group']['child'], + 'parent_group_id' => $this->ids['Group']['parent'], + ], + 2 => [ 'id' => 2, - 'child_group_id' => 3, - 'parent_group_id' => 1, - ), - 3 => array( + 'child_group_id' => $this->ids['Group']['child2'], + 'parent_group_id' => $this->ids['Group']['parent'], + ], + 3 => [ 'id' => 3, - 'child_group_id' => 4, - 'parent_group_id' => 1, - ), - ); + 'child_group_id' => $this->ids['Group']['child3'], + 'parent_group_id' => $this->ids['Group']['parent'], + ], + ]; $this->assertEquals($expected, $result['values']); } /** * Test civicrm_group_nesting_get for no records results. + * * Success expected. (these tests are of marginal value as are in syntax conformance, * don't copy & paste */ public function testGetEmptyResults() { - $params = array( - 'parent_group_id' => 1, + $params = [ + 'parent_group_id' => $this->ids['Group']['parent'], 'child_group_id' => 700, - ); + ]; $this->callAPISuccess('group_nesting', 'get', $params); } - ///////////////// civicrm_group_nesting_create methods - /** * Test civicrm_group_nesting_create. + * + * @throws \Exception */ public function testCreate() { - // groups id=1 and id=2 loaded in setUp - $params = array( - 'parent_group_id' => 1, - 'child_group_id' => 3, - ); + $params = [ + 'parent_group_id' => $this->ids['Group']['parent'], + 'child_group_id' => $this->ids['Group']['child2'], + ]; $this->callAPIAndDocument('group_nesting', 'create', $params, __FUNCTION__, __FILE__); $this->callAPISuccessGetCount('GroupNesting', $params, 1); @@ -206,16 +197,15 @@ public function testCreate() { * Test civicrm_group_nesting_remove. */ public function testDelete() { - // groups id=1 and id=2 loaded in setUp - $getparams = array( - 'parent_group_id' => 1, - 'child_group_id' => 2, - ); + $params = [ + 'parent_group_id' => $this->ids['Group']['parent'], + 'child_group_id' => $this->ids['Group']['child'], + ]; - $result = $this->callAPISuccess('group_nesting', 'get', $getparams); - $params = array('id' => $result['id']); + $result = $this->callAPISuccess('group_nesting', 'get', $params); + $params = ['id' => $result['id']]; $this->callAPIAndDocument('group_nesting', 'delete', $params, __FUNCTION__, __FILE__); - $this->assertEquals(0, $this->callAPISuccess('group_nesting', 'getcount', $getparams)); + $this->assertEquals(0, $this->callAPISuccess('group_nesting', 'getcount', $params)); } /** @@ -224,7 +214,7 @@ public function testDelete() { * Error expected. */ public function testDeleteWithEmptyParams() { - $this->callAPIFailure('group_nesting', 'delete', array()); + $this->callAPIFailure('group_nesting', 'delete', []); } }