From 442cf8369e28b3f40eee0126d4faef6abed0ece1 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 15 Jan 2015 20:25:34 +1300 Subject: [PATCH] comment fixes --- tests/phpunit/CRM/Contact/BAO/ContactTest.php | 21 +++++----- .../CRM/Core/BAO/ActionScheduleTest.php | 41 +++++++++++++------ .../WebTest/Event/MultiprofileEventTest.php | 2 + tests/phpunit/api/v3/ContributionTest.php | 18 ++++---- 4 files changed, 53 insertions(+), 29 deletions(-) diff --git a/tests/phpunit/CRM/Contact/BAO/ContactTest.php b/tests/phpunit/CRM/Contact/BAO/ContactTest.php index eeec7c878a..8e8b9d07b9 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactTest.php @@ -533,8 +533,9 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { } /** - * Test case for retrieve( ) - * test with all values. + * Test case for retrieve( ). + * + * Test with all values. */ public function testRetrieve() { //take the common contact params @@ -632,7 +633,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { } /** - * Test case for deleteContact( ) + * Test case for deleteContact( ). */ public function testDeleteContact() { $contactParams = $this->contactParams(); @@ -1181,7 +1182,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { } /** - * Test case for getPrimaryOpenId( ) + * Test case for getPrimaryOpenId( ). */ public function testGetPrimaryOpenId() { //get the contact params @@ -1205,7 +1206,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { } /** - * Test case for matchContactOnEmail( ) + * Test case for matchContactOnEmail( ). */ public function testMatchContactOnEmail() { //get the contact params @@ -1226,7 +1227,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { } /** - * Test case for getContactType( ) + * Test case for getContactType( ). */ public function testGetContactType() { //get the contact params @@ -1245,7 +1246,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { } /** - * Test case for displayName( ) + * Test case for displayName( ). */ public function testDisplayName() { //get the contact params @@ -1272,7 +1273,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { } /** - * Test case for getDisplayAndImage( ) + * Test case for getDisplayAndImage( ). */ public function testGetDisplayAndImage() { //get the contact params @@ -1301,7 +1302,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { } /** - * Build common params + * Build common params. */ private function contactParams() { @@ -1451,7 +1452,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { } /** - * Ensure that civicrm_contact.modified_date is updated when manipulating an email + * Ensure that civicrm_contact.modified_date is updated when manipulating an email. */ public function testTimestamps_phone() { $test = $this; diff --git a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php index 2baeca5192..8c06c18aff 100644 --- a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php +++ b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php @@ -545,6 +545,8 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { } /** + * Test end date email sent. + * * For contacts/members which match schedule based on join date, * an email should be sent. */ @@ -576,7 +578,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { } /** - * Test that the first and SECOND notifications are sent out + * Test that the first and SECOND notifications are sent out. */ public function testMembershipEndDate_Repeat() { // creates membership with end_date = 20120615 @@ -607,6 +609,8 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { } /** + * Test behaviour when date changes. + * * Test that the first notification is sent but the second is NOT sent if the end date changes in * between * see CRM-15376 @@ -632,10 +636,11 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { ), )); - //extend membership - reminder should NOT go out + // Extend membership - reminder should NOT go out. $this->callAPISuccess('membership', 'create', array('id' => $membership->id, 'end_date' => '2014-01-01')); $this->assertCronRuns(array( - array(// After the 2-week mark, send an email + array( + // After the 2-week mark, send an email. 'time' => '2012-09-12 01:00:00', 'recipients' => array(), ), @@ -643,6 +648,8 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { } /** + * Test membership end date email sends. + * * For contacts/members which match schedule based on end date, * an email should be sent. */ @@ -663,12 +670,15 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { // end_date=2012-06-15 ; schedule is 2 weeks before end_date $this->assertCronRuns(array( - array(// Before the 2-week mark, no email + array( + // Before the 2-week mark, no email. 'time' => '2012-05-31 01:00:00', - // 'time' => '2012-06-01 01:00:00', // FIXME: Is this the right boundary? + // 'time' => '2012-06-01 01:00:00', + // FIXME: Is this the right boundary? 'recipients' => array(), ), - array(// After the 2-week mark, send an email + array( + // After the 2-week mark, send an email. 'time' => '2012-06-01 01:00:00', 'recipients' => array(array('test-member@example.com')), ), @@ -677,6 +687,8 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { /** + * Test membership end date email. + * * For contacts/members which match schedule based on end date, * an email should be sent. */ @@ -697,12 +709,15 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { // end_date=2012-06-15 ; schedule is 2 weeks before end_date $this->assertCronRuns(array( - array(// Before the 2-week mark, no email + array( + // Before the 2-week mark, no email. 'time' => '2012-05-31 01:00:00', - // 'time' => '2012-06-01 01:00:00', // FIXME: Is this the right boundary? + // 'time' => '2012-06-01 01:00:00', + // FIXME: Is this the right boundary? 'recipients' => array(), ), - array(// After the 2-week mark, send an email + array( + // After the 2-week mark, send an email. 'time' => '2013-05-01 01:00:00', 'recipients' => array(), ), @@ -716,18 +731,20 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($actionSchedule); $this->assertTrue(is_numeric($actionScheduleDao->id)); $this->assertCronRuns(array( - array(// On the birthday, no email + array( + // On the birthday, no email. 'time' => '2005-07-07 01:00:00', 'recipients' => array(), ), - array(// The next day, send an email + array( + // The next day, send an email. 'time' => '2005-07-08 20:00:00', 'recipients' => array(array('test-bday@example.com')), ), )); } - public function testContactBirthDate_Anniv() { + public function testContactBirthDate_Anniversary() { $contact = $this->callAPISuccess('Contact', 'create', $this->fixtures['contact_birthdate']); $this->_testObjects['CRM_Contact_DAO_Contact'][] = $contact['id']; $actionSchedule = $this->fixtures['sched_contact_bday_anniv']; diff --git a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php index 7ec493e19b..86a26e0cf6 100644 --- a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php +++ b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php @@ -557,6 +557,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { } /** + * Test adding multiple profiles. + * * @param int $profileId * * @return null diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index d81c7a952c..6ab4bed8e0 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -586,7 +586,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { } /** - * Test note created correctly + * Test note created correctly. */ public function testCreateContributionWithNote() { $description = "Demonstrates creating contribution with Note Entity"; @@ -680,8 +680,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase { 'contact_type' => 'Individual', )); $params = $this->_params + array( - 'soft_credit_to' => $contact2['id'], - ); + 'soft_credit_to' => $contact2['id'], + ); $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile); $result = $this->callAPISuccess('contribution', 'get', array('return' => 'soft_credit', 'sequential' => 1)); @@ -702,8 +702,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase { 'contact_type' => 'Individual', )); $params = $this->_params + array( - 'honor_contact_id' => $contact2['id'], - ); + 'honor_contact_id' => $contact2['id'], + ); $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile); $result = $this->callAPISuccess('contribution', 'get', array('return' => 'soft_credit', 'sequential' => 1)); @@ -718,7 +718,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { } /** - * Test using example code + * Test using example code. */ public function testContributionCreateExample() { //make sure at least on page exists since there is a truncate in tear down @@ -782,7 +782,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { /** - * Function tests that additional financial records are created when online contribution is created + * Function tests that additional financial records are created when online contribution is created. */ public function testCreateContributionOnline() { CRM_Financial_BAO_PaymentProcessor::create($this->_processorParams); @@ -814,6 +814,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase { } /** + * Check handling of financial type. + * * In the interests of removing financial type / contribution type checks from * legacy format function lets test that the api is doing this for us */ @@ -824,6 +826,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase { } /** + * Check handling of financial type. + * * In the interests of removing financial type / contribution type checks from * legacy format function lets test that the api is doing this for us */ -- 2.25.1