From: eileen Date: Thu, 23 Mar 2017 22:04:36 +0000 (+1300) Subject: Minor test tidy up. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=62e571992b446cf11c086279330379af93d89601;p=civicrm-core.git Minor test tidy up. (this is actually because we need a commit to do a merge to master after the same commit was merged to both). --- diff --git a/tests/phpunit/api/v3/JobTest.php b/tests/phpunit/api/v3/JobTest.php index d0f78cbddc..83d24adb61 100644 --- a/tests/phpunit/api/v3/JobTest.php +++ b/tests/phpunit/api/v3/JobTest.php @@ -53,6 +53,9 @@ class api_v3_JobTest extends CiviUnitTestCase { */ public $membershipTypeID; + /** + * Set up for tests. + */ public function setUp() { parent::setUp(); $this->membershipTypeID = $this->membershipTypeCreate(array('name' => 'General')); @@ -118,21 +121,6 @@ class api_v3_JobTest extends CiviUnitTestCase { $this->assertDBState('CRM_Core_DAO_Job', $result['id'], $this->_params); } - /** - * Check with empty array. - */ - public function testDeleteEmpty() { - $params = array(); - $result = $this->callAPIFailure('job', 'delete', $params); - } - - /** - * Check with No array. - */ - public function testDeleteParamsNotArray() { - $result = $this->callAPIFailure('job', 'delete', 'string'); - } - /** * Check if required fields are not passed. */ @@ -154,7 +142,7 @@ class api_v3_JobTest extends CiviUnitTestCase { $params = array( 'id' => 'abcd', ); - $result = $this->callAPIFailure('job', 'delete', $params); + $this->callAPIFailure('job', 'delete', $params); } /** @@ -163,7 +151,7 @@ class api_v3_JobTest extends CiviUnitTestCase { public function testDelete() { $createResult = $this->callAPISuccess('job', 'create', $this->_params); $params = array('id' => $createResult['id']); - $result = $this->callAPIAndDocument('job', 'delete', $params, __FUNCTION__, __FILE__); + $this->callAPIAndDocument('job', 'delete', $params, __FUNCTION__, __FILE__); $this->assertAPIDeleted($this->_entity, $createResult['id']); } @@ -182,7 +170,7 @@ class api_v3_JobTest extends CiviUnitTestCase { * Note that this test is about tesing the metadata / calling of the function & doesn't test the success of the called function */ public function testCallUpdateGreetingSuccess() { - $result = $this->callAPISuccess($this->_entity, 'update_greeting', array( + $this->callAPISuccess($this->_entity, 'update_greeting', array( 'gt' => 'postal_greeting', 'ct' => 'Individual', )); @@ -191,7 +179,7 @@ class api_v3_JobTest extends CiviUnitTestCase { public function testCallUpdateGreetingCommaSeparatedParamsSuccess() { $gt = 'postal_greeting,email_greeting,addressee'; $ct = 'Individual,Household'; - $result = $this->callAPISuccess($this->_entity, 'update_greeting', array('gt' => $gt, 'ct' => $ct)); + $this->callAPISuccess($this->_entity, 'update_greeting', array('gt' => $gt, 'ct' => $ct)); } /** @@ -211,7 +199,7 @@ class api_v3_JobTest extends CiviUnitTestCase { for ($i = 1; $i <= $createTotal; $i++) { $contactID = $this->individualCreate(); $groupID = $this->groupCreate(array('name' => $i, 'title' => $i)); - $result = $this->callAPISuccess('action_schedule', 'create', array( + $this->callAPISuccess('action_schedule', 'create', array( 'title' => " job $i", 'subject' => "job $i", 'entity_value' => $membershipTypeID, @@ -229,7 +217,7 @@ class api_v3_JobTest extends CiviUnitTestCase { 'group_id' => $groupID, )); } - $result = $this->callAPISuccess('job', 'send_reminder', array()); + $this->callAPISuccess('job', 'send_reminder', array()); $successfulCronCount = CRM_Core_DAO::singleValueQuery("SELECT count(*) FROM civicrm_action_log"); $this->assertEquals($successfulCronCount, $createTotal); }