INFRA-132 - tests/ - phpcbf
authorTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 21:42:38 +0000 (13:42 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 23:07:46 +0000 (15:07 -0800)
261 files changed:
tests/phpunit/AllTests.php
tests/phpunit/CRM/Activity/AllTests.php
tests/phpunit/CRM/Activity/BAO/ActivityAssignmentTest.php
tests/phpunit/CRM/Activity/BAO/ActivityTargetTest.php
tests/phpunit/CRM/AllTests.php
tests/phpunit/CRM/Batch/Form/EntryTest.php
tests/phpunit/CRM/Bridge/OG/DrupalTest.php
tests/phpunit/CRM/Case/AllTests.php
tests/phpunit/CRM/Contact/AllTests.php
tests/phpunit/CRM/Contact/BAO/ContactTest.php
tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php
tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php
tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php
tests/phpunit/CRM/Contact/BAO/GroupContactTest.php
tests/phpunit/CRM/Contact/BAO/GroupTest.php
tests/phpunit/CRM/Contact/BAO/QueryTest.php
tests/phpunit/CRM/Contact/BAO/QueryTestDataProvider.php
tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php
tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTestDataProvider.php
tests/phpunit/CRM/Contribute/AllTests.php
tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php
tests/phpunit/CRM/Contribute/BAO/ContributionTest.php
tests/phpunit/CRM/Core/AllTests.php
tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php
tests/phpunit/CRM/Core/BAO/AddressTest.php
tests/phpunit/CRM/Core/BAO/CustomFieldTest.php
tests/phpunit/CRM/Core/BAO/CustomGroupTest.php
tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php
tests/phpunit/CRM/Core/BAO/CustomValueTest.php
tests/phpunit/CRM/Core/BAO/LocationTest.php
tests/phpunit/CRM/Core/BAO/PhoneTest.php
tests/phpunit/CRM/Core/BAO/RecurringEntityTest.php
tests/phpunit/CRM/Core/BAO/SettingTest.php
tests/phpunit/CRM/Core/BAO/UFFieldTest.php
tests/phpunit/CRM/Core/Config/MailerTest.php
tests/phpunit/CRM/Core/ErrorTest.php
tests/phpunit/CRM/Core/ManagedEntitiesTest.php
tests/phpunit/CRM/Core/Page/AJAXTest.php
tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php
tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php
tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php
tests/phpunit/CRM/Core/RegionTest.php
tests/phpunit/CRM/Core/ResourcesTest.php
tests/phpunit/CRM/Core/TransactionTest.php
tests/phpunit/CRM/Dedupe/DedupeFinderTest.php
tests/phpunit/CRM/Event/AllTests.php
tests/phpunit/CRM/Event/BAO/ParticipantStatusTest.php
tests/phpunit/CRM/Extension/AllTests.php
tests/phpunit/CRM/Extension/Container/AllTests.php
tests/phpunit/CRM/Extension/Manager/AllTests.php
tests/phpunit/CRM/Extension/Manager/ModuleTest.php
tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php
tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php
tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php
tests/phpunit/CRM/Group/Page/AjaxTest.php
tests/phpunit/CRM/Mailing/BAO/QueryTest.php
tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php
tests/phpunit/CRM/Mailing/BAO/SpoolTest.php
tests/phpunit/CRM/Member/AllTests.php
tests/phpunit/CRM/Member/BAO/MembershipLogTest.php
tests/phpunit/CRM/Member/BAO/MembershipTest.php
tests/phpunit/CRM/Member/Form/AllTests.php
tests/phpunit/CRM/Member/Form/MembershipTest.php
tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php
tests/phpunit/CRM/PCP/BAO/PCPTest.php
tests/phpunit/CRM/Pledge/AllTests.php
tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php
tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php
tests/phpunit/CRM/Pledge/BAO/PledgeTest.php
tests/phpunit/CRM/Queue/AllTests.php
tests/phpunit/CRM/Queue/Queue/AllTests.php
tests/phpunit/CRM/Utils/ArrayTest.php
tests/phpunit/CRM/Utils/Cache/AllTests.php
tests/phpunit/CRM/Utils/MailTest.php
tests/phpunit/CRM/Utils/NumberTest.php
tests/phpunit/CRM/Utils/QueryFormatterTest.php
tests/phpunit/CRM/Utils/SQL/InsertTest.php
tests/phpunit/CRM/Utils/SQL/SelectTest.php
tests/phpunit/CRM/Utils/StringTest.php
tests/phpunit/CRM/Utils/SystemTest.php
tests/phpunit/CRM/Utils/versionCheckTest.php
tests/phpunit/Civi/AllTests.php
tests/phpunit/CiviTest/CiviDBAssert.php
tests/phpunit/CiviTest/CiviMailUtils.php
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/CiviTest/CiviUnitTestCase.php
tests/phpunit/CiviTest/Custom.php
tests/phpunit/CiviTest/Event.php
tests/phpunit/CiviTest/PCP.php
tests/phpunit/CiviTest/bootstrap.php
tests/phpunit/CiviTest/civicrm.settings.dist.php
tests/phpunit/Utils.php
tests/phpunit/WebTest/Activity/AddRecurringActivityTest.php
tests/phpunit/WebTest/Activity/ContactContextAddTest.php
tests/phpunit/WebTest/Activity/IcalTest.php
tests/phpunit/WebTest/Activity/StandaloneAddTest.php
tests/phpunit/WebTest/Admin/MoveCustomDataTest.php
tests/phpunit/WebTest/AllTests.php
tests/phpunit/WebTest/Campaign/ActivityTest.php
tests/phpunit/WebTest/Campaign/MailingTest.php
tests/phpunit/WebTest/Campaign/OfflineContributionTest.php
tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php
tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php
tests/phpunit/WebTest/Case/ActivityToCaseTest.php
tests/phpunit/WebTest/Case/AddCaseTest.php
tests/phpunit/WebTest/Case/AddCaseTypeTest.php
tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php
tests/phpunit/WebTest/Contact/AddContactsToEventAdvancedSearchTest.php
tests/phpunit/WebTest/Contact/AddTest.php
tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php
tests/phpunit/WebTest/Contact/AdvancedSearchTest.php
tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php
tests/phpunit/WebTest/Contact/ContactTagTest.php
tests/phpunit/WebTest/Contact/CustomDataAddTest.php
tests/phpunit/WebTest/Contact/DupeContactTest.php
tests/phpunit/WebTest/Contact/EditContactTest.php
tests/phpunit/WebTest/Contact/GroupAddTest.php
tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php
tests/phpunit/WebTest/Contact/MergeContactsTest.php
tests/phpunit/WebTest/Contact/MultipleContactSubTypes.php
tests/phpunit/WebTest/Contact/RelationshipAddTest.php
tests/phpunit/WebTest/Contact/SearchTest.php
tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php
tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php
tests/phpunit/WebTest/Contact/UpdateProfileTest.php
tests/phpunit/WebTest/Contribute/AddBatchesTest.php
tests/phpunit/WebTest/Contribute/ContactContextAddTest.php
tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php
tests/phpunit/WebTest/Contribute/OfflineContributionTest.php
tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php
tests/phpunit/WebTest/Contribute/OnlineContributionTest.php
tests/phpunit/WebTest/Contribute/StandaloneAddTest.php
tests/phpunit/WebTest/Contribute/UpdateContributionTest.php
tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php
tests/phpunit/WebTest/Contribute/VerifySSLContributionTest.php
tests/phpunit/WebTest/Event/AddEventTest.php
tests/phpunit/WebTest/Event/AddParticipationTest.php
tests/phpunit/WebTest/Event/AddPricesetTest.php
tests/phpunit/WebTest/Event/AdditionalPaymentTest.php
tests/phpunit/WebTest/Event/PCPAddTest.php
tests/phpunit/WebTest/Event/ParticipantSearchTest.php
tests/phpunit/WebTest/Export/ContactTest.php
tests/phpunit/WebTest/Export/ExportCiviSeleniumTestCase.php
tests/phpunit/WebTest/Financial/FinancialAccountTest.php
tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php
tests/phpunit/WebTest/Generic/CheckActivityTest.php
tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php
tests/phpunit/WebTest/Import/AddressImportTest.php
tests/phpunit/WebTest/Import/AddressParsingTest.php
tests/phpunit/WebTest/Import/ContactCustomDataTest.php
tests/phpunit/WebTest/Import/ContactSubtypeTest.php
tests/phpunit/WebTest/Import/ContactTest.php
tests/phpunit/WebTest/Import/DateFormatTest.php
tests/phpunit/WebTest/Import/DuplicateMatchingTest.php
tests/phpunit/WebTest/Import/GroupTest.php
tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php
tests/phpunit/WebTest/Import/MatchExternalIdTest.php
tests/phpunit/WebTest/Import/MultipleRelationshipTest.php
tests/phpunit/WebTest/Mailing/AddNewMailingComponentTest.php
tests/phpunit/WebTest/Mailing/MailingTest.php
tests/phpunit/WebTest/Mailing/SpoolTest.php
tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php
tests/phpunit/WebTest/Member/FixedMembershipTypeTest.php
tests/phpunit/WebTest/Member/InheritedMembershipTest.php
tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php
tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php
tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipGCTest.php
tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipTest.php
tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php
tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php
tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php
tests/phpunit/WebTest/Member/StandaloneAddTest.php
tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php
tests/phpunit/WebTest/Pledge/ContactContextAddTest.php
tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php
tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php
tests/phpunit/WebTest/Pledge/StandaloneAddTest.php
tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php
tests/phpunit/WebTest/Profile/ProfileAddTest.php
tests/phpunit/WebTest/Profile/ProfileCountryState.php
tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php
tests/phpunit/WebTest/Release/ReleaseTestCase.php
tests/phpunit/WebTest/Report/AddTest.php
tests/phpunit/WebTest/Report/LoggingReportTest.php
tests/phpunit/api/v3/ACLCachingTest.php
tests/phpunit/api/v3/ACLPermissionTest.php
tests/phpunit/api/v3/APIStandardsTest.php
tests/phpunit/api/v3/APITest.php
tests/phpunit/api/v3/ActionScheduleTest.php
tests/phpunit/api/v3/ActivityContactTest.php
tests/phpunit/api/v3/ActivityTest.php
tests/phpunit/api/v3/ActivityTypeTest.php
tests/phpunit/api/v3/AddressTest.php
tests/phpunit/api/v3/AllTests.php
tests/phpunit/api/v3/BatchTest.php
tests/phpunit/api/v3/CRM11793Test.php
tests/phpunit/api/v3/CaseTest.php
tests/phpunit/api/v3/CaseTypeTest.php
tests/phpunit/api/v3/ConstantTest.php
tests/phpunit/api/v3/ContactTest.php
tests/phpunit/api/v3/ContactTypeTest.php
tests/phpunit/api/v3/ContributionPageTest.php
tests/phpunit/api/v3/ContributionRecurTest.php
tests/phpunit/api/v3/ContributionSoftTest.php
tests/phpunit/api/v3/ContributionTest.php
tests/phpunit/api/v3/CountryTest.php
tests/phpunit/api/v3/CustomFieldTest.php
tests/phpunit/api/v3/CustomGroupTest.php
tests/phpunit/api/v3/CustomValueContactTypeTest.php
tests/phpunit/api/v3/CustomValueTest.php
tests/phpunit/api/v3/DomainTest.php
tests/phpunit/api/v3/EmailTest.php
tests/phpunit/api/v3/EventTest.php
tests/phpunit/api/v3/GrantTest.php
tests/phpunit/api/v3/GroupContactTest.php
tests/phpunit/api/v3/GroupNestingTest.php
tests/phpunit/api/v3/GroupOrganizationTest.php
tests/phpunit/api/v3/GroupTest.php
tests/phpunit/api/v3/ImTest.php
tests/phpunit/api/v3/JobProcessMailingTest.php
tests/phpunit/api/v3/JobTest.php
tests/phpunit/api/v3/LineItemTest.php
tests/phpunit/api/v3/LocBlockTest.php
tests/phpunit/api/v3/MailingContactTest.php
tests/phpunit/api/v3/MailingGroupTest.php
tests/phpunit/api/v3/MailingTest.php
tests/phpunit/api/v3/MembershipPaymentTest.php
tests/phpunit/api/v3/MembershipStatusTest.php
tests/phpunit/api/v3/MembershipTest.php
tests/phpunit/api/v3/MembershipTypeTest.php
tests/phpunit/api/v3/MessageTemplateTest.php
tests/phpunit/api/v3/NoteTest.php
tests/phpunit/api/v3/OptionGroupTest.php
tests/phpunit/api/v3/OptionValueTest.php
tests/phpunit/api/v3/ParticipantPaymentTest.php
tests/phpunit/api/v3/ParticipantStatusTypeTest.php
tests/phpunit/api/v3/ParticipantTest.php
tests/phpunit/api/v3/PaymentProcessorTypeTest.php
tests/phpunit/api/v3/PhoneTest.php
tests/phpunit/api/v3/PledgePaymentTest.php
tests/phpunit/api/v3/PledgeTest.php
tests/phpunit/api/v3/PriceFieldTest.php
tests/phpunit/api/v3/PriceFieldValueTest.php
tests/phpunit/api/v3/PriceSetTest.php
tests/phpunit/api/v3/ProductTest.php
tests/phpunit/api/v3/ProfileTest.php
tests/phpunit/api/v3/RelationshipTest.php
tests/phpunit/api/v3/RelationshipTypeTest.php
tests/phpunit/api/v3/ReportTemplateTest.php
tests/phpunit/api/v3/SettingTest.php
tests/phpunit/api/v3/SurveyRespondantTest.php
tests/phpunit/api/v3/SurveyTest.php
tests/phpunit/api/v3/SyntaxConformanceTest.php
tests/phpunit/api/v3/TagTest.php
tests/phpunit/api/v3/TaxContributionPageTest.php
tests/phpunit/api/v3/UFGroupTest.php
tests/phpunit/api/v3/UFJoinTest.php
tests/phpunit/api/v3/UFMatchTest.php
tests/phpunit/api/v3/UtilsTest.php
tests/phpunit/api/v3/WebsiteTest.php
tests/phpunit/api/v3/settings/test.setting.php

index 2aeb46dd40e632b31ddc71c487ea2b635dd7e147..7d73bf1915d541ac9d619b36e95e4a69d2d0dd0b 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 3d80d7a12609320afcb654ac9a1afd9e843139ee..68509919b61b2b2015dbab81da9894ca97766d46 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Activity_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index a70305e02cff08eb3d9f00e559d070d20dbc238f..3ce03b0314e8d2cd0e4bc968f43b0e58b99971b8 100644 (file)
@@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for CRM_Activity_BAO_ActivityAssignment BAO
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Activity_BAO_ActivityAssignmentTest extends CiviUnitTestCase {
 
@@ -49,7 +49,8 @@ class CRM_Activity_BAO_ActivityAssignmentTest extends CiviUnitTestCase {
    * This method is called after a test is executed.
    *
    */
-  protected function tearDown() {}
+  protected function tearDown() {
+  }
 
   /**
    *  Pass zero as an id and make sure no Assignees are retrieved
@@ -66,7 +67,7 @@ class CRM_Activity_BAO_ActivityAssignmentTest extends CiviUnitTestCase {
    */
   public function testRetrieveAssigneeIdsByActivityIdNullId() {
     $activity = $this->activityCreate();
-    $activityId = CRM_Activity_BAO_ActivityAssignment::retrieveAssigneeIdsByActivityId(Null);
+    $activityId = CRM_Activity_BAO_ActivityAssignment::retrieveAssigneeIdsByActivityId(NULL);
 
     $this->assertEquals(count($activityId), 0, '0 assignees retrieved using null');
   }
@@ -106,7 +107,7 @@ class CRM_Activity_BAO_ActivityAssignmentTest extends CiviUnitTestCase {
    */
   public function testGetAssigneeNamesNullId() {
     $activity = $this->activityCreate();
-    $assignees = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames(Null);
+    $assignees = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames(NULL);
 
     $this->assertEquals(count($assignees), 0, '0 assignee names retrieved');
   }
index bc13f61c7222329046b9bed6943dcc436a6dba99..5f43b66c27127de06885dc26284d175cd28fb287 100644 (file)
@@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for CRM_Activity_BAO_ActivityTarget BAO
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Activity_BAO_ActivityTargetTest extends CiviUnitTestCase {
 
@@ -49,7 +49,8 @@ class CRM_Activity_BAO_ActivityTargetTest extends CiviUnitTestCase {
    * This method is called after a test is executed.
    *
    */
-  protected function tearDown() {}
+  protected function tearDown() {
+  }
 
   public function testRetrieveTargetIdsByActivityIdZeroID() {
     $activity = $this->activityCreate();
index b177161be12f7d30fac54a2fadaa0e285295dd59..f42d8f1a1cb48e35634347e8b01e1dab76b0d0c9 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all CRM test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index a9d10768291918f57871234e504913b09660b78b..d7b6f47232631cb3152c0ed7ce0fed5754a65494 100644 (file)
@@ -5,7 +5,7 @@
  *
  *  (PHP 5)
  *
- *   @package   CiviCRM
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -30,7 +30,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test CRM/Member/BAO Membership Log add , delete functions
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
 
@@ -184,11 +184,11 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
     $result = $this->callAPISuccess('contribution', 'get', array('return' => 'total_amount'));
     $this->assertEquals(2, $result['count']);
     foreach($result['values'] as $contribution) {
-     $this-> assertEquals($this->callAPISuccess('line_item', 'getvalue', array(
+      $this-> assertEquals($this->callAPISuccess('line_item', 'getvalue', array(
        'contribution_id' => $contribution['id'],
        'return' => 'line_total',
 
-     )), $contribution['total_amount']);
+      )), $contribution['total_amount']);
     }
   }
   /**
@@ -200,14 +200,14 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
     return array(
       'batch_id' => 4,
       'primary_profiles' => array(1 => NULL, 2 => NULL, 3 => NULL),
-      'primary_contact_id' => Array (
+      'primary_contact_id' => array(
         1 => $this->_contactID,
         2 => $this->_contactID2,
         3 => $this->_contactID3,
         ),
       'field' => array(
         1 => array(
-          'membership_type' => Array (0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
+          'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
           'join_date' => '07/22/2013',
           'membership_start_date' => NULL,
           'membership_end_date' => NULL,
@@ -221,7 +221,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
           'contribution_status_id' => 1,
         ),
       2 => array(
-        'membership_type' => Array (0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
+        'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
         'join_date' => '07/03/2013',
         'membership_start_date' => '02/03/2013',
         'membership_end_date' => NULL,
@@ -236,7 +236,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
        ),
         // no join date, coded end date
        3 => array(
-         'membership_type' => Array (0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
+         'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
          'join_date' => NULL,
          'membership_start_date' => NULL,
          'membership_end_date' => '2013-12-01',
@@ -263,7 +263,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
     return array(
       //'batch_id' => 4,
       'primary_profiles' => array(1 => NULL, 2 => NULL, 3 => NULL),
-      'primary_contact_id' => Array (
+      'primary_contact_id' => array(
         1 => $this->_contactID,
         2 => $this->_contactID2,
         3 => $this->_contactID3,
index aac0f28e7c9ded1a835f3d5c3e90d7cca79692ae..e2125f7263498a93b4c9229b988e5b253ccd55eb 100644 (file)
@@ -6,10 +6,10 @@
  *
  *  (PHP 5)
  *
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @package CiviCRM
+ * @package CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -37,7 +37,7 @@ require_once 'api/api.php';
 /**
  *  Test contact custom search functions
  *
- *  @package CiviCRM
+ * @package CiviCRM
  */
 class CRM_Bridge_OG_DrupalTest extends CiviUnitTestCase {
   /*
index d0f255d3d2d1274e4e0c512babe452cdaa3dd71d..e04d6ed59f0cb103be62760f5f644bf3b343b074 100644 (file)
@@ -8,7 +8,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Case_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 8ae18fe57e88712331f71c2290450420d38b8013..22e4ee421ad36328eb6e869babad84ae17323730 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Contacts_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index af8525b718ba166cfde4be2f2b5a1f0ae9f0da30..39de0fa11dc17fd47dd66e3e224c6abb7994190e 100644 (file)
@@ -16,7 +16,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
    * test with empty params.
    */
   public function testAddWithEmptyParams() {
-    $params = array( );
+    $params = array();
     $contact = CRM_Contact_BAO_Contact::add($params);
 
     //Now check Contact object
@@ -331,7 +331,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
       'location_type_id' => 1,
       'is_primary' => 1,
     );
-    $compareParams = array('street_address' => CRM_Utils_Array::value('street_address', $params['address'][1]),
+    $compareParams = array(
+    'street_address' => CRM_Utils_Array::value('street_address', $params['address'][1]),
       'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1',
         $params['address'][1]
       ),
@@ -358,7 +359,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     $this->assertDBCompareValues('CRM_Core_DAO_OpenID', $searchParams, $compareParams);
 
     //Now check DB for IM
-    $compareParams = array('name' => CRM_Utils_Array::value('name', $params['im'][1]),
+    $compareParams = array(
+    'name' => CRM_Utils_Array::value('name', $params['im'][1]),
       'provider_id' => CRM_Utils_Array::value('provider_id', $params['im'][1]),
     );
     $this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
@@ -491,7 +493,6 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     //delete all notes related to contact
     CRM_Core_BAO_Note::cleanContactNotes($contactId);
 
-
     //cleanup DB by deleting the contact
     Contact::delete($contactId);
     $this->quickCleanup(array('civicrm_contact', 'civicrm_note'));
@@ -628,7 +629,6 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     //delete all notes related to contact
     CRM_Core_BAO_Note::cleanContactNotes($contactId);
 
-
     //cleanup DB by deleting the contact
     Contact::delete($contactId);
     $this->quickCleanup(array('civicrm_contact'));
@@ -699,7 +699,6 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
       'id', 'openid', 'Database check, openId deleted successfully.'
     );
 
-
     // Check that the custom field value is no longer present
     $params = array(
       'entityID' => $contactId,
@@ -824,7 +823,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     );
 
     $dbPrefComm = explode(CRM_Core_DAO::VALUE_SEPARATOR,
-                  CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactId, 'preferred_communication_method', 'id', true)
+                  CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactId, 'preferred_communication_method', 'id', TRUE)
     );
     $checkPrefComm = array();
     foreach ($dbPrefComm as $key => $value) {
@@ -840,7 +839,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
       'location_type_id' => 1,
       'is_primary' => 1,
     );
-    $compareParams = array('street_address' => CRM_Utils_Array::value('street_address-Primary', $profileParams),
+    $compareParams = array(
+    'street_address' => CRM_Utils_Array::value('street_address-Primary', $profileParams),
       'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1-Primary', $profileParams),
       'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2-Primary', $profileParams),
       'city' => CRM_Utils_Array::value('city-Primary', $profileParams),
@@ -857,7 +857,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     $this->assertDBCompareValues('CRM_Core_DAO_Email', $searchParams, $compareParams);
 
     //Now check DB for IM
-    $compareParams = array('name' => CRM_Utils_Array::value('im-Primary', $profileParams),
+    $compareParams = array(
+    'name' => CRM_Utils_Array::value('im-Primary', $profileParams),
       'provider_id' => CRM_Utils_Array::value('im-Primary-provider_id', $profileParams),
     );
     $this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
@@ -1026,7 +1027,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     );
 
     $dbPrefComm = explode(CRM_Core_DAO::VALUE_SEPARATOR,
-                  CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactId, 'preferred_communication_method', 'id', true)
+                  CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactId, 'preferred_communication_method', 'id', TRUE)
     );
     $checkPrefComm = array();
     foreach ($dbPrefComm as $key => $value) {
@@ -1042,7 +1043,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
       'location_type_id' => 1,
       'is_primary' => 1,
     );
-    $compareParams = array('street_address' => CRM_Utils_Array::value('street_address-Primary', $updatePfParams),
+    $compareParams = array(
+    'street_address' => CRM_Utils_Array::value('street_address-Primary', $updatePfParams),
       'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1-Primary', $updatePfParams),
       'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2-Primary', $updatePfParams),
       'city' => CRM_Utils_Array::value('city-Primary', $updatePfParams),
@@ -1059,7 +1061,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     $this->assertDBCompareValues('CRM_Core_DAO_Email', $searchParams, $compareParams);
 
     //Now check DB for IM
-    $compareParams = array('name' => CRM_Utils_Array::value('im-Primary', $updatePfParams),
+    $compareParams = array(
+    'name' => CRM_Utils_Array::value('im-Primary', $updatePfParams),
       'provider_id' => CRM_Utils_Array::value('im-Primary-provider_id', $updatePfParams),
     );
     $this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
@@ -1394,7 +1397,6 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
       'email' => 'john.smith@example.org',
     );
 
-
     $params['phone'] = array();
     $params['phone'][1] = array(
       'location_type_id' => 1,
@@ -1432,15 +1434,15 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   public function testTimestamps_contact() {
     $test = $this;
     $this->_testTimestamps(array(
-      'UPDATE' => function ($contactId) use ($test) {
-        $params = array(
+    'UPDATE' => function ($contactId) use ($test) {
+      $params = array(
           'first_name' => 'Testing',
           'contact_type' => 'Individual',
           'contact_id' => $contactId,
         );
-        $contact = CRM_Contact_BAO_Contact::add($params);
-        $test->assertInstanceOf('CRM_Contact_DAO_Contact', $contact, 'Check for created object');
-      },
+      $contact = CRM_Contact_BAO_Contact::add($params);
+      $test->assertInstanceOf('CRM_Contact_DAO_Contact', $contact, 'Check for created object');
+    },
     ));
   }
 
@@ -1450,33 +1452,33 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   public function testTimestamps_email() {
     $test = $this;
     $this->_testTimestamps(array(
-      'INSERT' => function ($contactId) use ($test) {
-        $params = array(
+    'INSERT' => function ($contactId) use ($test) {
+      $params = array(
           'email' => 'ex-1@example.com',
           'is_primary' => 1,
           'location_type_id' => 1,
           'contact_id' => $contactId,
         );
-        CRM_Core_BAO_Email::add($params);
-        $test->assertDBQuery('ex-1@example.com',
+      CRM_Core_BAO_Email::add($params);
+      $test->assertDBQuery('ex-1@example.com',
           'SELECT email FROM civicrm_email WHERE contact_id = %1 ORDER BY id DESC LIMIT 1',
           array(1 => array($contactId, 'Integer'))
         );
-      },
+    },
 
-      'UPDATE' => function ($contactId) use ($test) {
-        CRM_Core_DAO::executeQuery(
+    'UPDATE' => function ($contactId) use ($test) {
+      CRM_Core_DAO::executeQuery(
           'UPDATE civicrm_email SET email = "ex-2@example.com" WHERE contact_id = %1',
           array(1 => array($contactId, 'Integer'))
         );
-      },
+    },
 
-      'DELETE' => function ($contactId) use ($test) {
-        CRM_Core_DAO::executeQuery(
+    'DELETE' => function ($contactId) use ($test) {
+      CRM_Core_DAO::executeQuery(
           'DELETE FROM civicrm_email WHERE contact_id = %1',
           array(1 => array($contactId, 'Integer'))
         );
-      },
+    },
     ));
   }
 
@@ -1486,33 +1488,33 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   public function testTimestamps_phone() {
     $test = $this;
     $this->_testTimestamps(array(
-      'INSERT' => function ($contactId) use ($test) {
-        $params = array(
+    'INSERT' => function ($contactId) use ($test) {
+      $params = array(
           'phone' => '202-555-1000',
           'is_primary' => 1,
           'location_type_id' => 1,
           'contact_id' => $contactId,
         );
-        CRM_Core_BAO_Phone::add($params);
-        $test->assertDBQuery('202-555-1000',
+      CRM_Core_BAO_Phone::add($params);
+      $test->assertDBQuery('202-555-1000',
           'SELECT phone FROM civicrm_phone WHERE contact_id = %1 ORDER BY id DESC LIMIT 1',
           array(1 => array($contactId, 'Integer'))
         );
-      },
+    },
 
-      'UPDATE' => function ($contactId) use ($test) {
-        CRM_Core_DAO::executeQuery(
+    'UPDATE' => function ($contactId) use ($test) {
+      CRM_Core_DAO::executeQuery(
           'UPDATE civicrm_phone SET phone = "202-555-2000" WHERE contact_id = %1',
           array(1 => array($contactId, 'Integer'))
         );
-      },
+    },
 
-      'DELETE' => function ($contactId) use ($test) {
-        CRM_Core_DAO::executeQuery(
+    'DELETE' => function ($contactId) use ($test) {
+      CRM_Core_DAO::executeQuery(
           'DELETE FROM civicrm_phone WHERE contact_id = %1',
           array(1 => array($contactId, 'Integer'))
         );
-      },
+    },
     ));
   }
 
@@ -1532,24 +1534,24 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     $customField = $customField['values'][$customField['id']];
     $test = $this;
     $this->_testTimestamps(array(
-      'INSERT' => function ($contactId) use ($test, $customGroup, $customField) {
-        $result = civicrm_api3('contact', 'create', array(
+    'INSERT' => function ($contactId) use ($test, $customGroup, $customField) {
+      $result = civicrm_api3('contact', 'create', array(
           'contact_id' => $contactId,
           'custom_' . $customField['id'] => 'test-1',
         ));
-      },
-      'UPDATE' => function ($contactId) use ($test, $customGroup, $customField) {
-        CRM_Core_DAO::executeQuery(
+    },
+    'UPDATE' => function ($contactId) use ($test, $customGroup, $customField) {
+      CRM_Core_DAO::executeQuery(
           "UPDATE {$customGroup->table_name} SET {$customField['column_name']} = 'test-2' WHERE entity_id = %1",
           array(1 => array($contactId, 'Integer'))
         );
-      },
-      'DELETE' => function ($contactId) use ($test, $customGroup, $customField) {
-        CRM_Core_DAO::executeQuery(
+    },
+    'DELETE' => function ($contactId) use ($test, $customGroup, $customField) {
+      CRM_Core_DAO::executeQuery(
           "DELETE FROM {$customGroup->table_name} WHERE entity_id = %1",
           array(1 => array($contactId, 'Integer'))
         );
-      },
+    },
     ));
 
     Custom::deleteGroup($customGroup);
index 0408c5d6e1f47d8087c26707d02dbf5fa804e9b8..c232424923095ff331ca89b79817695d7525e7d7 100644 (file)
@@ -42,7 +42,6 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase {
     $result = CRM_Contact_BAO_ContactType::add($params);
     $this->sponsor = $params['name'];
 
-
     $this->indiviParams = array(
       'first_name' => 'Anne',
       'last_name' => 'Grant',
@@ -253,25 +252,21 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase {
     $result   = civicrm_api('contact', 'get', $params);
     $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
 
-
     // for invalid subtype
     $params = array('contact_sub_type' => 'Invalid', 'version' => 3);
     $result = civicrm_api('contact', 'get', $params);
     $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
 
-
     // for invalid contact type as well as subtype
     $params = array('contact_type' => 'Invalid' . CRM_Core_DAO::VALUE_SEPARATOR . 'Invalid', 'version' => 3);
     $result = civicrm_api('contact', 'get', $params);
     $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
 
-
     // for valid type and invalid subtype
     $params = array('contact_type' => 'Individual' . CRM_Core_DAO::VALUE_SEPARATOR . 'Invalid', 'version' => 3);
     $result = civicrm_api('contact', 'get', $params);
     $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
 
-
     // for invalid type and valid subtype
     $params = array('contact_type' => 'Invalid' . CRM_Core_DAO::VALUE_SEPARATOR . 'indivi_student', 'version' => 3);
     $result = civicrm_api('contact', 'get', $params);
@@ -294,13 +289,11 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase {
     $result = civicrm_api('contact', 'get', $params, $defaults);
     $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
 
-
     // for type:Household subtype:Sponsor
     $params = array('contact_type' => 'Household' . CRM_Core_DAO::VALUE_SEPARATOR . $this->sponsor, 'version' => 3);
     $result = civicrm_api('contact', 'get', $params, $defaults);
     $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
 
-
     // for type:Household subtype:Student
     $params = array('contact_type' => 'Household' . CRM_Core_DAO::VALUE_SEPARATOR . $this->student, 'version' => 3);
     $result = civicrm_api('contact', 'get', $params, $defaults);
index fc37f2bf7f37fb7ed264fa64e626a7058c302bd9..c9130eca1f57f4cb27e2285f7c149d625a482909 100644 (file)
@@ -29,7 +29,6 @@ class CRM_Contact_BAO_ContactType_ContactTest extends CiviUnitTestCase {
     $result = CRM_Contact_BAO_ContactType::add($params);
     $this->parent = $params['name'];
 
-
     $params = array(
       'label' => 'org_sponsor',
       'name' => 'org_sponsor',
@@ -219,7 +218,6 @@ DELETE FROM civicrm_contact_type
     $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->parent, 'In line ' . __LINE__);
     CRM_Contact_BAO_Contact::deleteContact($contact->id);
 
-
     $params = array(
       'organization_name' => 'Compumentor',
       'contact_type' => 'Organization',
@@ -245,7 +243,6 @@ DELETE FROM civicrm_contact_type
     $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->team, 'In line ' . __LINE__);
     CRM_Contact_BAO_Contact::deleteContact($contact->id);
 
-
     $params = array(
       'first_name' => 'Anne',
       'last_name' => 'Grant',
index 0fda158d4c01e1f63d81ddce0a5ac37d62b1d8b3..ee546ab6895b053d2d29434310c68fb01aad979d 100644 (file)
@@ -32,7 +32,7 @@ require_once 'CiviTest/Contact.php';
 /**
  * Test class for CRM_Contact_BAO_GroupContact BAO
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase {
 
@@ -216,8 +216,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase {
    *
    * @see CRM_Core_DAO::createTestObject
    */
-  function createTestObject($daoName, $params = array(
-    ), $numObjects = 1, $createOnly = FALSE) {
+  function createTestObject($daoName, $params = array(), $numObjects = 1, $createOnly = FALSE) {
     $objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly);
     if (is_array($objects)) {
       $this->registerTestObjects($objects);
index 6296fc23232982c1c13eeed90a39d0d6ca049d1b..35a966b1684573c3a1d1e251b9cfc9d4f21bd8ef 100644 (file)
@@ -32,7 +32,7 @@ require_once 'CiviTest/Contact.php';
 /**
  * Test class for CRM_Contact_BAO_GroupContact BAO
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Contact_BAO_GroupContactTest extends CiviUnitTestCase {
 
@@ -50,7 +50,8 @@ class CRM_Contact_BAO_GroupContactTest extends CiviUnitTestCase {
    * This method is called after a test is executed.
    *
    */
-  protected function tearDown() {}
+  protected function tearDown() {
+  }
 
   /**
    * Test case for add( )
@@ -62,10 +63,12 @@ class CRM_Contact_BAO_GroupContactTest extends CiviUnitTestCase {
     $groupContacts = CRM_Core_DAO::createTestObject('CRM_Contact_DAO_GroupContact', NULL, 10);
 
     //check the group contact id is not null for each of them
-    foreach ($groupContacts as $gc) $this->assertNotNull($gc->id);
+    foreach ($groupContacts as $gc) { $this->assertNotNull($gc->id);
+    }
 
     //cleanup
-    foreach ($groupContacts as $gc) $gc->deleteTestObjects('CRM_Contact_DAO_GroupContact');
+    foreach ($groupContacts as $gc) { $gc->deleteTestObjects('CRM_Contact_DAO_GroupContact');
+    }
   }
 
   /**
@@ -73,7 +76,6 @@ class CRM_Contact_BAO_GroupContactTest extends CiviUnitTestCase {
    */
   public function testGetGroupId() {
 
-
     //creates a test groupContact object
     //force group_id to 1 so we can compare
     $groupContact = CRM_Core_DAO::createTestObject('CRM_Contact_DAO_GroupContact');
index f0b746ae58a70bde2aa8b456964d499f2cac5ae9..c6aaf8a8e5cce745bdfd6483743991a23370265e 100644 (file)
@@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for CRM_Contact_BAO_Group BAO
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Contact_BAO_GroupTest extends CiviUnitTestCase {
 
index 4d45fef8526476ac47d2895eb54d9e71882a1c13..8dd988606924b1ef4f2364528ac3dc5ac20ce438 100644 (file)
@@ -32,7 +32,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
 
   /**
    *  Test CRM_Contact_BAO_Query::searchQuery()
-   *  @dataProvider dataProvider
+   * @dataProvider dataProvider
    */
   public function testSearch($fv, $count, $ids, $full) {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
@@ -68,7 +68,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
   public function testSearchProfileHomeCityCRM14263() {
     $contactID = $this->individualCreate();
     CRM_Core_Config::singleton()->defaultSearchProfileID = 1;
-    $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1,));
+    $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1));
     $params = array(
       0 => array(
         0 => 'city-1',
@@ -106,7 +106,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
   public function testSearchProfileHomeCityNoResultsCRM14263() {
     $contactID = $this->individualCreate();
     CRM_Core_Config::singleton()->defaultSearchProfileID = 1;
-    $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1,));
+    $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1));
     $params = array(
       0 => array(
         0 => 'city-1',
@@ -136,17 +136,17 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
 
     }
   }
-    /**
-     * CRM-14263 search builder failure with search profile & address in criteria
-     * We are retrieving primary here - checking the actual sql seems super prescriptive - but since the massive query object has
-     * so few tests detecting any change seems good here :-)
-     */
-    public function testSearchProfilePrimaryCityCRM14263()
+  /**
+   * CRM-14263 search builder failure with search profile & address in criteria
+   * We are retrieving primary here - checking the actual sql seems super prescriptive - but since the massive query object has
+   * so few tests detecting any change seems good here :-)
+   */
+  public function testSearchProfilePrimaryCityCRM14263()
     {
-      $contactID = $this->individualCreate();
-      CRM_Core_Config::singleton()->defaultSearchProfileID = 1;
-      $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1,));
-      $params = array(
+    $contactID = $this->individualCreate();
+    CRM_Core_Config::singleton()->defaultSearchProfileID = 1;
+    $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1));
+    $params = array(
         0 => array(
           0 => 'city',
           1 => '=',
@@ -155,23 +155,23 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase {
           4 => 0,
         )
       );
-      $returnProperties = array(
+    $returnProperties = array(
         'contact_type' => 1,
         'contact_sub_type' => 1,
         'sort_name' => 1,
       );
-      $expectedSQL = "SELECT contact_a.id as contact_id, contact_a.contact_type  as `contact_type`, contact_a.contact_sub_type  as `contact_sub_type`, contact_a.sort_name  as `sort_name`, civicrm_address.id as address_id, civicrm_address.city as `city`  FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) WHERE  (  ( LOWER(civicrm_address.city) = 'cool city' )  )  AND (contact_a.is_deleted = 0)    ORDER BY contact_a.sort_name asc, contact_a.id ";
-      $queryObj = new CRM_Contact_BAO_Query($params, $returnProperties);
-      try {
-        $this->assertEquals($expectedSQL ,$queryObj->searchQuery(0, 0, NULL,
+    $expectedSQL = "SELECT contact_a.id as contact_id, contact_a.contact_type  as `contact_type`, contact_a.contact_sub_type  as `contact_sub_type`, contact_a.sort_name  as `sort_name`, civicrm_address.id as address_id, civicrm_address.city as `city`  FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) WHERE  (  ( LOWER(civicrm_address.city) = 'cool city' )  )  AND (contact_a.is_deleted = 0)    ORDER BY contact_a.sort_name asc, contact_a.id ";
+    $queryObj = new CRM_Contact_BAO_Query($params, $returnProperties);
+    try {
+      $this->assertEquals($expectedSQL, $queryObj->searchQuery(0, 0, NULL,
           FALSE, FALSE,
           FALSE, FALSE,
           TRUE));
-      }
-      catch (PEAR_Exception $e) {
-        $err = $e->getCause();
-        $this->fail('invalid SQL created' . $e->getMessage() . " " . $err->userinfo);
+    }
+    catch (PEAR_Exception $e) {
+      $err = $e->getCause();
+      $this->fail('invalid SQL created' . $e->getMessage() . " " . $err->userinfo);
 
-      }
     }
+  }
 }
index ef9ecbca1c6565856d493b2932c33b5f64ceedf3..35062efcd9d183682ae7f0b1fc4b08ba50ad4ebc 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: GroupTestDataProvider.php 23715 2009-09-21 06:35:47Z shot $
- *   @package CiviCRM
+ * @version   $Id: GroupTestDataProvider.php 23715 2009-09-21 06:35:47Z shot $
+ * @package CiviCRM
  *
  *   This file is part of CiviCRM
  *
 /**
  *  Provide data to the CRM_Contact_BAO_QueryTest class
  *
- *  @package CiviCRM
+ * @package CiviCRM
  */
 class CRM_Contact_BAO_QueryTestDataProvider implements Iterator {
 
   /**
-   *  @var integer
+   * @var integer
    */
   private $i = 0;
 
   /**
-   *  @var mixed[]
+   * @var mixed[]
    *  This dataset describes various form values and what contact
    *  IDs should be selected when the form values are applied to the
    *  database in dataset.xml
index 3699a844ad1b2e7aea2bded5942b81a8dafffa94..87365502487510969ea18275c5893b199df9b445 100644 (file)
@@ -4,11 +4,11 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @package CiviCRM
+ * @package CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -51,7 +51,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test contact custom search functions
  *
- *  @package CiviCRM
+ * @package CiviCRM
  */
 class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase {
   protected $_tablesToTruncate = array(
@@ -76,11 +76,12 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase {
     parent::setUp();
   }
 
-  public function tearDown() {}
+  public function tearDown() {
+  }
 
   /**
    *  Test CRM_Contact_Form_Search_Custom_Group::count()
-   *  @dataProvider dataProvider
+   * @dataProvider dataProvider
    */
   public function testCount($fv, $count, $ids, $full) {
     $this->foreignKeyChecksOff();
@@ -100,10 +101,10 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase {
     $dao = CRM_Core_DAO::executeQuery($sql);
 
     /**
-     echo "Count: $count, OBJ: ", $obj->count( ) . "\n";
-     while ( $dao->fetch( ) ) {
-     echo "{$dao->contact_id}, {$dao->contact_type}, {$dao->sort_name}, {$dao->group_names}\n";
-     }
+    echo "Count: $count, OBJ: ", $obj->count( ) . "\n";
+    while ( $dao->fetch( ) ) {
+    echo "{$dao->contact_id}, {$dao->contact_type}, {$dao->sort_name}, {$dao->group_names}\n";
+    }
      **/
     $this->assertEquals($count, $obj->count(),
       'In line ' . __LINE__
@@ -112,7 +113,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase {
 
   /**
    *  Test CRM_Contact_Form_Search_Custom_Group::all()
-   *  @dataProvider dataProvider
+   * @dataProvider dataProvider
    */
   public function testAll($fv, $count, $ids, $full) {
     // Truncate affected tables
@@ -143,7 +144,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase {
 
   /**
    *  Test CRM_Contact_Form_Search_Custom_Group::contactIDs()
-   *  @dataProvider dataProvider
+   * @dataProvider dataProvider
    */
   public function testContactIDs($fv, $count, $ids, $full) {
     // Truncate affected tables
@@ -186,9 +187,10 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase {
 
   /**
    *  Test CRM_Contact_Form_Search_Custom_Group::from()
-   *  @todo write this test
+   * @todo write this test
    */
-  public function SKIPPED_testFrom() {}
+  public function SKIPPED_testFrom() {
+  }
 
   /**
    *  Test CRM_Contact_Form_Search_Custom_Group::summary()
index 9f5e3cf922affc18475734e22537b04778653377..714202a9474f03470f216f95fd804d5801fa5c04 100644 (file)
@@ -5,12 +5,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: GroupTestDataProvider.php 44314 2012-12-19 11:12:49Z kurund $
- *   @package CiviCRM
+ * @version   $Id: GroupTestDataProvider.php 44314 2012-12-19 11:12:49Z kurund $
+ * @package CiviCRM
  *
  *   This file is part of CiviCRM
  *
 /**
  *  Provide data to the CRM_Contact_Form_Search_Custom_GroupTest class
  *
- *  @package CiviCRM
+ * @package CiviCRM
  */
 class CRM_Contact_Form_Search_Custom_GroupTestDataProvider implements Iterator {
 
   /**
-   *  @var integer
+   * @var integer
    */
   private $i = 0;
 
   /**
-   *  @var mixed[]
+   * @var mixed[]
    *  This dataset describes various form values and what contact
    *  IDs should be selected when the form values are applied to the
    *  database in dataset.xml
    */
   private $dataset = array(
     //  Exclude static group 3
-    array('fv' => array('excludeGroups' => array('3')),
+    array(
+  'fv' => array('excludeGroups' => array('3')),
       'id' => array(
         '9', '10', '11', '12', '13', '14',
         '15', '16', '26',
       ),
     ),
     //  Include static group 3
-    array('fv' => array('includeGroups' => array('3')),
+    array(
+  'fv' => array('includeGroups' => array('3')),
       'id' => array(
         '17', '18', '19', '20', '21',
         '22', '23', '24', '27', '28',
       ),
     ),
     //  Include static group 5
-    array('fv' => array('includeGroups' => array('5')),
+    array(
+  'fv' => array('includeGroups' => array('5')),
       'id' => array(
         '13', '14', '15', '16', '21',
         '22', '23', '24',
       ),
     ),
     //  Include static groups 3 and 5
-    array('fv' => array('includeGroups' => array('3', '5')),
+    array(
+  'fv' => array('includeGroups' => array('3', '5')),
       'id' => array(
         '13', '14', '15', '16', '17', '18',
         '19', '20', '21', '22', '23', '24',
@@ -78,34 +82,40 @@ class CRM_Contact_Form_Search_Custom_GroupTestDataProvider implements Iterator {
       ),
     ),
     //  Include static group 3, exclude static group 5
-    array('fv' => array('includeGroups' => array('3'),
+    array(
+  'fv' => array(
+  'includeGroups' => array('3'),
         'excludeGroups' => array('5'),
       ),
       'id' => array('17', '18', '19', '20', '27', '28'),
     ),
     //  Exclude tag 7
-    array('fv' => array('excludeTags' => array('7')),
+    array(
+  'fv' => array('excludeTags' => array('7')),
       'id' => array(
         '9', '10', '13', '14', '17', '18',
         '21', '22', '27',
       ),
     ),
     //  Include tag 7
-    array('fv' => array('includeTags' => array('7')),
+    array(
+  'fv' => array('includeTags' => array('7')),
       'id' => array(
         '11', '12', '15', '16', '19',
         '20', '23', '24', '26', '28',
       ),
     ),
     //  Include tag 9
-    array('fv' => array('includeTags' => array('9')),
+    array(
+  'fv' => array('includeTags' => array('9')),
       'id' => array(
         '10', '12', '14', '16', '18',
         '20', '22', '24',
       ),
     ),
     //  Include tags 7 and 9
-    array('fv' => array('includeTags' => array('7', '9')),
+    array(
+  'fv' => array('includeTags' => array('7', '9')),
       'id' => array(
         '10', '11', '12', '14', '15', '16',
         '18', '19', '20', '22', '23', '24',
@@ -113,7 +123,9 @@ class CRM_Contact_Form_Search_Custom_GroupTestDataProvider implements Iterator {
       ),
     ),
     //  Include tag 7, exclude tag 9
-    array('fv' => array('includeTags' => array('7'),
+    array(
+  'fv' => array(
+  'includeTags' => array('7'),
         'excludeTags' => array('9'),
       ),
       'id' => array('11', '15', '19', '23', '26', '28'),
@@ -141,19 +153,25 @@ class CRM_Contact_Form_Search_Custom_GroupTestDataProvider implements Iterator {
       'id' => array('19', '20', '23', '24', '28'),
     ),
     //  Include static group 3, exclude tag 7
-    array('fv' => array('includeGroups' => array('3'),
+    array(
+  'fv' => array(
+  'includeGroups' => array('3'),
         'excludeTags' => array('7'),
       ),
       'id' => array('17', '18', '21', '22', '27'),
     ),
     //  Include tag 9, exclude static group 5
-    array('fv' => array('includeTags' => array('9'),
+    array(
+  'fv' => array(
+  'includeTags' => array('9'),
         'excludeGroups' => array('5'),
       ),
-      'id' => array('10','12','18','20'),
+      'id' => array('10', '12', '18', '20'),
     ),
     //  Exclude tag 9, exclude static group 5
-    array('fv' => array('excludeTags' => array('9'),
+    array(
+  'fv' => array(
+  'excludeTags' => array('9'),
         'excludeGroups' => array('5'),
       ),
       'id' => array(
@@ -162,21 +180,24 @@ class CRM_Contact_Form_Search_Custom_GroupTestDataProvider implements Iterator {
       ),
     ),
     //  Include smart group 6
-    array('fv' => array('includeGroups' => array('6')),
+    array(
+  'fv' => array('includeGroups' => array('6')),
       'id' => array(
         '9', '10', '11', '12', '13', '14',
         '15', '16', '26',
       ),
     ),
     //  Include smart group 4
-    array('fv' => array('includeGroups' => array('4')),
+    array(
+  'fv' => array('includeGroups' => array('4')),
       'id' => array(
         '17', '18', '19', '20', '21',
         '22', '23', '24', '27', '28',
       ),
     ),
     //  Include smart group 4 and static group 5
-    array('fv' => array('includeGroups' => array('4', '5')),
+    array(
+  'fv' => array('includeGroups' => array('4', '5')),
       'id' => array(
         '13', '14', '15', '16', '17', '18',
         '19', '20', '21', '22', '23', '24',
index fe38d0590e37ae942fda477e5bdc93575eba94e2..984796b319e9e63d32a4b6cee8f73bf93694e025 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Contribute_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 24d44749f2e471c7220b46bd56d81cf8b04e580f..f95bdc7385cbbd1e8ca774a653ac97ca446ce73d 100644 (file)
@@ -69,7 +69,6 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase {
       'is_credit_card_only' => '',
     );
 
-
     $contributionpage = CRM_Contribute_BAO_ContributionPage::create($params);
 
     $this->assertNotNull($contributionpage->id);
@@ -92,7 +91,7 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase {
     $id               = $contributionpage->id;
     $is_active        = 1;
     $pageActive       = CRM_Contribute_BAO_ContributionPage::setIsActive($id, $is_active);
-    $this->assertEquals($pageActive, true, 'Verify financial types record deletion.');
+    $this->assertEquals($pageActive, TRUE, 'Verify financial types record deletion.');
     ContributionPage::delete($contributionpage->id);
   }
 
@@ -142,7 +141,6 @@ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase {
       'is_credit_card_only' => '',
     );
 
-
     $contributionpage = CRM_Contribute_BAO_ContributionPage::create($params);
     $copycontributionpage = CRM_Contribute_BAO_ContributionPage::copy($contributionpage->id);
     $this->assertEquals($copycontributionpage->financial_type_id, $this->_financialTypeID, 'Check for Financial type id.');
index 5ef6804f8caabdd7a353c16157eadfb42df7992b..fdd1cd2feb6e36acafd968683bbfb415a4f08179 100644 (file)
@@ -126,7 +126,6 @@ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase {
       'thankyou_date' => '20080522',
     );
 
-
     $params['custom'] = array(
       $customField->id => array(
         -1 => array(
@@ -141,7 +140,6 @@ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase {
       ),
     );
 
-
     $contribution = CRM_Contribute_BAO_Contribution::create($params, $ids);
 
     // Check that the custom field value is saved
@@ -269,7 +267,7 @@ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase {
     $annual = CRM_Contribute_BAO_Contribution::annual($contactId);
 
     $config = CRM_Core_Config::singleton();
-        $currencySymbol = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_Currency',$config->defaultCurrency,'symbol','name') ;
+    $currencySymbol = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_Currency', $config->defaultCurrency, 'symbol', 'name');
     $this->assertDBCompareValue('CRM_Contribute_DAO_Contribution', $id, 'total_amount',
       'id', ltrim($annual[2], $currencySymbol), 'Check DB for total amount of the contribution'
     );
@@ -352,7 +350,6 @@ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase {
       'premium' => NULL,
     );
 
-
     $params = array(
       'name' => 'TEST Premium',
       'sku' => 111,
index 1ba9fbac45ef0aadaf218747cb28478c7fddc11c..7f3a088f46b86778eafee5c9edcb0b1d56dd93b8 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Core_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index a1467ea9c815e67a79e150af03107077688fe6d4..97649c80196cf724c009f2e248f7e960cda9ed6e 100644 (file)
@@ -41,7 +41,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     parent::setUp();
 
     require_once 'CiviTest/CiviMailUtils.php';
-    $this->mut = new CiviMailUtils($this, true);
+    $this->mut = new CiviMailUtils($this, TRUE);
 
     $this->fixtures['rolling_membership'] = array( // createTestObject
       'membership_type_id' => array(
@@ -436,7 +436,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
     $activity = $this->createTestObject('CRM_Activity_DAO_Activity', $this->fixtures['phonecall']);
     $this->assertTrue(is_numeric($activity->id));
-    $contact =  $this->callAPISuccess('contact', 'create', $this->fixtures['contact']);
+    $contact = $this->callAPISuccess('contact', 'create', $this->fixtures['contact']);
     $activity->save();
 
     $source['contact_id'] = $contact['id'];
@@ -467,12 +467,12 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
     $activity = $this->createTestObject('CRM_Activity_DAO_Activity', $this->fixtures['phonecall']);
     $this->assertTrue(is_numeric($activity->id));
-    $contact =  $this->callAPISuccess('contact', 'create', $this->fixtures['contact']);
+    $contact = $this->callAPISuccess('contact', 'create', $this->fixtures['contact']);
     $activity->save();
 
     $source['contact_id'] = $contact['id'];
     $source['activity_id'] = $activity->id;
-    $source['record_type_id'] =2;
+    $source['record_type_id'] = 2;
     $activityContact = $this->createTestObject('CRM_Activity_DAO_ActivityContact', $source);
     $activityContact->save();
 
@@ -665,14 +665,14 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
 
   /**
-  * For contacts/members which match schedule based on end date,
-  * an email should be sent.
-  */
+   * For contacts/members which match schedule based on end date,
+   * an email should be sent.
+   */
   public function testMembershipEndDate_NoMatch() {
     // creates membership with end_date = 20120615
     $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership_past'], array('status_id' => 3)));
     $this->assertTrue(is_numeric($membership->id));
-    $result =  $this->callAPISuccess('Email', 'create', array(
+    $result = $this->callAPISuccess('Email', 'create', array(
       'contact_id' => $membership->contact_id,
       'email' => 'test-member@example.com',
     ));
@@ -716,7 +716,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
   }
 
   public function testContactBirthDate_Anniv() {
-    $contact =  $this->callAPISuccess('Contact', 'create', $this->fixtures['contact_birthdate']);
+    $contact = $this->callAPISuccess('Contact', 'create', $this->fixtures['contact_birthdate']);
     $this->_testObjects['CRM_Contact_DAO_Contact'][] = $contact['id'];
     $actionSchedule = $this->fixtures['sched_contact_bday_anniv'];
     $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($actionSchedule);
@@ -739,7 +739,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'name' => 'test_group',
       'extends' => array('Individual'),
       'style' => 'Inline',
-      'is_multiple' => false,
+      'is_multiple' => FALSE,
       'is_active' => 1,
     );
     $createGroup = $this->callAPISuccess('custom_group', 'create', $group);
@@ -768,7 +768,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
         'recipients' => array(array('test-member@example.com')),
       ),
     ));
-    $this->callAPISuccess('custom_group', 'delete', array('id' => $createGroup['id'],));
+    $this->callAPISuccess('custom_group', 'delete', array('id' => $createGroup['id']));
   }
   /**
    * Check that limit_to + an empty recipients doesn't sent to multiple contacts
@@ -810,7 +810,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'name' => 'test_group_now',
       'extends' => array('Individual'),
       'style' => 'Inline',
-      'is_multiple' => false,
+      'is_multiple' => FALSE,
       'is_active' => 1,
     );
     $createGroup = $this->callAPISuccess('custom_group', 'create', $group);
@@ -840,7 +840,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
         'recipients' => array(array('test-member@example.com')),
       ),
     ));
-    $this->callAPISuccess('custom_group', 'delete', array('id' => $createGroup['id'],));
+    $this->callAPISuccess('custom_group', 'delete', array('id' => $createGroup['id']));
   }
 
   // TODO // function testMembershipEndDate_NonMatch() { }
@@ -902,8 +902,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
    *
    * @see CRM_Core_DAO::createTestObject
    */
-  function createTestObject($daoName, $params = array(
-    ), $numObjects = 1, $createOnly = FALSE) {
+  function createTestObject($daoName, $params = array(), $numObjects = 1, $createOnly = FALSE) {
     $objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly);
     if (is_array($objects)) {
       $this->registerTestObjects($objects);
index e12c776a4d84e399360caa2382ccfb126fa6f0bc..1884f7ea12c5bfbe29a0b84172814175efa5a162 100644 (file)
@@ -63,7 +63,6 @@ class CRM_Core_BAO_AddressTest extends CiviUnitTestCase {
 
     $params['contact_id'] = $contactId;
 
-
     $fixAddress = TRUE;
 
     CRM_Core_BAO_Address::create($params, $fixAddress, $entity = NULL);
@@ -91,7 +90,6 @@ class CRM_Core_BAO_AddressTest extends CiviUnitTestCase {
     );
     $params['contact_id'] = $contactId;
 
-
     $block = CRM_Core_BAO_Address::create($params, $fixAddress, $entity = NULL);
 
     $cid = $this->assertDBNotNull('CRM_Core_DAO_Address', $contactId, 'id', 'contact_id',
index 5110912e7eba4a07bbb4f925e2bb9c55d8e33182..055401a2e57c316c476b54549d242834567f97f6 100644 (file)
@@ -115,7 +115,6 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase {
     //$this->assertEquals( 'testFld1',  $getCustomFields[$customFieldID1][0], 'Confirm First Custom field label' );
     //$this->assertEquals( 'testFld2',  $getCustomFields[$customFieldID2][0], 'Confirm Second Custom field label' );
 
-
     Custom::deleteGroup($customGroup);
   }
 
@@ -192,22 +191,19 @@ class CRM_Core_BAO_CustomFieldTest extends CiviUnitTestCase {
         )),
     );
     $fields = array(
-      'countryA' => Custom::createField(array(
-        ), array(
+      'countryA' => Custom::createField(array(), array(
           'groupId' => $groups['A']->id,
           'label' => 'Country A',
           'dataType' => 'Country',
           'htmlType' => 'Select Country',
         )),
-      'countryB' => Custom::createField(array(
-        ), array(
+      'countryB' => Custom::createField(array(), array(
           'groupId' => $groups['A']->id,
           'label' => 'Country B',
           'dataType' => 'Country',
           'htmlType' => 'Select Country',
         )),
-      'countryC' => Custom::createField(array(
-        ), array(
+      'countryC' => Custom::createField(array(), array(
           'groupId' => $groups['B']->id,
           'label' => 'Country C',
           'dataType' => 'Country',
index 6e0775e3dcb889ddd5c96d56deed1d324ec04f00..a7a8fa572db5028a7f919a737a88cd7b31054a7e 100644 (file)
@@ -434,7 +434,6 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase {
       'version' => 3,
     );
 
-
     $customGroup = Custom::createGroup($groupParams);
     $activeGroup = CRM_Core_BAO_CustomGroup::getActiveGroups('Individual', 'civicrm/contact/view/cd', $contactId);
     foreach ($activeGroup as $key => $value) {
index 4e22f227fa0592c08c3c66cb73eea4c969c02cb0..235351b6a64f7a2a95c5c7072d5f3e4e26aae52b 100644 (file)
@@ -68,7 +68,7 @@ class CRM_Core_BAO_CustomValueTableSetGetTest extends CiviUnitTestCase {
     );
 
     $errorScope = CRM_Core_TemporaryErrorScope::useException();
-    $message = null;
+    $message = NULL;
     try {
       $result = CRM_Core_BAO_CustomValueTable::setValues($params);
     } catch ( Exception $e ) {
@@ -161,7 +161,6 @@ class CRM_Core_BAO_CustomValueTableSetGetTest extends CiviUnitTestCase {
       'Verify that the boolean value is stored for contact ' . $contactID
     );
 
-
     // Now set YesNo radio to an invalid boolean value and try to reset
     $badYesNo = '20';
     $params = array(
@@ -170,7 +169,7 @@ class CRM_Core_BAO_CustomValueTableSetGetTest extends CiviUnitTestCase {
     );
 
     $errorScope = CRM_Core_TemporaryErrorScope::useException();
-    $message = null;
+    $message = NULL;
     try {
       $result = CRM_Core_BAO_CustomValueTable::setValues($params);
     } catch (Exception $e) {
index 2c551f4fe16e34d973e5a800655c34fd7b2b4cb1..938d7e5461a13242bb3e3eaf4ec251ef7d143200 100644 (file)
@@ -49,7 +49,7 @@ class CRM_Core_BAO_CustomValueTest extends CiviUnitTestCase {
       'Int' => 1,
       'Float' => 10.00,
       'Date' => '2008-06-24',
-      'Boolean' => True,
+      'Boolean' => TRUE,
       'StateProvince' => 'California',
       'Country' => 'US',
       'Link' => 'http://civicrm.org',
@@ -60,7 +60,7 @@ class CRM_Core_BAO_CustomValueTest extends CiviUnitTestCase {
         $this->assertEquals($valid, '2008-06-24', 'Checking type ' . $type . ' for returned CustomField Type.');
       }
       else {
-        $this->assertEquals($valid, true, 'Checking type ' . $type . ' for returned CustomField Type.');
+        $this->assertEquals($valid, TRUE, 'Checking type ' . $type . ' for returned CustomField Type.');
       }
     }
   }
index 5bc48c9edc2c031d258d3edb7e4007ce200fcf5d..e5456314327a1048e7344f87cc77ee896dd5c378 100644 (file)
@@ -292,7 +292,8 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase {
     );
 
     //Now check DB for location elements.
-    $searchParams = array('id' => CRM_Utils_Array::value('address_id', $locElementIds),
+    $searchParams = array(
+    'id' => CRM_Utils_Array::value('address_id', $locElementIds),
       'location_type_id' => 1,
       'is_primary' => 1,
     );
@@ -309,15 +310,16 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase {
     );
     $this->assertDBCompareValues('CRM_Core_DAO_Address', $searchParams, $compareParams);
 
-    $searchParams = array('id' => CRM_Utils_Array::value('email_id', $locElementIds),
+    $searchParams = array(
+    'id' => CRM_Utils_Array::value('email_id', $locElementIds),
       'location_type_id' => 1,
       'is_primary' => 1,
     );
     $compareParams = array('email' => 'john.smith@example.org');
     $this->assertDBCompareValues('CRM_Core_DAO_Email', $searchParams, $compareParams);
 
-
-    $searchParams = array('id' => CRM_Utils_Array::value('phone_id', $locElementIds),
+    $searchParams = array(
+    'id' => CRM_Utils_Array::value('phone_id', $locElementIds),
       'location_type_id' => 1,
       'is_primary' => 1,
       'phone_type_id' => 1,
@@ -325,14 +327,16 @@ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase {
     $compareParams = array('phone' => '303443689');
     $this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
 
-    $searchParams = array('id' => CRM_Utils_Array::value('phone_2_id', $locElementIds),
+    $searchParams = array(
+    'id' => CRM_Utils_Array::value('phone_2_id', $locElementIds),
       'location_type_id' => 1,
       'phone_type_id' => 2,
     );
     $compareParams = array('phone' => '9833910234');
     $this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
 
-    $searchParams = array('id' => CRM_Utils_Array::value('im_id', $locElementIds),
+    $searchParams = array(
+    'id' => CRM_Utils_Array::value('im_id', $locElementIds),
       'location_type_id' => 1,
       'is_primary' => 1,
     );
index 9a92a1873d019ff40f4defd14edac396fcca895f..39fa33a468e47ec24b828c3b12e65212c3f71af0 100644 (file)
@@ -114,5 +114,6 @@ class CRM_Core_BAO_PhoneTest extends CiviUnitTestCase {
    * AllEntityPhones() method - get all Phones for a location block, with primary Phone first
    * @todo FIXME: Fixing this test requires add helper functions in CiviTest to create location block and phone and link them to an event. Punting to 3.1 cycle. DGG
    */
-  public function SKIPPED_testAllEntityPhones() {}
+  public function SKIPPED_testAllEntityPhones() {
+  }
 }
index 756a4504671d84aa70e644bc5260610fd927dfac..7abc2361ef6db1fd95217f8d8e3d2fd06b17b46f 100644 (file)
@@ -47,7 +47,8 @@ class CRM_Core_BAO_RecurringEntityTest extends CiviUnitTestCase {
    * This method is called after a test is executed.
    *
    */
-  protected function tearDown() {}
+  protected function tearDown() {
+  }
 
   /**
    * Testing Activity Generation through Entity Recursion
@@ -112,7 +113,7 @@ class CRM_Core_BAO_RecurringEntityTest extends CiviUnitTestCase {
    * Testing Event Generation through Entity Recursion
    */
   public function testEventGeneration() {
-       //Event set initial params
+    //Event set initial params
     $daoEvent = new CRM_Event_DAO_Event();
     $daoEvent->title = 'Test event for Recurring Entity';
     $daoEvent->event_type_id = 3;
@@ -138,7 +139,7 @@ class CRM_Core_BAO_RecurringEntityTest extends CiviUnitTestCase {
     $recursion->entity_id    = $daoEvent->id;
     $recursion->entity_table = 'civicrm_event';
     $recursion->dateColumns  = array('start_date');
-    $recursion->schedule     = array (
+    $recursion->schedule     = array(
       'entity_value'                  => $daoEvent->id,
       'start_action_date'             => $daoEvent->start_date,
       'start_action_condition'        => 'monday',
index d0791870cc2c73f6cc5bf4a1910e1a3adca86024..a7ef13af416fcf7d4d7d99991279e85146b6ff3d 100644 (file)
@@ -131,7 +131,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase {
     $currentDomain = CRM_Core_Config::domainID();
     // we are setting up an artificial situation here as we are trying to drive out
     // previous memory of this setting so we need to flush it out
-    $cachekey =  CRM_Core_BAO_Setting::inCache('CiviCRM Preferences', 'max_attachments', NULL, NULL, TRUE, $currentDomain);
+    $cachekey = CRM_Core_BAO_Setting::inCache('CiviCRM Preferences', 'max_attachments', NULL, NULL, TRUE, $currentDomain);
     CRM_Core_BAO_Setting::flushCache($cachekey);
     CRM_Core_BAO_Setting::updateSettingsFromMetaData();
     //check current domain
index 70bdcfc339ed4aa9fb7d01c2a68d35797f66a993..93effc4684ae88888ad0e0dc4e7e9f6e7365b877 100644 (file)
@@ -176,11 +176,11 @@ class CRM_Core_BAO_UFFieldTest extends CiviUnitTestCase {
    * Make sure that the existence of a profile doesn't break listing all fields
    *
   public function testGetAvailable_mixed() {
-    // FIXME
-    $this->testGetAvailable_full();
-    // $this->testGetAvailable_byGid();
-    $this->testGetAvailable_full();
-    // $this->testGetAvailable_byGid();
+  // FIXME
+  $this->testGetAvailable_full();
+  // $this->testGetAvailable_byGid();
+  $this->testGetAvailable_full();
+  // $this->testGetAvailable_byGid();
   } // */
 
   /**
index e8201e45bc5b5c458f070a5728a9e1e8ad9ca67b..1e8de86e7fff92809b52d0033fcaec65bbc966cf 100644 (file)
@@ -56,20 +56,20 @@ class CRM_Core_Config_MailerTest extends CiviUnitTestCase {
   public function testHookAlterMailer() {
     $test = $this;
     $mockMailer = new CRM_Utils_FakeObject(array(
-      'send' => function ($recipients, $headers, $body) use ($test) {
-        $test->calls['send']++;
-        $test->assertEquals(array('to@example.org'), $recipients);
-        $test->assertEquals('Subject Example', $headers['Subject']);
-      }
+    'send' => function ($recipients, $headers, $body) use ($test) {
+      $test->calls['send']++;
+      $test->assertEquals(array('to@example.org'), $recipients);
+      $test->assertEquals('Subject Example', $headers['Subject']);
+    }
     ));
 
     CRM_Utils_Hook::singleton()->setHook('civicrm_alterMailer',
       function (&$mailer, $driver, $params) use ($test, $mockMailer) {
-        $test->calls['civicrm_alterMailer']++;
-        $test->assertTrue(is_string($driver) && !empty($driver));
-        $test->assertTrue(is_array($params));
-        $test->assertTrue(is_callable(array($mailer, 'send')));
-        $mailer = $mockMailer;
+      $test->calls['civicrm_alterMailer']++;
+      $test->assertTrue(is_string($driver) && !empty($driver));
+      $test->assertTrue(is_array($params));
+      $test->assertTrue(is_callable(array($mailer, 'send')));
+      $mailer = $mockMailer;
       }
     );
 
index 5ae2faeb2cc37e395be4bdb3cf8348d1763f6190..d13c2679838a5edfcf557a4d82b8ebbbfbb64e4b 100644 (file)
@@ -41,7 +41,7 @@ class CRM_Core_ErrorTest extends CiviUnitTestCase {
 
   public function tearDown() {
     $config = CRM_Core_Config::singleton();
-    $config->configAndLogDir= $this->oldConfigAndLogDir;
+    $config->configAndLogDir = $this->oldConfigAndLogDir;
     parent::tearDown();
   }
 
@@ -80,7 +80,7 @@ class CRM_Core_ErrorTest extends CiviUnitTestCase {
     $logger2->info('obj-3');
     CRM_Core_Error::debug_log_message("static-5");
     $this->assertLogRegexp('/static-1.*static-2.*obj-1.*static-3.*obj-2.*static-4.*obj-3.*static-5/s');
-}
+  }
 
   /**
    * @param $pattern
index 537abfc8e60182f46a9c9ca84e35a3f4bab24b7b..b65cc2f6e653dba693e9b01e638c2d6bd72431dc 100644 (file)
@@ -237,7 +237,6 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase {
     $this->assertDBQuery(1, 'SELECT count(*) FROM civicrm_option_value WHERE name = "CRM_Example_One_Foo"');
     $this->assertEquals($foo['id'], $foo2['id']);
 
-
     // Override 'getrefcount' ==> The refcount is 0
     $this->adhocProvider->addAction('getrefcount', 'access CiviCRM', function($apiRequest) {
       return civicrm_api3_create_success(array());
@@ -273,7 +272,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase {
       $me->reconcile();
       $this->fail('Expected exception when using invalid declaration');
     } catch (Exception $e) {
-     // good
+      // good
     }
   }
 
@@ -298,7 +297,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase {
       $me->reconcile();
       $this->fail('Expected exception when using invalid declaration');
     } catch (Exception $e) {
-     // good
+      // good
     }
   }
 
@@ -323,7 +322,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase {
       $me->reconcile();
       $this->fail('Expected exception when using invalid declaration');
     } catch (Exception $e) {
-     // good
+      // good
     }
   }
 
index 0425e75fed1f0ad64de0d5882b75ccd71580e8a4..efc6f044b00156ae9aaa18488819f5c7ad2487ca 100644 (file)
@@ -14,13 +14,12 @@ class CRM_Core_Page_AJAXTest extends CiviUnitTestCase {
     $cases[] = array('method', 'CRM_Contact_Page_AJAX', TRUE, 'getAddressDisplay');
     $cases[] = array('method', 'CRM_Foo_Page_AJAX', FALSE, 'method(');
     $cases[] = array('method', 'CRM_Foo_Page_AJAX', FALSE, 'method()');
-    $cases[] = array('method', 'othermethod;CRM_Foo_Page_AJAX', FALSE,'method');
-    $cases[] = array('method', 'CRM_Foo_Page_AJAX;othermethod', FALSE,'method');
+    $cases[] = array('method', 'othermethod;CRM_Foo_Page_AJAX', FALSE, 'method');
+    $cases[] = array('method', 'CRM_Foo_Page_AJAX;othermethod', FALSE, 'method');
     $cases[] = array('method', 'CRM_Foo_Page_Inline_Bar', FALSE, '');
     $cases[] = array('method', 'CRM_Foo_Page_Inline_Bar', FALSE, 'method');
     $cases[] = array('method', 'CRM_Foo->method', FALSE);
 
-
     $cases[] = array('page', 'CRM_Foo', FALSE);
     $cases[] = array('page', 'CRM_Foo_Bar', FALSE);
     $cases[] = array('page', 'CRM_Foo_Page', FALSE);
index b52b068dd1fc2855cd10fe05a423fdcb93e5caf6..b0e8dd15e08e1f9482207616587f5d06c5d5a3eb 100644 (file)
@@ -73,7 +73,7 @@ class CRM_Core_Payment_AuthorizeNetIPNTest extends CiviUnitTestCase {
     $contribution = $this->callAPISuccess('contribution', 'get', array('contribution_recur_id' => $this->_contributionRecurID, 'sequential' => 1));
     $this->assertEquals(2, $contribution['count']);
     $this->assertEquals('second_one', $contribution['values'][1]['trxn_id']);
-    $this->callAPISuccessGetSingle('membership_payment', array('contribution_id' => $contribution['values'][1]['id'],));
+    $this->callAPISuccessGetSingle('membership_payment', array('contribution_id' => $contribution['values'][1]['id']));
     $this->callAPISuccessGetSingle('line_item', array('contribution_id' => $contribution['values'][1]['id'], 'entity_table' => 'civicrm_membership'));
   }
 
index df1b9cc10ddf66fa175fd25c4b8d0f94ae5846f2..4db64adba8d1f1a47560f26c4edf1000ccee8a61 100644 (file)
@@ -51,7 +51,7 @@ class CRM_Core_Payment_AuthorizeNetTest extends CiviUnitTestCase {
 
     // for some strange unknown reason, in batch mode this value gets set to null
     // so crude hack here to avoid an exception and hence an error
-    $GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'] = array( );
+    $GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'] = array();
   }
 
   public function tearDown() {
index a086ef82d62ba55836024a8ec9324113eb4d396a..4b9555d653222d8413bd7762a13fb325d1e358f6 100644 (file)
@@ -102,7 +102,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase {
     $this->assertEquals('secondone', $contribution['values'][1]['trxn_id']);
     $this->callAPISuccessGetCount('line_item', array('entity_id' => $this->ids['membership'], 'entity_table' => 'civicrm_membership'), 2);
     $this->callAPISuccessGetSingle('line_item', array('contribution_id' => $contribution['values'][1]['id'], 'entity_table' => 'civicrm_membership'));
-    $this->callAPISuccessGetSingle('membership_payment', array('contribution_id' => $contribution['values'][1]['id'],));
+    $this->callAPISuccessGetSingle('membership_payment', array('contribution_id' => $contribution['values'][1]['id']));
 
   }
   /**
index a9dfb8467ad21270604a12664e5977cc0e7dae81..fe869627d449fed2505bb6aeeebebcf19b06428d 100644 (file)
@@ -70,7 +70,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase {
     CRM_Core_Region::instance('testAllTypes')->add(array(
       // note: returns a value which gets appended to the region
       'callback' => 'implode',
-      'arguments' => array('-', array('callback','with','specific','args<br/>')),
+      'arguments' => array('-', array('callback', 'with', 'specific', 'args<br/>')),
     ));
     CRM_Core_Region::instance('testAllTypes')->add(array(
       // note: returns a value which gets appended to the region
@@ -108,8 +108,7 @@ class CRM_Core_RegionTest extends CiviUnitTestCase {
       . "<script type=\"text/javascript\">\nalert(\"hi\");\n</script>\n"
       . "<script type=\"text/javascript\">\nCRM.\$(function(\$) {\n\$(\"div\");\n});\n</script>\n"
       . "<link href=\"/foo%20bar.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
-      . "<style type=\"text/css\">\nbody { background: black; }\n</style>\n"
-      ;
+      . "<style type=\"text/css\">\nbody { background: black; }\n</style>\n";
     $this->assertEquals($expected, $actual);
   }
 
index 9b3f66a8086c1d140858c9272410c1956af4ff11..640b94fc82beaf2edfb8e0f2af37a59f758000dd 100644 (file)
@@ -60,15 +60,13 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase {
     $this->res
       ->addScriptFile('com.example.ext', 'foo%20bar.js', 0, 'testAddScriptFile')
       ->addScriptFile('com.example.ext', 'foo%20bar.js', 0, 'testAddScriptFile') // extra
-      ->addScriptFile('civicrm', 'foo%20bar.js', 0, 'testAddScriptFile')
-      ;
+      ->addScriptFile('civicrm', 'foo%20bar.js', 0, 'testAddScriptFile');
 
     $smarty = CRM_Core_Smarty::singleton();
     $actual = $smarty->fetch('string:{crmRegion name=testAddScriptFile}{/crmRegion}');
     $expected = "" // stable ordering: alphabetical by (snippet.weight,snippet.name)
       . "<script type=\"text/javascript\" src=\"http://core-app/foo%20bar.js?r=resTest\">\n</script>\n"
-      . "<script type=\"text/javascript\" src=\"http://ext-dir/com.example.ext/foo%20bar.js?r=resTest\">\n</script>\n"
-      ;
+      . "<script type=\"text/javascript\" src=\"http://ext-dir/com.example.ext/foo%20bar.js?r=resTest\">\n</script>\n";
     $this->assertEquals($expected, $actual);
   }
 
@@ -78,50 +76,45 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase {
    * FIXME: This can't work because the tests run in English and CRM_Core_Resources optimizes
    * away the English data from $settings['strings']
   public function testAddScriptFile_strings() {
-    file_put_contents($this->mapper->keyToBasePath('com.example.ext') . '/hello.js', 'alert(ts("Hello world"));');
-    $this->res->addScriptFile('com.example.ext', 'hello.js', 0, 'testAddScriptFile_strings');
-    $settings = $this->res->getSettings();
-    $expected = array('Hello world');
-    $this->assertEquals($expected, $settings['strings']);
+  file_put_contents($this->mapper->keyToBasePath('com.example.ext') . '/hello.js', 'alert(ts("Hello world"));');
+  $this->res->addScriptFile('com.example.ext', 'hello.js', 0, 'testAddScriptFile_strings');
+  $settings = $this->res->getSettings();
+  $expected = array('Hello world');
+  $this->assertEquals($expected, $settings['strings']);
   }
-  */
+   */
 
   public function testAddScriptURL() {
     $this->res
       ->addScriptUrl('/whiz/foo%20bar.js', 0, 'testAddScriptURL')
       ->addScriptUrl('/whiz/foo%20bar.js', 0, 'testAddScriptURL') // extra
-      ->addScriptUrl('/whizbang/foo%20bar.js', 0, 'testAddScriptURL')
-      ;
+      ->addScriptUrl('/whizbang/foo%20bar.js', 0, 'testAddScriptURL');
 
     $smarty = CRM_Core_Smarty::singleton();
     $actual = $smarty->fetch('string:{crmRegion name=testAddScriptURL}{/crmRegion}');
     $expected = "" // stable ordering: alphabetical by (snippet.weight,snippet.name)
       . "<script type=\"text/javascript\" src=\"/whiz/foo%20bar.js\">\n</script>\n"
-      . "<script type=\"text/javascript\" src=\"/whizbang/foo%20bar.js\">\n</script>\n"
-      ;
+      . "<script type=\"text/javascript\" src=\"/whizbang/foo%20bar.js\">\n</script>\n";
     $this->assertEquals($expected, $actual);
   }
 
   public function testAddScript() {
     $this->res
       ->addScript('alert("hi");', 0, 'testAddScript')
-      ->addScript('alert("there");', 0, 'testAddScript')
-      ;
+      ->addScript('alert("there");', 0, 'testAddScript');
 
     $smarty = CRM_Core_Smarty::singleton();
     $actual = $smarty->fetch('string:{crmRegion name=testAddScript}{/crmRegion}');
     $expected = ""
       . "<script type=\"text/javascript\">\nalert(\"hi\");\n</script>\n"
-      . "<script type=\"text/javascript\">\nalert(\"there\");\n</script>\n"
-      ;
+      . "<script type=\"text/javascript\">\nalert(\"there\");\n</script>\n";
     $this->assertEquals($expected, $actual);
   }
 
   public function testAddVars() {
     $this->res
       ->addVars('food', array('fruit' => array('mine' => 'apple', 'ours' => 'banana')))
-      ->addVars('food', array('fruit' => array('mine' => 'new apple', 'yours' => 'orange')))
-    ;
+      ->addVars('food', array('fruit' => array('mine' => 'new apple', 'yours' => 'orange')));
     $this->assertTreeEquals(
       array('vars' => array('food' => array('fruit' => array('yours' => 'orange', 'mine' => 'new apple', 'ours' => 'banana')))),
       $this->res->getSettings()
@@ -131,8 +124,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase {
   public function testAddSetting() {
     $this->res
       ->addSetting(array('fruit' => array('mine' => 'apple')))
-      ->addSetting(array('fruit' => array('yours' => 'orange')))
-    ;
+      ->addSetting(array('fruit' => array('yours' => 'orange')));
     $this->assertTreeEquals(
       array('fruit' => array('yours' => 'orange', 'mine' => 'apple')),
       $this->res->getSettings()
@@ -186,8 +178,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase {
     $actual = $smarty->fetch('string:{crmRegion name=testCrmJS}{/crmRegion}');
     $expected = "" // stable ordering: alphabetical by (snippet.weight,snippet.name)
       . "<script type=\"text/javascript\" src=\"http://ext-dir/com.example.ext/foo%20bar.js?r=resTest\">\n</script>\n"
-      . "<script type=\"text/javascript\" src=\"/whiz/foo%20bar.js\">\n</script>\n"
-      ;
+      . "<script type=\"text/javascript\" src=\"/whiz/foo%20bar.js\">\n</script>\n";
     $this->assertEquals($expected, $actual);
   }
 
@@ -195,15 +186,13 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase {
     $this->res
       ->addStyleFile('com.example.ext', 'foo%20bar.css', 0, 'testAddStyleFile')
       ->addStyleFile('com.example.ext', 'foo%20bar.css', 0, 'testAddStyleFile') // extra
-      ->addStyleFile('civicrm', 'foo%20bar.css', 0, 'testAddStyleFile')
-      ;
+      ->addStyleFile('civicrm', 'foo%20bar.css', 0, 'testAddStyleFile');
 
     $smarty = CRM_Core_Smarty::singleton();
     $actual = $smarty->fetch('string:{crmRegion name=testAddStyleFile}{/crmRegion}');
     $expected = "" // stable ordering: alphabetical by (snippet.weight,snippet.name)
       . "<link href=\"http://core-app/foo%20bar.css?r=resTest\" rel=\"stylesheet\" type=\"text/css\"/>\n"
-      . "<link href=\"http://ext-dir/com.example.ext/foo%20bar.css?r=resTest\" rel=\"stylesheet\" type=\"text/css\"/>\n"
-      ;
+      . "<link href=\"http://ext-dir/com.example.ext/foo%20bar.css?r=resTest\" rel=\"stylesheet\" type=\"text/css\"/>\n";
     $this->assertEquals($expected, $actual);
   }
 
@@ -211,30 +200,26 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase {
     $this->res
       ->addStyleUrl('/whiz/foo%20bar.css', 0, 'testAddStyleURL')
       ->addStyleUrl('/whiz/foo%20bar.css', 0, 'testAddStyleURL') // extra
-      ->addStyleUrl('/whizbang/foo%20bar.css', 0, 'testAddStyleURL')
-      ;
+      ->addStyleUrl('/whizbang/foo%20bar.css', 0, 'testAddStyleURL');
 
     $smarty = CRM_Core_Smarty::singleton();
     $actual = $smarty->fetch('string:{crmRegion name=testAddStyleURL}{/crmRegion}');
     $expected = "" // stable ordering: alphabetical by (snippet.weight,snippet.name)
       . "<link href=\"/whiz/foo%20bar.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
-      . "<link href=\"/whizbang/foo%20bar.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
-      ;
+      . "<link href=\"/whizbang/foo%20bar.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";
     $this->assertEquals($expected, $actual);
   }
 
   public function testAddStyle() {
     $this->res
       ->addStyle('body { background: black; }', 0, 'testAddStyle')
-      ->addStyle('body { text-color: black; }', 0, 'testAddStyle')
-      ;
+      ->addStyle('body { text-color: black; }', 0, 'testAddStyle');
 
     $smarty = CRM_Core_Smarty::singleton();
     $actual = $smarty->fetch('string:{crmRegion name=testAddStyle}{/crmRegion}');
     $expected = ""
       . "<style type=\"text/css\">\nbody { background: black; }\n</style>\n"
-      . "<style type=\"text/css\">\nbody { text-color: black; }\n</style>\n"
-      ;
+      . "<style type=\"text/css\">\nbody { text-color: black; }\n</style>\n";
     $this->assertEquals($expected, $actual);
   }
 
@@ -250,8 +235,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase {
     $actual = $smarty->fetch('string:{crmRegion name=testCrmCSS}{/crmRegion}');
     $expected = "" // stable ordering: alphabetical by (snippet.weight,snippet.name)
       . "<link href=\"http://ext-dir/com.example.ext/foo%20bar.css?r=resTest\" rel=\"stylesheet\" type=\"text/css\"/>\n"
-      . "<link href=\"/whiz/foo%20bar.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
-      ;
+      . "<link href=\"/whiz/foo%20bar.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";
     $this->assertEquals($expected, $actual);
   }
 
index 1f8a1a68f0026b987a023d54edf3325fb03e566d..128db9ea2ad89d30dec9f57fc32cf5186d9133d8 100644 (file)
@@ -202,10 +202,10 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase {
   public function testCallback_commit() {
     $tx = new CRM_Core_Transaction();
 
-    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_COMMIT, array($this, '_preCommit'), array('qwe','rty'));
-    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, array($this, '_postCommit'), array('uio','p[]'));
-    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_ROLLBACK, array($this, '_preRollback'), array('asd','fgh'));
-    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_ROLLBACK, array($this, '_postRollback'), array('jkl',';'));
+    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_COMMIT, array($this, '_preCommit'), array('qwe', 'rty'));
+    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, array($this, '_postCommit'), array('uio', 'p[]'));
+    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_ROLLBACK, array($this, '_preRollback'), array('asd', 'fgh'));
+    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_ROLLBACK, array($this, '_postRollback'), array('jkl', ';'));
 
     CRM_Core_DAO::executeQuery('UPDATE civicrm_contact SET id = 100 WHERE id = 100');
 
@@ -218,10 +218,10 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase {
   public function testCallback_rollback() {
     $tx = new CRM_Core_Transaction();
 
-    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_COMMIT, array($this, '_preCommit'), array('ewq','ytr'));
-    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, array($this, '_postCommit'), array('oiu','][p'));
-    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_ROLLBACK, array($this, '_preRollback'), array('dsa','hgf'));
-    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_ROLLBACK, array($this, '_postRollback'), array('lkj',';'));
+    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_COMMIT, array($this, '_preCommit'), array('ewq', 'ytr'));
+    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, array($this, '_postCommit'), array('oiu', '][p'));
+    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_ROLLBACK, array($this, '_preRollback'), array('dsa', 'hgf'));
+    CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_ROLLBACK, array($this, '_postRollback'), array('lkj', ';'));
 
     CRM_Core_DAO::executeQuery('UPDATE civicrm_contact SET id = 100 WHERE id = 100');
     $tx->rollback();
index 9bd434a5d1b8946de0adbff34282a047e3ace337..3b8c19d813b99e36a824ad4069d86fa956f6a333 100644 (file)
@@ -191,7 +191,7 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase {
         'location_type_id' => 1,
         'version' => 3,
       );
-      $result = civicrm_api( 'address','create',$params );
+      $result = civicrm_api( 'address', 'create', $params );
       $contactIds[$count++] = $contact['id'];
     }
 
index 848e7f084ef4f6bad51316074f3b4c9e2c9c94c6..c6a41fdb4e404b56149769b5ced7c38c2b4b0ba0 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Event_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 810f98eb25a8a6a972fff479300c12c9aab51444..5d898e44ad28841938df944893be8470bdb2bdd0 100644 (file)
@@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for CRM_Event_BAO_ParticipantStatus BAO
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Event_BAO_ParticipantStatusTest extends CiviUnitTestCase {
 
@@ -49,7 +49,8 @@ class CRM_Event_BAO_ParticipantStatusTest extends CiviUnitTestCase {
    * This method is called after a test is executed.
    *
    */
-  protected function tearDown() {}
+  protected function tearDown() {
+  }
 
   /**
    *  create() and deleteParticipantStatusType() method
index e1ce4bc97c3c62cb961acc1a2225e3ecbb1043a2..e5da16f22fb60cf8995ebe2e2326772ac47bf60e 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Extension_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index e57e97caab2e76f1f6ab10e51916c093670055eb..ee94f0d827bb8d7ad62c33809a36a69d240ecd39 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Extension_Container_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 49831b9f5ab87bb898182bd5a3efb0d619866bfe..51dbeb9aea6b2e4ccafd3c6fe38dbac8c67a3955 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Extension_Manager_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 95c350a150036a02f06124468217a139ea0141d2..af009037d9bfa48704dbfb6a42ffc85888d9f92b 100644 (file)
@@ -254,7 +254,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase {
   public function assertModuleActiveByKey($expectedIsActive, $key) {
     foreach (CRM_Core_Module::getAll() as $module) {
       if ($module->name == $key) {
-        $this->assertEquals((bool)$expectedIsActive, (bool)$module->is_active);
+        $this->assertEquals((bool) $expectedIsActive, (bool) $module->is_active);
         return;
       }
     }
index de6e15cbac93bfd25bf9a30e16bfd84faafbbadd..a6df900deb6c002d27bd85c7273045658a819c74 100755 (executable)
@@ -78,7 +78,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase {
     CRM_Financial_BAO_FinancialItem::add($lineItem, $contribution);
     $result = $this->assertDBNotNull(
       'CRM_Financial_DAO_FinancialItem',
-      $lineItem->id ,
+      $lineItem->id,
       'amount',
       'entity_id',
       'Database check on added financial item record.'
@@ -192,7 +192,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase {
 
     $result = $this->assertDBNotNull(
       'CRM_Financial_DAO_FinancialItem',
-      $lineItem->id ,
+      $lineItem->id,
       'amount',
       'entity_id',
       'Database check on added financial item record.'
@@ -201,7 +201,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase {
     $this->assertEquals( $result, $price, 'Verify Amount for Financial Item');
     $entityResult = $this->assertDBNotNull(
       'CRM_Financial_DAO_EntityFinancialTrxn',
-      $entityId ,
+      $entityId,
       'amount',
       'entity_id',
       'Database check on added entity financial trxn record.'
@@ -236,7 +236,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase {
     $entityTrxn = CRM_Financial_BAO_FinancialItem::createEntityTrxn($params);
     $entityResult = $this->assertDBNotNull(
       'CRM_Financial_DAO_EntityFinancialTrxn',
-      $financialTrxn->id ,
+      $financialTrxn->id,
       'amount',
       'financial_trxn_id',
       'Database check on added entity financial trxn record.'
index c28fcdb910d8cdd66fc8b8173a1711222d4a9418..f6c16c81c29e418774cf327f4f2ed627cd50476e 100755 (executable)
@@ -99,7 +99,7 @@ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase {
     CRM_Financial_BAO_FinancialTypeAccount::del($financialAccountType->id);
     $params = array('id' => $financialAccountType->id );
     $result = CRM_Financial_BAO_FinancialType::retrieve($params, $defaults);
-    $this->assertEquals( empty($result), true, 'Verify financial types record deletion.');
+    $this->assertEquals( empty($result), TRUE, 'Verify financial types record deletion.');
   }
 
   /**
index dfda1823ee73205d41bc12af8898df38be1d6a90..7124a262775bd8bed893aabcd6267e5407d4b2da 100755 (executable)
@@ -53,7 +53,7 @@ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase {
     $financialType = CRM_Financial_BAO_FinancialType::add($params, $ids);
     $result = $this->assertDBNotNull(
       'CRM_Financial_DAO_FinancialType',
-      $financialType->id ,
+      $financialType->id,
       'name',
       'id',
       'Database check on added financial type record.'
@@ -92,10 +92,10 @@ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase {
     $ids = array();
     $financialType = CRM_Financial_BAO_FinancialType::add($params, $ids);
     $result = CRM_Financial_BAO_FinancialType::setIsActive($financialType->id, 0);
-    $this->assertEquals($result, true , 'Verify financial type record updation for is_active.');
+    $this->assertEquals($result, TRUE, 'Verify financial type record updation for is_active.');
     $isActive = $this->assertDBNotNull(
       'CRM_Financial_DAO_FinancialType',
-      $financialType->id ,
+      $financialType->id,
       'is_active',
       'id',
       'Database check on updated for financial type is_active.'
@@ -118,6 +118,6 @@ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase {
     CRM_Financial_BAO_FinancialType::del($financialType->id);
     $params = array('id' => $financialType->id);
     $result = CRM_Financial_BAO_FinancialType::retrieve($params, $defaults);
-    $this->assertEquals(empty($result), true, 'Verify financial types record deletion.');
+    $this->assertEquals(empty($result), TRUE, 'Verify financial types record deletion.');
   }
 }
index d92c4ea4fd90c6f239820e65d7e4c307c7137dd9..d86e5076a5ace32c6eae51fdffdaf95731be7d94 100644 (file)
@@ -414,14 +414,14 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase {
   }
 
   /**
-  * Implements ACLGroup hook
-  * aclGroup function returns a list of permitted groups
-  * @param string $type
-  * @param int $contactID
-  * @param string $tableName
-  * @param array $allGroups
-  * @param array $currentGroups
-  */
+   * Implements ACLGroup hook
+   * aclGroup function returns a list of permitted groups
+   * @param string $type
+   * @param int $contactID
+   * @param string $tableName
+   * @param array $allGroups
+   * @param array $currentGroups
+   */
   public function hook_civicrm_aclGroup($type, $contactID, $tableName, &$allGroups, &$currentGroups) {
     //don't use api - you will get a loop
     $sql = " SELECT * FROM civicrm_group WHERE name LIKE '%pick%'";
index 0967ee2d44a4f541c4127ea5b89e586eb9eca1a2..d79e9d22e1b9d64c54a0e9c8134d1f270e0730e2 100644 (file)
@@ -38,7 +38,7 @@ class CRM_Mailing_BAO_QueryTest extends CiviUnitTestCase {
 
   /**
    *  Test CRM_Contact_BAO_Query::searchQuery()
-   *  @dataProvider dataProvider
+   * @dataProvider dataProvider
    */
   public function testSearch($fv, $count, $ids, $full) {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
index d52610290170f1fb19e915fe4a080c3c7093d0b9..ee809168f8742cc9bb17a436181fcc01e7403caa 100644 (file)
 /**
  *  Provide data to the CRM_Mailing_BAO_QueryTest class
  *
- *  @package CiviCRM
+ * @package CiviCRM
  */
 class CRM_Mailing_BAO_QueryTestDataProvider implements Iterator {
 
   /**
-   *  @var integer
+   * @var integer
    */
   private $i = 0;
 
   /**
-   *  @var mixed[]
+   * @var mixed[]
    *  This dataset describes various form values and what contact
    *  IDs should be selected when the form values are applied to the
    *  database in dataset.xml
    */
   private $dataset = array(
-    array('fv' => array('mailing_name' => 'First%', 'mailing_open_status' => 'Y'),
+    array(
+  'fv' => array('mailing_name' => 'First%', 'mailing_open_status' => 'Y'),
       'id' => array(109, 110, 111, 112),
     ),
-    array('fv' => array('mailing_name' => 'First%', 'mailing_open_status' => 'N'),
+    array(
+  'fv' => array('mailing_name' => 'First%', 'mailing_open_status' => 'N'),
       'id' => array(102, 103, 104, 105, 108),
     ),
     /*bounce*/
     array(
-      'fv' => array('mailing_name' => 'First%', 'mailing_delivery_status'
+      'fv' => array(
+  'mailing_name' => 'First%',
+  'mailing_delivery_status'
         => 'N'),
       'id' => array(105),
     ),
     /*bounce*/
     array(
-      'fv' => array('mailing_name' => 'First%', 'mailing_delivery_status'
+      'fv' => array(
+  'mailing_name' => 'First%',
+  'mailing_delivery_status'
         => 'Y'),
       'id' => array(102, 103, 104, 108, 109, 110, 111, 112),
     ),
-    array('fv' => array('mailing_name' => 'First%', 'mailing_reply_status' => 'Y'),
+    array(
+  'fv' => array('mailing_name' => 'First%', 'mailing_reply_status' => 'Y'),
       'id' => array(103, 108, 110, 112),
     ),
-    array('fv' => array('mailing_name' => 'First%', 'mailing_reply_status' => 'N'),
+    array(
+  'fv' => array('mailing_name' => 'First%', 'mailing_reply_status' => 'N'),
       'id' => array(102, 104, 105, 109, 111),
     ),
-    array('fv' => array('mailing_name' => 'First%', 'mailing_click_status' => 'Y'),
+    array(
+  'fv' => array('mailing_name' => 'First%', 'mailing_click_status' => 'Y'),
       'id' => array(104, 108, 111, 112),
     ),
-    array('fv' => array('mailing_name' => 'First%', 'mailing_click_status' => 'N'),
+    array(
+  'fv' => array('mailing_name' => 'First%', 'mailing_click_status' => 'N'),
       'id' => array(102, 103, 105, 109, 110),
     ),
     /*bounce*/
     array(
-      'fv' => array('mailing_name' => 'Second%', 'mailing_delivery_status'
+      'fv' => array(
+  'mailing_name' => 'Second%',
+  'mailing_delivery_status'
         => 'N'),
       'id' => array(),
     ),
     /*bounce*/
     array(
-      'fv' => array('mailing_name' => 'Second%', 'mailing_delivery_status'
+      'fv' => array(
+  'mailing_name' => 'Second%',
+  'mailing_delivery_status'
         => 'Y'),
       'id' => array(102, 103, 104, 108, 109, 110, 111, 112),
     ),
-    array('fv' => array('mailing_name' => 'Second%', 'mailing_reply_status' => 'Y'),
+    array(
+  'fv' => array('mailing_name' => 'Second%', 'mailing_reply_status' => 'Y'),
       'id' => array(103),
     ),
-    array('fv' => array('mailing_name' => 'Second%', 'mailing_click_status' => 'Y'),
+    array(
+  'fv' => array('mailing_name' => 'Second%', 'mailing_click_status' => 'Y'),
       'id' => array(104),
     ),
-    array('fv' => array('mailing_name' => 'Second%', 'mailing_click_status' => 'N'),
+    array(
+  'fv' => array('mailing_name' => 'Second%', 'mailing_click_status' => 'N'),
       'id' => array(102, 103, 108, 109, 110, 111, 112),
     ),
-    array('fv' => array('mailing_date_high' => '2011-05-25', 'mailing_open_status' => 'Y'),
+    array(
+  'fv' => array('mailing_date_high' => '2011-05-25', 'mailing_open_status' => 'Y'),
       'id' => array(109, 110, 111, 112),
     ),
-    array('fv' => array('mailing_date_high' => '2011-05-25', 'mailing_open_status' => 'N'),
+    array(
+  'fv' => array('mailing_date_high' => '2011-05-25', 'mailing_open_status' => 'N'),
       'id' => array(102, 103, 104, 105, 108),
     ),
-    array('fv' => array('mailing_date_low' => '2011-05-26', 'mailing_open_status' => 'Y'),
+    array(
+  'fv' => array('mailing_date_low' => '2011-05-26', 'mailing_open_status' => 'Y'),
       'id' => array(102),
     ),
-    array('fv' => array('mailing_date_low' => '2011-05-26', 'mailing_open_status' => 'N'),
+    array(
+  'fv' => array('mailing_date_low' => '2011-05-26', 'mailing_open_status' => 'N'),
       'id' => array(103, 104, 108, 109, 110, 111, 112),
     ),
   );
index 71e78c0f4433ebf7d65304eb03e8f1d37dcde249..30df7dd12b7e86e09380c54cde93d2643b59d193 100644 (file)
@@ -11,13 +11,13 @@ require_once 'CiviTest/CiviMailUtils.php';
  */
 class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase {
 
-  protected $_mut = null;
+  protected $_mut = NULL;
 
   protected static $bodytext = 'Unit tests keep children safe.';
 
   public function setUp() {
     parent::setUp();
-    $this->_mut = new CiviMailUtils( $this, true );
+    $this->_mut = new CiviMailUtils( $this, TRUE );
   }
 
   public function tearDown() {
@@ -76,15 +76,16 @@ class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase {
    * @param $context
    * @param $mailPart
    */
-  public static function mailWalkCallback( $context, $mailPart ) {
+  public static function mailWalkCallback($context, $mailPart) {
     if ( $mailPart instanceof ezcMailText ) {
       switch ( $mailPart->subType ) {
-      case 'plain':
-        self::assertContains( self::$bodytext, $mailPart->generateBody() );
-        break;
-      case 'html':
-        self::assertContains( self::$bodytext . '</p>', $mailPart->generateBody() );
-        break;
+        case 'plain':
+          self::assertContains( self::$bodytext, $mailPart->generateBody() );
+          break;
+
+        case 'html':
+          self::assertContains( self::$bodytext . '</p>', $mailPart->generateBody() );
+          break;
       }
     }
   }
index fee55687c08ac0d607a2b4e13d3a111dd36da924..bbb1e5490cb2a3a4cfb0b64c572710d7a8037240 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Member_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 2c53db8f2f3ce2e4f9ee9b203201445993317c8e..e2a758941452f8a72f27520f583b69238c3911f9 100644 (file)
@@ -5,7 +5,7 @@
  *
  *  (PHP 5)
  *
- *   @package   CiviCRM
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -31,7 +31,7 @@ require_once 'CiviTest/Membership.php';
 /**
  *  Test CRM/Member/BAO Membership Log add , delete functions
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase {
 
@@ -88,9 +88,9 @@ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_mebershipStatusID,
@@ -116,9 +116,9 @@ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_mebershipStatusID,
@@ -145,9 +145,9 @@ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_mebershipStatusID,
index 6f54571cc8f1bdde6629d20bc06c96d80751d9c9..e747af7d69cf0c4134be416702f7700b8fe8086b 100644 (file)
@@ -73,7 +73,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $this->membershipStatusDelete( $this->_membershipStatusID );
     Contact::delete( $this->_contactID );
 
-    $this->_contactID = $this->_membershipStatusID = $this->_membershipTypeID = null;
+    $this->_contactID = $this->_membershipStatusID = $this->_membershipTypeID = NULL;
   }
 
   public function testCreate() {
@@ -83,9 +83,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
@@ -103,9 +103,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
@@ -189,9 +189,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
@@ -217,9 +217,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
@@ -239,9 +239,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'PaySource',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
@@ -277,9 +277,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
@@ -304,9 +304,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
@@ -337,9 +337,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
@@ -347,7 +347,6 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $ids = array();
     CRM_Member_BAO_Membership::create($params, $ids);
 
-
     $membershipId = $this->assertDBNotNull('CRM_Member_BAO_Membership', $contactId, 'id',
       'contact_id', 'Database check for created membership.'
     );
@@ -368,9 +367,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
@@ -400,9 +399,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
@@ -433,9 +432,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
@@ -468,9 +467,9 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $contactId,
       'membership_type_id' => $this->_membershipTypeID,
-      'join_date' => date('Ymd',strtotime('2006-01-21')),
-      'start_date' => date('Ymd',strtotime('2006-01-21')),
-      'end_date' => date('Ymd',strtotime('2006-12-21')),
+      'join_date' => date('Ymd', strtotime('2006-01-21')),
+      'start_date' => date('Ymd', strtotime('2006-01-21')),
+      'end_date' => date('Ymd', strtotime('2006-12-21')),
       'source' => 'Payment',
       'is_override' => 1,
       'status_id' => $this->_membershipStatusID,
index ca7c7ae2f734f2761ea225dba4d624737f06f657..efb4cf5d9de3f92ceb232467f2eece892116ddbb 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Member_Form_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 47d1ffb1c425f439364b019b317628c1eb4d3d66..75f82ba96571a106a5444aadcdd6f09654c7704f 100644 (file)
@@ -5,11 +5,11 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @package   CiviCRM
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'HTML/QuickForm/Page.php';
 /**
  *  Test APIv2 civicrm_activity_* functions
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
 
@@ -353,7 +353,8 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
   public function testFormRuleOverrideNoStatus() {
     $unixNow         = time();
     $unixYearFromNow = $unixNow + (365 * 24 * 60 * 60);
-    $params          = array('join_date' => date('m/d/Y', $unixNow),
+    $params          = array(
+    'join_date' => date('m/d/Y', $unixNow),
       'membership_type_id' => array('23', '13'),
       'is_override' => TRUE,
     );
@@ -375,7 +376,8 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
   public function testFormRuleRollingJoin1MonthFromNow() {
     $unixNow     = time();
     $unix1MFmNow = $unixNow + (31 * 24 * 60 * 60);
-    $params      = array('join_date' => date('m/d/Y', $unix1MFmNow),
+    $params      = array(
+    'join_date' => date('m/d/Y', $unix1MFmNow),
       'start_date' => '',
       'end_date' => '',
       'membership_type_id' => array('23', '3'),
@@ -399,7 +401,8 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
    */
   public function testFormRuleRollingJoinToday() {
     $unixNow = time();
-    $params = array('join_date' => date('m/d/Y', $unixNow),
+    $params = array(
+    'join_date' => date('m/d/Y', $unixNow),
       'start_date' => '',
       'end_date' => '',
       'membership_type_id' => array('23', '3'),
@@ -419,7 +422,8 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
   public function testFormRuleRollingJoin1MonthAgo() {
     $unixNow   = time();
     $unix1MAgo = $unixNow - (31 * 24 * 60 * 60);
-    $params    = array('join_date' => date('m/d/Y', $unix1MAgo),
+    $params    = array(
+    'join_date' => date('m/d/Y', $unix1MAgo),
       'start_date' => '',
       'end_date' => '',
       'membership_type_id' => array('23', '3'),
@@ -439,7 +443,8 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
   public function testFormRuleRollingJoin6MonthsAgo() {
     $unixNow   = time();
     $unix6MAgo = $unixNow - (180 * 24 * 60 * 60);
-    $params    = array('join_date' => date('m/d/Y', $unix6MAgo),
+    $params    = array(
+    'join_date' => date('m/d/Y', $unix6MAgo),
       'start_date' => '',
       'end_date' => '',
       'membership_type_id' => array('23', '3'),
@@ -459,7 +464,8 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
   public function testFormRuleRollingJoin1YearAgo() {
     $unixNow   = time();
     $unix1YAgo = $unixNow - (370 * 24 * 60 * 60);
-    $params    = array('join_date' => date('m/d/Y', $unix1YAgo),
+    $params    = array(
+    'join_date' => date('m/d/Y', $unix1YAgo),
       'start_date' => '',
       'end_date' => '',
       'membership_type_id' => array('23', '3'),
@@ -479,7 +485,8 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
   public function testFormRuleRollingJoin2YearsAgo() {
     $unixNow   = time();
     $unix2YAgo = $unixNow - (2 * 365 * 24 * 60 * 60);
-    $params    = array('join_date' => date('m/d/Y', $unix2YAgo),
+    $params    = array(
+    'join_date' => date('m/d/Y', $unix2YAgo),
       'start_date' => '',
       'end_date' => '',
       'membership_type_id' => array('23', '3'),
@@ -499,7 +506,8 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
   public function testFormRuleFixedJoin6MonthsAgo() {
     $unixNow   = time();
     $unix6MAgo = $unixNow - (180 * 24 * 60 * 60);
-    $params    = array('join_date' => date('m/d/Y', $unix6MAgo),
+    $params    = array(
+    'join_date' => date('m/d/Y', $unix6MAgo),
       'start_date' => '',
       'end_date' => '',
       'membership_type_id' => array('23', '7'),
index eacc78812bc4dbf1f642e2cf25ae85544503c01e..b140789e98608179911f94b363c5ad84c2bc4c55 100644 (file)
@@ -5,7 +5,7 @@
  *
  *  (PHP 5)
  *
- *   @package   CiviCRM
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -31,7 +31,7 @@ require_once 'CiviTest/Membership.php';
 /**
  *  Test CRM/Member/BAO Membership Log add , delete functions
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase {
   /**
@@ -131,7 +131,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase {
       'mapper[1][0]' => 'membership_type_id',
       'mapper[2][0]' => 'membership_start_date',
     );
-/*
+    /*
 
     $params = array(
       'contact_id' => $contactId,
index 883e1639d650a0f28893fa3cb18a495ff9a8497e..791045e0d0075446dcdce8026e71cb6b80953607 100644 (file)
@@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for CRM_PCP_BAO_PCPTest BAO
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_PCP_BAO_PCPTest extends CiviUnitTestCase {
 
@@ -186,5 +186,6 @@ class CRM_PCP_BAO_PCPTest extends CiviUnitTestCase {
    * This method is called after a test is executed.
    *
    */
-  protected function tearDown() {}
+  protected function tearDown() {
+  }
 }
index 42b753847ac5b70a3dfe0641037d3710c955fcb6..53fd640b2fe17b41b10b2b8734c3eb607c7687cc 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Pledge_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 3ec199c0adb2e831105c739ddbc35db8cfa46302..ee9365aaa692778a1d4df56a1620fd8d1a50cbdc 100644 (file)
@@ -32,7 +32,7 @@ require_once 'CiviTest/ContributionPage.php';
 /**
  * Test class for CRM_Pledge_BAO_PledgeBlock BAO
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Pledge_BAO_PledgeBlockTest extends CiviUnitTestCase {
 
@@ -51,7 +51,8 @@ class CRM_Pledge_BAO_PledgeBlockTest extends CiviUnitTestCase {
    * This method is called after a test is executed.
    *
    */
-  protected function tearDown() {}
+  protected function tearDown() {
+  }
 
   /**
    *  create() and deletepledgeblock() method
index 7187d1f26e6ccd20a8d12dbc9e4c70ea588d7d06..cc65a250ac004bcceacc984b5f76d760d4d7f5e9 100644 (file)
@@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for CRM_Pledge_BAO_PledgePayment BAO
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase {
 
@@ -49,7 +49,8 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase {
    * This method is called after a test is executed.
    *
    */
-  protected function tearDown() {}
+  protected function tearDown() {
+  }
 
   /**
    *  Test for Add/Update Pledge Payment.
@@ -146,7 +147,7 @@ class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase {
    */
   public function testDeletePledgePaymentsNullId() {
     $payment = CRM_Core_DAO::createTestObject('CRM_Pledge_BAO_PledgePayment');
-    $paymentid = CRM_Pledge_BAO_PledgePayment::deletePayments(Null);
+    $paymentid = CRM_Pledge_BAO_PledgePayment::deletePayments(NULL);
     $this->assertEquals(count($paymentid), 1, "No payments deleted");
     $result = CRM_Pledge_BAO_Pledge::deletePledge($payment->pledge_id);
   }
index fcc1fe084c49b15e899c9de158656fd1e5c40bdf..860a9f3c096da557244bf18f02db311ab7960c16 100644 (file)
@@ -32,7 +32,7 @@ require_once 'CiviTest/Contact.php';
 /**
  * Test class for CRM_Pledge_BAO_Pledge BAO
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Pledge_BAO_PledgeTest extends CiviUnitTestCase {
 
@@ -51,7 +51,8 @@ class CRM_Pledge_BAO_PledgeTest extends CiviUnitTestCase {
    * This method is called after a test is executed.
    *
    */
-  protected function tearDown() {}
+  protected function tearDown() {
+  }
 
   /**
    *  Test for Add/Update Pledge.
index f55bf3e0c09f990953a25460a3609f6a5f536f0c..4c5a951827aca3d5b02c884d704aa990521f66e9 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 25163 2009-11-17 23:43:46Z walt $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 25163 2009-11-17 23:43:46Z walt $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Queue_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 25391ca56fe15a42ed4db4f00ea0876f7a62b93a..adf03c9d1954cc428df1a718469fdb58b35bd96f 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 25163 2009-11-17 23:43:46Z walt $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 25163 2009-11-17 23:43:46Z walt $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Queue_Queue_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index d4e824812d9de5ab69d4e2b1cabfd39acf5cd5c1..fad576b0bcba0b30178a97ac85593682e563af1b 100644 (file)
@@ -59,9 +59,9 @@ class CRM_Utils_ArrayTest extends CiviUnitTestCase {
     $this->assertEquals($expected, CRM_Utils_Array::collect('catWord', $arr));
 
     $arr = array();
-    $arr['en']= (object) array('catWord' => 'cat', 'dogWord' => 'dog');
-    $arr['fr']= (object) array('catWord' => 'chat', 'dogWord' => 'chien');
-    $arr['es']= (object) array('catWord' => 'gato');
+    $arr['en'] = (object) array('catWord' => 'cat', 'dogWord' => 'dog');
+    $arr['fr'] = (object) array('catWord' => 'chat', 'dogWord' => 'chien');
+    $arr['es'] = (object) array('catWord' => 'gato');
     $expected = array('en' => 'cat', 'fr' => 'chat', 'es' => 'gato');
     $this->assertEquals($expected, CRM_Utils_Array::collect('catWord', $arr));
   }
@@ -107,11 +107,11 @@ class CRM_Utils_ArrayTest extends CiviUnitTestCase {
   public function testIsSubset() {
     $this->assertTrue(CRM_Utils_Array::isSubset(array(), array()));
     $this->assertTrue(CRM_Utils_Array::isSubset(array('a'), array('a')));
-    $this->assertTrue(CRM_Utils_Array::isSubset(array('a'), array('b','a','c')));
-    $this->assertTrue(CRM_Utils_Array::isSubset(array('b','d'), array('a','b','c','d')));
+    $this->assertTrue(CRM_Utils_Array::isSubset(array('a'), array('b', 'a', 'c')));
+    $this->assertTrue(CRM_Utils_Array::isSubset(array('b', 'd'), array('a', 'b', 'c', 'd')));
     $this->assertFalse(CRM_Utils_Array::isSubset(array('a'), array()));
     $this->assertFalse(CRM_Utils_Array::isSubset(array('a'), array('b')));
-    $this->assertFalse(CRM_Utils_Array::isSubset(array('a'), array('b','c','d')));
+    $this->assertFalse(CRM_Utils_Array::isSubset(array('a'), array('b', 'c', 'd')));
   }
 
   public function testRemove() {
index da64970fc3e6f64a8fad46ceac7105ce2b49749d..9f87bede3f897ccd66893da92569f4b18206f6bf 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class CRM_Utils_Cache_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 4798f40962cf95d77be791d464548ad88fe6d5d9..671b38d2cf35395a470317f031d2939199c71629 100644 (file)
@@ -17,7 +17,8 @@ class CRM_Utils_MailTest extends CiviUnitTestCase {
   public function testFormatRFC822() {
 
     $values = array(
-      array('name' => "Test User",
+      array(
+    'name' => "Test User",
         'email' => "foo@bar.com",
         'result' => "Test User <foo@bar.com>",
       ),
index dac2682a48e51af34c5eb0bd09cf72492fee9773..81115a8eaf5704206a742057358804c571ea6a6e 100644 (file)
@@ -45,12 +45,12 @@ class CRM_Utils_NumberTest extends CiviUnitTestCase {
   public function truncDecimalCases() {
     $cases = array();
     // array($value, $precision, $expectedValue)
-    $cases[] = array(523, array(1,0), 5);
-    $cases[] = array(523, array(5,2), 523);
-    $cases[] = array(523, array(10,8), 52.3);
-    $cases[] = array(12345, array(3,3), 0.123);
-    $cases[] = array(0.12345, array(10,0), 12345);
-    $cases[] = array(-123.45, array(4,2), -12.34);
+    $cases[] = array(523, array(1, 0), 5);
+    $cases[] = array(523, array(5, 2), 523);
+    $cases[] = array(523, array(10, 8), 52.3);
+    $cases[] = array(12345, array(3, 3), 0.123);
+    $cases[] = array(0.12345, array(10, 0), 12345);
+    $cases[] = array(-123.45, array(4, 2), -12.34);
     return $cases;
   }
 
index cafcb150e6e305ccf8cfabfeddebb34ec9114262..c3f416c70efba0d1c921a11042ae5ada8f186e0f 100644 (file)
@@ -10,40 +10,40 @@ class CRM_Utils_QueryFormatterTest extends CiviUnitTestCase {
   public function dataProvider() {
     $cases = array(); // array(0=>$inputText, 1=>$language, 2=>$options, 3=>$expectedText)
 
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, CRM_Utils_QueryFormatter::MODE_NONE,             '%first second%');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, CRM_Utils_QueryFormatter::MODE_PHRASE,           '%first second%');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, CRM_Utils_QueryFormatter::MODE_WILDPHRASE,       '%first second%');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, CRM_Utils_QueryFormatter::MODE_WILDWORDS,        '%first%second%');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, CRM_Utils_QueryFormatter::MODE_NONE, '%first second%');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, CRM_Utils_QueryFormatter::MODE_PHRASE, '%first second%');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, CRM_Utils_QueryFormatter::MODE_WILDPHRASE, '%first second%');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, CRM_Utils_QueryFormatter::MODE_WILDWORDS, '%first%second%');
     $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, CRM_Utils_QueryFormatter::MODE_WILDWORDS_SUFFIX, '%first%second%');
 
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTS, CRM_Utils_QueryFormatter::MODE_NONE,             'first second');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTS, CRM_Utils_QueryFormatter::MODE_PHRASE,           '"first second"');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTS, CRM_Utils_QueryFormatter::MODE_WILDPHRASE,       '"*first second*"');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTS, CRM_Utils_QueryFormatter::MODE_WILDWORDS,        '*first* *second*');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTS, CRM_Utils_QueryFormatter::MODE_NONE, 'first second');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTS, CRM_Utils_QueryFormatter::MODE_PHRASE, '"first second"');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTS, CRM_Utils_QueryFormatter::MODE_WILDPHRASE, '"*first second*"');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTS, CRM_Utils_QueryFormatter::MODE_WILDWORDS, '*first* *second*');
     $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTS, CRM_Utils_QueryFormatter::MODE_WILDWORDS_SUFFIX, 'first* second*');
 
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, CRM_Utils_QueryFormatter::MODE_NONE,             '+first +second');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, CRM_Utils_QueryFormatter::MODE_PHRASE,           '+"first second"');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, CRM_Utils_QueryFormatter::MODE_WILDPHRASE,       '+"*first second*"');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, CRM_Utils_QueryFormatter::MODE_WILDWORDS,        '+*first* +*second*');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, CRM_Utils_QueryFormatter::MODE_NONE, '+first +second');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, CRM_Utils_QueryFormatter::MODE_PHRASE, '+"first second"');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, CRM_Utils_QueryFormatter::MODE_WILDPHRASE, '+"*first second*"');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, CRM_Utils_QueryFormatter::MODE_WILDWORDS, '+*first* +*second*');
     $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, CRM_Utils_QueryFormatter::MODE_WILDWORDS_SUFFIX, '+first* +second*');
 
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SOLR, CRM_Utils_QueryFormatter::MODE_NONE,             'first second');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SOLR, CRM_Utils_QueryFormatter::MODE_PHRASE,           '"first second"');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SOLR, CRM_Utils_QueryFormatter::MODE_WILDPHRASE,       '"*first second*"');
-    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SOLR, CRM_Utils_QueryFormatter::MODE_WILDWORDS,        '*first* *second*');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SOLR, CRM_Utils_QueryFormatter::MODE_NONE, 'first second');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SOLR, CRM_Utils_QueryFormatter::MODE_PHRASE, '"first second"');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SOLR, CRM_Utils_QueryFormatter::MODE_WILDPHRASE, '"*first second*"');
+    $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SOLR, CRM_Utils_QueryFormatter::MODE_WILDWORDS, '*first* *second*');
     $cases[] = array('first second', CRM_Utils_QueryFormatter::LANG_SOLR, CRM_Utils_QueryFormatter::MODE_WILDWORDS_SUFFIX, 'first* second*');
 
     // if user supplies wildcards, then ignore mode
     foreach (array(CRM_Utils_QueryFormatter::MODE_NONE, CRM_Utils_QueryFormatter::MODE_WILDPHRASE, CRM_Utils_QueryFormatter::MODE_WILDWORDS, CRM_Utils_QueryFormatter::MODE_WILDWORDS_SUFFIX) as $mode) {
-      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE,     $mode, 'first% second');
-      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SQL_FTS,      $mode, 'first* second');
-      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL,  $mode, '+first* +second');
-      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SOLR,         $mode, 'first* second');
-      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SQL_LIKE,     $mode, 'first second%');
-      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SQL_FTS,      $mode, 'first second*');
-      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL,  $mode, '+first +second*');
-      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SOLR,         $mode, 'first second*');
+      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, $mode, 'first% second');
+      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SQL_FTS, $mode, 'first* second');
+      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, $mode, '+first* +second');
+      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SOLR, $mode, 'first* second');
+      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, $mode, 'first second%');
+      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SQL_FTS, $mode, 'first second*');
+      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, $mode, '+first +second*');
+      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SOLR, $mode, 'first second*');
     }
 
     return $cases;
index 01cdd5e618b6649079d7587a49840bc1dda5a4e2..bb11f4ace98e3d21cb818416bc5b34cfe34f124a 100644 (file)
@@ -8,8 +8,7 @@ class CRM_Utils_SQL_InsertTest extends CiviUnitTestCase {
   public function testRow_twice() {
     $insert = CRM_Utils_SQL_Insert::into('foo')
       ->row(array('first' => '1', 'second' => '2' ))
-      ->row(array('second' => '2b', 'first' => '1b'))
-      ;
+      ->row(array('second' => '2b', 'first' => '1b'));
     $expected = '
       INSERT INTO foo (`first`,`second`) VALUES
       ("1","2"),
@@ -25,8 +24,7 @@ class CRM_Utils_SQL_InsertTest extends CiviUnitTestCase {
       array('second' => '2b', 'first' => '1b'),
       array('first' => '1c', 'second' => '2c')
       ))
-      ->row(array('second' => '2d', 'first' => '1d'))
-    ;
+      ->row(array('second' => '2d', 'first' => '1d'));
     $expected = '
       INSERT INTO foo (`first`,`second`) VALUES
       ("1","2"),
index c0cdad913efff5cd90faa86d2c925f9ae4cf2286..20d4fdf4601f0b889361e850cb68d03e618566a9 100644 (file)
@@ -119,9 +119,9 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase {
     $actual = CRM_Utils_SQL_Select::from('ignore')->interpolate(
       '(@escaped) (!unescaped) (#validated)',
       array(
-        '@escaped' => array('foo"bar', "whiz", "null", null, "bang"),
+        '@escaped' => array('foo"bar', "whiz", "null", NULL, "bang"),
         '!unescaped' => array('foo"bar', 'bar'),
-        '#validated' => array(1, 10, null, 100.1)
+        '#validated' => array(1, 10, NULL, 100.1)
       )
     );
     $this->assertLike('("foo\\"bar", "whiz", "null", NULL, "bang") (foo"bar, bar) (1, 10, NULL, 100.1)', $actual);
index fd32bc9cba054448539423fbdc3e78e0be92bc46..5d3bb4e2fd7fc4199cadeaea6f6e01fa925d3b5d 100644 (file)
@@ -21,7 +21,6 @@ class CRM_Utils_StringTest extends CiviUnitTestCase {
       'civicrm dashboard & force = 1,;' => 'civicrm_dashboard___force___1__',
     );
 
-
     foreach ($testSet as $in => $expected) {
       $out = CRM_Utils_String::stripPathChars($in);
       $this->assertEquals($out, $expected, "Output does not match");
index e67b75a601098080645e8012f5e85d45504c33bf..7506bdac9a46a401764bd6d829a96518ed6d7bf1 100644 (file)
@@ -15,7 +15,7 @@ class CRM_Utils_SystemTest extends CiviUnitTestCase {
     $config = CRM_Core_Config::singleton();
     $this->assertTrue($config->userSystem instanceof CRM_Utils_System_UnitTests);
     $expected = '/index.php?q=civicrm/foo/bar&foo=ab&bar=cd%26ef';
-    $actual = CRM_Utils_System::url('civicrm/foo/bar', 'foo=ab&bar=cd%26ef', false, null, false);
+    $actual = CRM_Utils_System::url('civicrm/foo/bar', 'foo=ab&bar=cd%26ef', FALSE, NULL, FALSE);
     $this->assertEquals($expected, $actual);
   }
 
@@ -26,7 +26,7 @@ class CRM_Utils_SystemTest extends CiviUnitTestCase {
     $actual = CRM_Utils_System::url('civicrm/foo/bar', array(
       'foo' => 'ab',
       'bar' => 'cd&ef',
-    ), false, null, false);
+    ), FALSE, NULL, FALSE);
     $this->assertEquals($expected, $actual);
   }
 
index a2d28d2dd465bd2dbe89d4eebecff638049b59db..3e881d7c9f96ea138f8c9d812712638b95262d10 100644 (file)
@@ -30,20 +30,20 @@ class CRM_Utils_versionCheckTest extends CiviUnitTestCase {
         array('version' => '4.2.1', 'date' => '2012-09-12'),
         array('version' => '4.2.2', 'date' => '2012-09-27'),
         array('version' => '4.2.4', 'date' => '2012-10-18'),
-        array('version' => '4.2.6', 'date' => '2012-11-01', 'security' => true),
-        array('version' => '4.2.7', 'date' => '2013-01-02', 'security' => true),
+        array('version' => '4.2.6', 'date' => '2012-11-01', 'security' => TRUE),
+        array('version' => '4.2.7', 'date' => '2013-01-02', 'security' => TRUE),
         array('version' => '4.2.8', 'date' => '2013-02-20'),
         array('version' => '4.2.9', 'date' => '2013-04-03'),
-        array('version' => '4.2.10', 'date' => '2013-07-29', 'security' => true),
+        array('version' => '4.2.10', 'date' => '2013-07-29', 'security' => TRUE),
         array('version' => '4.2.11', 'date' => '2013-09-25'),
-        array('version' => '4.2.12', 'date' => '2013-10-02', 'security' => true),
-        array('version' => '4.2.13', 'date' => '2013-11-06', 'security' => true),
+        array('version' => '4.2.12', 'date' => '2013-10-02', 'security' => TRUE),
+        array('version' => '4.2.13', 'date' => '2013-11-06', 'security' => TRUE),
         array('version' => '4.2.14', 'date' => '2013-11-20'),
-        array('version' => '4.2.15', 'date' => '2014-02-07', 'security' => true),
+        array('version' => '4.2.15', 'date' => '2014-02-07', 'security' => TRUE),
         array('version' => '4.2.16', 'date' => '2014-02-18'),
-        array('version' => '4.2.17', 'date' => '2014-07-01', 'security' => true),
+        array('version' => '4.2.17', 'date' => '2014-07-01', 'security' => TRUE),
         array('version' => '4.2.18', 'date' => '2014-08-06'),
-        array('version' => '4.2.19', 'date' => '2014-09-17', 'security' => true)
+        array('version' => '4.2.19', 'date' => '2014-09-17', 'security' => TRUE)
       ),
     ),
     '4.3' => array(
@@ -53,29 +53,29 @@ class CRM_Utils_versionCheckTest extends CiviUnitTestCase {
         array('version' => '4.3.1', 'date' => '2013-04-18'),
         array('version' => '4.3.2', 'date' => '2013-05-02'),
         array('version' => '4.3.3', 'date' => '2013-05-08'),
-        array('version' => '4.3.4', 'date' => '2013-06-10', 'security' => true),
-        array('version' => '4.3.5', 'date' => '2013-07-08', 'security' => true),
+        array('version' => '4.3.4', 'date' => '2013-06-10', 'security' => TRUE),
+        array('version' => '4.3.5', 'date' => '2013-07-08', 'security' => TRUE),
         array('version' => '4.3.6', 'date' => '2013-09-25'),
-        array('version' => '4.3.7', 'date' => '2013-10-02', 'security' => true),
-        array('version' => '4.3.8', 'date' => '2013-11-06', 'security' => true),
-        array('version' => '4.3.9', 'date' => '2014-09-07', 'security' => true)
+        array('version' => '4.3.7', 'date' => '2013-10-02', 'security' => TRUE),
+        array('version' => '4.3.8', 'date' => '2013-11-06', 'security' => TRUE),
+        array('version' => '4.3.9', 'date' => '2014-09-07', 'security' => TRUE)
       ),
     ),
     '4.4' => array(
       'status' => 'lts',
       'releases' => array(
         array('version' => '4.4.0', 'date' => '2013-10-23'),
-        array('version' => '4.4.1', 'date' => '2013-11-06', 'security' => true),
+        array('version' => '4.4.1', 'date' => '2013-11-06', 'security' => TRUE),
         array('version' => '4.4.2', 'date' => '2013-11-20'),
         array('version' => '4.4.3', 'date' => '2013-12-05'),
-        array('version' => '4.4.4', 'date' => '2014-02-07', 'security' => true),
+        array('version' => '4.4.4', 'date' => '2014-02-07', 'security' => TRUE),
         array('version' => '4.4.5', 'date' => '2014-04-17'),
-        array('version' => '4.4.6', 'date' => '2014-07-01', 'security' => true),
-        array('version' => '4.4.7', 'date' => '2014-09-17', 'security' => true),
+        array('version' => '4.4.6', 'date' => '2014-07-01', 'security' => TRUE),
+        array('version' => '4.4.7', 'date' => '2014-09-17', 'security' => TRUE),
         array('version' => '4.4.8', 'date' => '2014-10-14'),
         array('version' => '4.4.9', 'date' => '2014-11-05'),
         array('version' => '4.4.10', 'date' => '2014-11-19'),
-        array('version' => '4.4.11', 'date' => '2014-12-17', 'security' => true)
+        array('version' => '4.4.11', 'date' => '2014-12-17', 'security' => TRUE)
       ),
     ),
     '4.5' => array(
@@ -86,7 +86,7 @@ class CRM_Utils_versionCheckTest extends CiviUnitTestCase {
         array('version' => '4.5.2', 'date' => '2014-10-14'),
         array('version' => '4.5.3', 'date' => '2014-11-05'),
         array('version' => '4.5.4', 'date' => '2014-11-19'),
-        array('version' => '4.5.5', 'date' => '2014-12-17', 'security' => true),
+        array('version' => '4.5.5', 'date' => '2014-12-17', 'security' => TRUE),
       )
     ),
     '4.6' => array(
index 869ddef8d2f648809a50668682789acd7585805f..eb17fbeb37d481e05e454f0a89173a1f03b918ec 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all CRM test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class Civi_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 1a39267ada1552855a5a33fef17f82f500aff217..0c7575ec52b90cc485c455471e5513cbc4b25ebf 100644 (file)
@@ -143,7 +143,6 @@ class CiviDBAssert {
     $dbValues = array();
     CRM_Core_DAO::commonRetrieve($daoName, $searchParams, $dbValues);
 
-
     // compare db values with expected values
     self::assertAttributesEquals($testCase, $expectedValues, $dbValues);
   }
index a298e00de07c9b540fbc29b9c9653d1233024906..61f0f4602dbc65d27efd5206df6f84b75173c2ca 100644 (file)
@@ -181,6 +181,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase {
       case 'raw':
         // nothing to do
         break;
+
       case 'ezc':
         $msg = $this->convertToEzc($msg);
         break;
@@ -213,6 +214,7 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase {
       case 'raw':
         // nothing to do
         break;
+
       case 'ezc':
         foreach ($msgs as $i => $msg) {
           $msgs[$i] = $this->convertToEzc($msg);
index 17b85ed6915848d6704baf8824d88a96159a3678..e761cb2e9414f45c970a60d11f30ffbb87a72c5e 100644 (file)
@@ -134,7 +134,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
         $cookie['path'] = '/';
       }
       if (!isset($cookie['max_age'])) {
-        $cookie['max_age'] = 7*24*60*60;
+        $cookie['max_age'] = 7 * 24 * 60 * 60;
       }
       $this->deleteCookie($cookie['name'], $cookie['path']);
       $optionExprs = array();
@@ -247,7 +247,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
    * @param string $element
    * @param string $waitFor
    */
-  public function clickPopupLink($element, $waitFor=NULL) {
+  public function clickPopupLink($element, $waitFor = NULL) {
     $this->clickAjaxLink($element, 'css=.ui-dialog');
     if ($waitFor) {
       $this->waitForElementPresent($waitFor);
@@ -259,7 +259,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
    * @param string $element
    * @param string $waitFor
    */
-  public function clickAjaxLink($element, $waitFor=NULL) {
+  public function clickAjaxLink($element, $waitFor = NULL) {
     $this->click($element);
     if ($waitFor) {
       $this->waitForElementPresent($waitFor);
@@ -495,7 +495,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
   /**
    */
   public function webtestFillAutocomplete($sortName, $fieldName = 'contact_id') {
-    $this->select2($fieldName,$sortName);
+    $this->select2($fieldName, $sortName);
     //$this->assertContains($sortName, $this->getValue($fieldName), "autocomplete expected $sortName but didn’t find it in " . $this->getValue($fieldName));
   }
 
@@ -673,7 +673,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     $this->type('email-Primary', $params['email'] = "{$name}@example.com");
     $this->clickAjaxLink('_qf_Edit_next');
 
-    $this->waitForText("xpath=//div[@id='$selectId']","$name");
+    $this->waitForText("xpath=//div[@id='$selectId']", "$name");
 
     $params['sort_name'] = $contactType == 'Individual' ? $params['last_name'] . ', ' . $params['first_name'] : "$name $contactType";
     $params['display_name'] = $contactType == 'Individual' ? $params['first_name'] . ' ' . $params['last_name'] : $params['sort_name'];
@@ -713,10 +713,10 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
 
     // Is new contact created?
     if ($lname) {
-      $this->waitForText("xpath=//div[@id='$selectId']","$lname, $fname");
+      $this->waitForText("xpath=//div[@id='$selectId']", "$lname, $fname");
     }
     else {
-      $this->waitForText("xpath=//div[@id='$selectId']","$fname");
+      $this->waitForText("xpath=//div[@id='$selectId']", "$fname");
     }
   }
 
@@ -760,10 +760,10 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
   /**
    * Returns a single argument from the url query
    */
-   public function urlArg($arg, $url = NULL) {
-     $elements = $this->parseURL($url);
-     return isset($elements['queryString'][$arg]) ? $elements['queryString'][$arg] : NULL;
-   }
+  public function urlArg($arg, $url = NULL) {
+    $elements = $this->parseURL($url);
+    return isset($elements['queryString'][$arg]) ? $elements['queryString'][$arg] : NULL;
+  }
 
   /**
    * Define a payment processor for use by a webtest. Default is to create Dummy processor
@@ -841,7 +841,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     $this->openCiviPage('admin/paymentProcessor', 'action=add&reset=1&pp=' . $pid, 'name');
     $this->type('name', $processorName);
     $this->select('financial_account_id', "label={$financialAccount}");
-    foreach ($processorSettings AS $f => $v) {
+    foreach ($processorSettings as $f => $v) {
       $this->type($f, $v);
     }
 
@@ -1461,7 +1461,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
         break;
     }
 
-    $this->select2('member_of_contact_id',$membershipTitle);
+    $this->select2('member_of_contact_id', $membershipTitle);
 
     $this->type('minimum_fee', '100');
     $this->select('financial_type_id', "value={$memTypeParams['financial_type']}");
@@ -2096,14 +2096,14 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
    *
    * @param array $customSets
    *   Custom sets i.e entity wise sets want to be created and checked.
-                                     e.g    $customSets = array(array('entity' => 'Contribution', 'subEntity' => 'Donation',
-                                     'triggerElement' => $triggerElement))
-                                      array  $triggerElement:   the element which is responsible for custom group to load
+  e.g    $customSets = array(array('entity' => 'Contribution', 'subEntity' => 'Donation',
+  'triggerElement' => $triggerElement))
+  array  $triggerElement:   the element which is responsible for custom group to load
 
-                                     which uses the entity info as its selection value
+  which uses the entity info as its selection value
    * @param array $pageUrl
    *   The url which on which the ajax custom group load takes place.
-   * @param callable|boolean $beforeTriggering fn to execute before actual element triggering
+   * @param bool $beforeTriggering
    * @return void
    */
   public function customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, $beforeTriggering = NULL) {
@@ -2222,7 +2222,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
   /**
    * Type and select first occurance of autocomplete
    */
-  public function select2($fieldName,$label, $multiple = FALSE, $xpath=FALSE) {
+  public function select2($fieldName, $label, $multiple = FALSE, $xpath = FALSE) {
     // In the case of chainSelect, wait for options to load
     $this->waitForElementNotPresent('css=select.loading');
     if ($multiple) {
@@ -2270,7 +2270,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
   /**
    * Check for unobtrusive status message as set by CRM.status
    */
-  public function checkCRMStatus($text=NULL) {
+  public function checkCRMStatus($text = NULL) {
     $this->waitForElementPresent("css=.crm-status-box-outer.status-success");
     if ($text) {
       $this->assertElementContainsText("css=.crm-status-box-outer.status-success", $text);
@@ -2280,7 +2280,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
   /**
    * Check for obtrusive status message as set by CRM.alert
    */
-  public function checkCRMAlert($text, $type='success') {
+  public function checkCRMAlert($text, $type = 'success') {
     $this->waitForElementPresent("css=div.ui-notify-message.$type");
     $this->waitForText("css=div.ui-notify-message.$type", $text);
     // We got the message, now let's close it so the webtest doesn't get confused by lots of open alerts
@@ -2294,7 +2294,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     $this->openCiviPage('admin/setting/preferences/display', 'reset=1');
     $isChecked = $this->isChecked('ajaxPopupsEnabled');
     if (($isChecked && !$enabled) || (!$isChecked && $enabled)) {
-        $this->click('ajaxPopupsEnabled');
+      $this->click('ajaxPopupsEnabled');
     }
     if ($enabled) {
       $this->assertChecked('ajaxPopupsEnabled');
index 21faf545604ddfc192db8bdf0942baf7ef970c22..e1f06d8477a640f5e951992a50b3a2c8e2124b99 100755 (executable)
@@ -414,7 +414,6 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
     //flush component settings
     CRM_Core_Component::getEnabledComponents(TRUE);
 
-
     if ($this->_eNoticeCompliant) {
       error_reporting(E_ALL);
     }
@@ -692,7 +691,8 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
    * array(1 => array("Whiz", "String")));
    */
   public function assertDBQuery($expected, $query, $params = array(), $message = '') {
-    if ($message) $message .= ': ';
+    if ($message) { $message .= ': ';
+    }
     $actual = CRM_Core_DAO::singleValueQuery($query, $params);
     $this->assertEquals($expected, $actual,
       sprintf('%sexpected=[%s] actual=[%s] query=[%s]',
@@ -896,12 +896,14 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
       $params
     );
     switch (strtolower($action)) {
-      case 'getvalue' :
+      case 'getvalue':
         return $this->callAPISuccessGetValue($entity, $params, $checkAgainst);
-      case 'getsingle' :
+
+      case 'getsingle':
         return $this->callAPISuccessGetSingle($entity, $params, $checkAgainst);
-      case 'getcount' :
-          return $this->callAPISuccessGetCount($entity, $params, $checkAgainst);
+
+      case 'getcount':
+        return $this->callAPISuccessGetCount($entity, $params, $checkAgainst);
     }
     $result = $this->civicrm_api($entity, $action, $params);
     $this->assertAPISuccess($result, "Failure in api call for $entity $action");
@@ -1054,7 +1056,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
    * so the distinction between set
    * up & tested functions is clearer
    *
-   *  @return array api Result
+   * @return array api Result
    */
   public function createTestEntity(){
     return $entity = $this->callAPISuccess($this->entity, 'create', $this->params);
@@ -1130,11 +1132,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
       $params[$key] = $values[$seq % sizeof($values)];
     }
     if ($contact_type == 'Individual' ) {
-        $params['email'] = strtolower(
+      $params['email'] = strtolower(
           $params['first_name'] . '_' . $params['last_name'] . '@civicrm.org'
         );
-        $params['prefix_id'] = 3;
-        $params['suffix_id'] = 3;
+      $params['prefix_id'] = 3;
+      $params['suffix_id'] = 3;
     }
     return $params;
   }
@@ -1176,7 +1178,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
       return;
     }
     $result = $this->callAPISuccess('contact', 'delete', $params);
-    return  $result;
+    return $result;
   }
 
   /**
@@ -1434,7 +1436,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
       'domain_id' => '1',
     );
     $params = array_merge($defaults, $params);
-    $result =  $this->callAPISuccess('Tag', 'create', $params);
+    $result = $this->callAPISuccess('Tag', 'create', $params);
     return $result['values'][$result['id']];
   }
 
@@ -1788,7 +1790,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
   }
 
 
- /**
 /**
    * Function to add a Group
    *
    * @params array to add group
@@ -1798,7 +1800,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
    */
   public function groupContactCreate($groupID, $totalCount = 10) {
     $params = array('group_id' => $groupID);
-    for ($i=1; $i <= $totalCount; $i++) {
+    for ($i = 1; $i <= $totalCount; $i++) {
       $contactID = $this->individualCreate();
       if ($i == 1) {
         $params += array('contact_id' => $contactID);
@@ -1997,7 +1999,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
     $params = array_merge($defaults, $params);
 
     if (strlen($params['title']) > 13) {
-      $params['title'] =  substr($params['title'], 0, 13);
+      $params['title'] = substr($params['title'], 0, 13);
     }
 
     //have a crack @ deleting it first in the hope this will prevent derailing our tests
@@ -2070,7 +2072,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
   public function entityCustomGroupWithSingleFieldCreate($function, $filename) {
     $params = array('title' => $function);
     $entity = substr(basename($filename), 0, strlen(basename($filename)) - 8);
-    $params['extends'] =  $entity ? $entity : 'Contact';
+    $params['extends'] = $entity ? $entity : 'Contact';
     $customGroup = $this->CustomGroupCreate($params);
     $customField = $this->customFieldCreate(array('custom_group_id' => $customGroup['id'], 'label' => $function));
     CRM_Core_PseudoConstant::flush();
@@ -2312,7 +2314,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
       'decision_date' => '20130805000000',
     );
 
-    $keysToUnset = array('xdebug', 'undefined_fields',);
+    $keysToUnset = array('xdebug', 'undefined_fields');
     foreach ($keysToUnset as $unwantedKey) {
       if(isset($result[$unwantedKey])) {
         unset($result[$unwantedKey]);
@@ -2332,33 +2334,33 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
     }
 
     foreach ($resultArray as $index => &$values) {
-        if(!is_array($values)) {
-          continue;
-        }
-        foreach($values as $key => &$value) {
-          if(substr($key, 0, 3)  == 'api' && is_array($value)) {
-            if(isset($value['is_error'])) {
-              // we have a std nested result format
-              $this->tidyExampleResult($value);
-            }
-            else{
-              foreach ($value as &$nestedResult) {
-                // this is an alternative syntax for nested results a keyed array of results
-                $this->tidyExampleResult($nestedResult);
-              }
-            }
-          }
-          if(in_array($key, $keysToUnset)) {
-            unset($values[$key]);
-            break;
-          }
-          if(array_key_exists($key, $fieldsToChange) && !empty($value)) {
-            $value = $fieldsToChange[$key];
+      if(!is_array($values)) {
+        continue;
+      }
+      foreach($values as $key => &$value) {
+        if(substr($key, 0, 3) == 'api' && is_array($value)) {
+          if(isset($value['is_error'])) {
+            // we have a std nested result format
+            $this->tidyExampleResult($value);
           }
-          if(is_string($value)) {
-            $value =  addslashes($value);
+          else{
+            foreach ($value as &$nestedResult) {
+              // this is an alternative syntax for nested results a keyed array of results
+              $this->tidyExampleResult($nestedResult);
+            }
           }
         }
+        if(in_array($key, $keysToUnset)) {
+          unset($values[$key]);
+          break;
+        }
+        if(array_key_exists($key, $fieldsToChange) && !empty($value)) {
+          $value = $fieldsToChange[$key];
+        }
+        if(is_string($value)) {
+          $value = addslashes($value);
+        }
+      }
     }
   }
 
@@ -2619,7 +2621,7 @@ AND    ( TABLE_NAME LIKE 'civicrm_value_%' )
     }
     if (!empty($unformattedArray['values']) && is_array($unformattedArray['values'])) {
       foreach ($unformattedArray['values'] as $key => $value) {
-        if (is_Array($value)) {
+        if (is_array($value)) {
           foreach ($value as $k => $v) {
             if ($k == 'id') {
               unset($value[$k]);
@@ -2719,7 +2721,7 @@ AND    ( TABLE_NAME LIKE 'civicrm_value_%' )
    */
   public function setMockSettingsMetaData($extras) {
     CRM_Core_BAO_Setting::$_cache = array();
-    $this->callAPISuccess('system','flush', array());
+    $this->callAPISuccess('system', 'flush', array());
     CRM_Core_BAO_Setting::$_cache = array();
 
     CRM_Utils_Hook::singleton()->setHook('civicrm_alterSettingsMetaData', function (&$metadata, $domainId, $profile) use ($extras) {
@@ -2935,12 +2937,12 @@ AND    ( TABLE_NAME LIKE 'civicrm_value_%' )
 
     CRM_Core_Config::singleton()->userPermissionClass->permissions = array('access CiviCRM');
     $optionGroupID = $this->callAPISuccessGetValue('option_group', array('return' => 'id', 'name' => 'acl_role'));
-    $optionValue = $this->callAPISuccess('option_value', 'create', array('option_group_id' => $optionGroupID,
+    $optionValue = $this->callAPISuccess('option_value', 'create', array(
+    'option_group_id' => $optionGroupID,
       'label' => 'pick me',
       'value' => 55,
     ));
 
-
     CRM_Core_DAO::executeQuery("
       TRUNCATE civicrm_acl_cache
     ");
@@ -2949,7 +2951,6 @@ AND    ( TABLE_NAME LIKE 'civicrm_value_%' )
       TRUNCATE civicrm_acl_contact_cache
     ");
 
-
     CRM_Core_DAO::executeQuery("
     INSERT INTO civicrm_acl_entity_role (
     `acl_role_id`, `entity_table`, `entity_id`
index bcd956e1769772d9336b6ae62b0abf930ce7d70c..73a70de32c11cf9ca2efe9d66bef904fbfcde32d 100644 (file)
@@ -64,7 +64,7 @@ class Custom extends CiviUnitTestCase {
    * @param array $params
    * @param null $fields
    * @return object of created field
-*/
+   */
   public static function createField($params, $fields = NULL) {
     if (empty($params)) {
       $params = array(
index f062d997626038b222c03bdec05f4ccb248d24bd..e29721d0bfa339e5307726a57433e91ff9e99a8a 100644 (file)
@@ -28,7 +28,6 @@ class Event extends PHPUnit_Framework_Testcase {
       'contact_id' => $contactId,
     );
 
-
     $event = CRM_Event_BAO_Event::create($params);
     return $event->id;
   }
index acc353cc6b2d99d6ec07069798ea56cb2d8b40b9..5abd17485d041b4e4724666f39ecd84647abe273 100644 (file)
@@ -102,7 +102,6 @@ class PCPBlock extends PHPUnit_Framework_Testcase {
     $delete_params = array('id' => $params['profileId']);
     $resulProfile = civicrm_api('uf_group', 'delete', $delete_params);
 
-
     require_once 'CRM/Contribute/DAO/PCPBlock.php';
     $dao = new CRM_Contribute_DAO_PCPBlock();
     $dao->id = $params['blockId'];
index 8073d3139170cd9e0f17f0a181416efeea6968e7..31920cc104ba5fb930178602ba25dd46bf8a5000 100644 (file)
@@ -14,10 +14,10 @@ ini_set('include_path',
 #  Relying on system timezone setting produces a warning,
 #  doing the following prevents the warning message
 if ( file_exists( '/etc/timezone' ) ) {
-    $timezone = trim( file_get_contents( '/etc/timezone' ) );
-    if ( ini_set('date.timezone', $timezone ) === false ) {
-        echo "ini_set( 'date.timezone', '$timezone' ) failed\n";
-    }
+  $timezone = trim( file_get_contents( '/etc/timezone' ) );
+  if ( ini_set('date.timezone', $timezone ) === FALSE ) {
+    echo "ini_set( 'date.timezone', '$timezone' ) failed\n";
+  }
 }
 
 # Crank up the memory
index 79aa179f16cd0309caac2435d000717d2c0511e6..0db1e5d69f3942888281d3e7308bcce0e4b1100b 100644 (file)
@@ -13,14 +13,14 @@ if ( ! defined( 'CIVICRM_DSN' ) && ! empty( $GLOBALS['mysql_user'] ) ) {
   if ( empty( $GLOBALS['mysql_pass'] ) && $GLOBALS['mysql_pass_need_password'] ) {
     $GLOBALS['mysql_pass'] = PHPUnit_TextUI_Command::getPassword( 'Password' );
   }
-  define( 'CIVICRM_DSN'          , "mysql://{$GLOBALS['mysql_user']}:{$GLOBALS['mysql_pass']}@{$GLOBALS['mysql_host']}/{$dbName}?new_link=true" );
+  define( 'CIVICRM_DSN', "mysql://{$GLOBALS['mysql_user']}:{$GLOBALS['mysql_pass']}@{$GLOBALS['mysql_host']}/{$dbName}?new_link=true" );
 }
 
 
 if (!defined("CIVICRM_DSN")) {
-  $dsn= getenv("CIVICRM_TEST_DSN");
+  $dsn = getenv("CIVICRM_TEST_DSN");
   if (!empty ($dsn)) {
-    define("CIVICRM_DSN",$dsn);
+    define("CIVICRM_DSN", $dsn);
   } else {
     echo "\nFATAL: no DB connection configured (CIVICRM_DSN). \nYou can either create/edit " . __DIR__ . "/civicrm.settings.local.php\n";
     if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
@@ -29,7 +29,7 @@ if (!defined("CIVICRM_DSN")) {
       echo "OR set it in your shell:\n SETX CIVICRM_TEST_DSN mysql://db_username:db_password@localhost/civicrm_tests_dev \n
       (you will need to open a new command shell before it takes effect)";
     }
-echo "\n\n
+    echo "\n\n
 If you haven't done so already, you need to create (once) a database dedicated to the unit tests:
 mysql -uroot -p
 create database civicrm_tests_dev;
@@ -59,7 +59,7 @@ define('CIVICRM_UF', 'UnitTests');
 
 global $civicrm_root;
 if (empty($civicrm_root)) {
-  $civicrm_root = dirname (dirname (dirname (dirname( __FILE__ ) )));
+  $civicrm_root = dirname(dirname(dirname(dirname( __FILE__ ) )));
 }
 #$civicrm_root = '/var/www/drupal7.dev.civicrm.org/public/sites/devel.drupal7.tests.dev.civicrm.org/modules/civicrm';
 
@@ -68,7 +68,7 @@ if (empty($civicrm_root)) {
 
 if (!defined("CIVICRM_TEMPLATE_COMPILEDIR")) {
   if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
-    define( 'CIVICRM_TEMPLATE_COMPILEDIR', getenv ('TMP') . DIRECTORY_SEPARATOR . 'civi' . DIRECTORY_SEPARATOR );
+    define( 'CIVICRM_TEMPLATE_COMPILEDIR', getenv('TMP') . DIRECTORY_SEPARATOR . 'civi' . DIRECTORY_SEPARATOR );
   } else {
     define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/tmp/civi/' );
   }
@@ -102,7 +102,7 @@ define( 'CIVICRM_SITE_KEY', 'phpunittestfakekey' );
  *
  */
 if (!defined('CIVICRM_UF_BASEURL')) {
-  define( 'CIVICRM_UF_BASEURL'      , 'http://FIX ME' );
+  define( 'CIVICRM_UF_BASEURL', 'http://FIX ME' );
 }
 
 /**
@@ -126,9 +126,9 @@ $include_path = '.'        . PATH_SEPARATOR .
 set_include_path( $include_path );
 
 if ( function_exists( 'variable_get' ) && variable_get('clean_url', '0') != '0' ) {
-    define( 'CIVICRM_CLEANURL', 1 );
+  define( 'CIVICRM_CLEANURL', 1 );
 } else {
-    define( 'CIVICRM_CLEANURL', 0 );
+  define( 'CIVICRM_CLEANURL', 0 );
 }
 
 // force PHP to auto-detect Mac line endings
@@ -139,12 +139,12 @@ $memLimitString = trim(ini_get('memory_limit'));
 $memLimitUnit   = strtolower(substr($memLimitString, -1));
 $memLimit       = (int) $memLimitString;
 switch ($memLimitUnit) {
-    case 'g': $memLimit *= 1024;
-    case 'm': $memLimit *= 1024;
-    case 'k': $memLimit *= 1024;
+  case 'g': $memLimit *= 1024;
+  case 'm': $memLimit *= 1024;
+  case 'k': $memLimit *= 1024;
 }
 if ($memLimit >= 0 and $memLimit < 67108864) {
-    ini_set('memory_limit', '64M');
+  ini_set('memory_limit', '64M');
 }
 
 require_once 'CRM/Core/ClassLoader.php';
index 9093b3c960cd44e6ca862687863e2862a04f443f..57eaec47b0c30b7ff93e0e3fff093f4c8472a31a 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: Utils.php 40328 2012-05-11 23:06:13Z allen $
- *   @package   CiviCRM
+ * @version   $Id: Utils.php 40328 2012-05-11 23:06:13Z allen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
 
 /**
  *  Utility functions
- *   @package   CiviCRM
+ * @package   CiviCRM
  */
 class Utils {
 
   /**
    *  PDO for the database
-   *  @var PDO
+   * @var PDO
    */
   public $pdo;
 
@@ -62,8 +62,8 @@ class Utils {
    *  Prepare and execute a query
    *
    *  If the query fails, output a diagnostic message
-   *  @param  string  Query to run
-   *  @return mixed   PDOStatement => Results of the query
+   * @param  string  Query to run
+   * @return mixed   PDOStatement => Results of the query
    *                  false        => Query failed
    */
   public function do_query($query) {
index f3b57fb49369a2d37569895b311ee0ec9aa09f33..a0d9d5fffd5879d0f19d2363b2fe2d1be9ea9a92 100644 (file)
@@ -62,10 +62,9 @@ class WebTest_Activity_AddRecurringActivityTest extends CiviSeleniumTestCase {
 
     // ...need to use mouseDownAt on first result (which is a li element), click does not work
     $this->clickAt("xpath=//div[@class='select2-result-label']");
-    $this->waitForText("xpath=//div[@id='s2id_target_contact_id']","$contact1");
+    $this->waitForText("xpath=//div[@id='s2id_target_contact_id']", "$contact1");
     $this->assertElementContainsText("xpath=//div[@id='s2id_target_contact_id']", "Karan, $contact1", 'Contact not found in line ' . __LINE__);
 
-
     //Assigned To field
     $this->click("xpath=//div[@id='s2id_assignee_contact_id']/ul/li/input");
     $this->keyDown("xpath=//div[@id='s2id_assignee_contact_id']/ul/li/input", " ");
@@ -79,7 +78,7 @@ class WebTest_Activity_AddRecurringActivityTest extends CiviSeleniumTestCase {
     $this->clickAt("xpath=//div[@class='select2-result-label']");
 
     // ...again, waiting for the box with contact name to show up...
-    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']","$contact2");
+    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']", "$contact2");
 
     // ...and verifying if the page contains properly formatted display name for chosen contact.
     $this->assertElementContainsText("xpath=//div[@id='s2id_assignee_contact_id']", "Jane, $contact2", 'Contact not found in line ' . __LINE__);
index 322987985392d93191ed007e3ae47da53e879ea1..3d448bbe4fb71cd8b27fab7cfa3d95f827ff18f5 100644 (file)
@@ -73,7 +73,7 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase {
     $this->clickAt("xpath=//div[@class='select2-result-label']");
 
     // ...again, waiting for the box with contact name to show up...
-    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']","$firstName1");
+    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']", "$firstName1");
 
     // ...and verifying if the page contains properly formatted display name for chosen contact.
     $this->assertElementContainsText("xpath=//div[@id='s2id_assignee_contact_id']", "Summerson, $firstName1", 'Contact not found in line ' . __LINE__);
@@ -181,7 +181,6 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase {
     // ...need to use mouseDownAt on first result (which is a li element), click does not work
     $this->clickAt("xpath=//div[@class='select2-result-label']");
 
-
     // ...and verifying if the page contains properly formatted display name for chosen contact.
     $this->waitForText("xpath=//div[@id='s2id_target_contact_id']", "$firstName1", 'Contact not found in line ' . __LINE__);
 
@@ -197,7 +196,6 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase {
     // ...need to use mouseDownAt on first result (which is a li element), click does not work
     $this->clickAt("xpath=//div[@class='select2-result-label']");
 
-
     // ...and verifying if the page contains properly formatted display name for chosen contact.
     $this->waitForText("xpath=//div[@id='s2id_target_contact_id']", "$firstName2", 'Contact not found in line ' . __LINE__);
 
index 821cc9f33b6908e6556f6dd6078c445eb471d5d4..688f715268b545d9ce93e07f3e19dd4011bed880 100644 (file)
@@ -73,7 +73,7 @@ class WebTest_Activity_IcalTest extends CiviSeleniumTestCase {
 
     $this->waitForElementPresent("xpath=//div[@class='select2-result-label']");
     $this->clickAt("xpath=//div[@class='select2-result-label']");
-    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']","$firstName1");
+    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']", "$firstName1");
 
     $subject = "Testing Ical attachment for activity assignee";
     $this->type("subject", $subject);
index 3826f3ae679ea73c4051f1ba4b3a903d53d8b310..0e4e4c43d0d1144394bdfb4d32e7141df01fa538 100644 (file)
@@ -65,7 +65,7 @@ class WebTest_Activity_StandaloneAddTest extends CiviSeleniumTestCase {
     $this->clickAt("xpath=//div[@class='select2-result-label']");
 
     // ...again, waiting for the box with contact name to show up (span with delete token class indicates that it's present)...
-    $this->waitForText("xpath=//div[@id='s2id_target_contact_id']","$firstName1");
+    $this->waitForText("xpath=//div[@id='s2id_target_contact_id']", "$firstName1");
 
     //..and verifying if the page contains properly formatted display name for chosen contact.
     $this->assertElementContainsText("xpath=//div[@id='s2id_target_contact_id']", "Anderson, $firstName1", 'Contact not found in line ' . __LINE__);
@@ -84,7 +84,7 @@ class WebTest_Activity_StandaloneAddTest extends CiviSeleniumTestCase {
     $this->clickAt("xpath=//div[@class='select2-result-label']");
 
     // ...again, waiting for the box with contact name to show up...
-    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']","$firstName2");
+    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']", "$firstName2");
 
     // ...and verifying if the page contains properly formatted display name for chosen contact.
     $this->assertElementContainsText("xpath=//div[@id='s2id_assignee_contact_id']", "Summerson, $firstName2", 'Contact not found in line ' . __LINE__);
@@ -182,8 +182,8 @@ class WebTest_Activity_StandaloneAddTest extends CiviSeleniumTestCase {
    */
   public function VerifyTabularData($expected, $xpathPrefix = NULL) {
     foreach ($expected as $label => $value) {
-        $this->waitForElementPresent("xpath=//table/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td/span");
-        $this->verifyText("xpath=//table/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td/span", preg_quote($value), 'In line ' . __LINE__);
+      $this->waitForElementPresent("xpath=//table/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td/span");
+      $this->verifyText("xpath=//table/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td/span", preg_quote($value), 'In line ' . __LINE__);
     }
   }
 }
index 061910d57f0aa3d29d537b149ac6b3e5f1dd90a5..df683f0ee6412d0f4c744390cac9d695cb8af9df 100644 (file)
@@ -100,7 +100,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase {
     }
 
     //Go to the contacts page and check that the custom field is in the right group
-    $this->openCiviPage('contact/view',"reset=1&cid={$cid_all}");
+    $this->openCiviPage('contact/view', "reset=1&cid={$cid_all}");
 
     //load the names of the custom fieldsets
     $source      = $this->webtest_civicrm_api("CustomGroup", "get", array('id' => $from_group_id));
@@ -373,6 +373,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase {
         $this->select("date_format", "value=yy-mm-dd");
         $this->click("//option[@value='yy-mm-dd']");
         break;
+
       //TODO allow for more things....
     }
 
@@ -397,8 +398,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase {
    * @param string $prefix
    * @param array $values
    */
-  function _createFieldOptions($count = 3, $prefix = "option", $values = array(
-    )) {
+  function _createFieldOptions($count = 3, $prefix = "option", $values = array()) {
     // Only support up to 10 options on the creation form
     $count = $count > 10 ? 10 : $count;
 
index d772ec0541453f6ae273b3bb107e52b87fad6ed9..f6bb7f4c7c867dcdced56e42d49bf0ad716b7253 100644 (file)
@@ -33,7 +33,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all CRM test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class WebTest_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index 5231316748a94832368b7e3b0101e133b104a196..6129025224f1f88c9ee337fbb6d539059cf95107 100644 (file)
@@ -190,7 +190,7 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase {
     $this->type("followup_activity_subject", "This is subject of schedule follow-up activity");
 
     // Clicking save.
-    $this->clickLink("_qf_Activity_upload",'link=View',FALSE);
+    $this->clickLink("_qf_Activity_upload", 'link=View', FALSE);
 
     // Is status message correct?
     $this->waitForText('crm-notification-container', $subject);
index 8d0ebbfb2cd6f8121003723f8cfb001076c9a2f0..a77a7bc5a35f1dea4f731819975b704a656e70a1 100644 (file)
@@ -227,7 +227,7 @@ class WebTest_Campaign_MailingTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // verify undelivered status message
-    $this->assertElementContainsText('crm-container',"Delivery has not yet begun for this mailing. If the scheduled delivery date and time is past, ask the system administrator or technical support contact for your site to verify that the automated mailer task ('cron job') is running - and how frequently.");
+    $this->assertElementContainsText('crm-container', "Delivery has not yet begun for this mailing. If the scheduled delivery date and time is past, ask the system administrator or technical support contact for your site to verify that the automated mailer task ('cron job') is running - and how frequently.");
 
     // do check for recipient group
     $this->assertElementContainsText('crm-container', "Members of $groupName");
index a51326fa2cef6d927af60718725fe31213a9d9b3..dd67c00a69280e168b909de7f7ed0539c390c72d 100644 (file)
@@ -185,7 +185,6 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase {
     $this->type("invoice_id", time());
     $this->webtestFillDate('thankyou_date');
 
-
     //Premium section
     $this->click("Premium");
     $this->waitForElementPresent("fulfilled_date");
index e447b25be9f5994217e05bb1f3dad7143792f401..852e36a79dad98f85ef16388a42fdd301e722852 100644 (file)
@@ -218,7 +218,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase
     $this->waitForElementPresent("_qf_Fee_upload-bottom");
     $this->click("CIVICRM_QFID_1_is_monetary");
     $this->check("payment_processor[$processorId]");
-       $this->select("financial_type_id", "value=4");
+    $this->select("financial_type_id", "value=4");
     if ($priceSet) {
       // get one - TBD
     }
index 3fa42bb6f03f6786c2fa5603fbd4c7a2663d4ba4..fc6ec3850916923f3180eba893dea2b8c0553112 100644 (file)
@@ -234,12 +234,12 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("_qf_Interview_cancel_interview");
 
     $this->click("CIVICRM_QFID_1_2");
-    $this->select("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[1]/td[8]/select","value=Label $title 1");
+    $this->select("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[1]/td[8]/select", "value=Label $title 1");
     $this->click("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[1]/td[9]/a");
 
     $this->click("CIVICRM_QFID_2_8");
 
-    $this->select("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[2]/td[8]/select","value=Label $title 2");
+    $this->select("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[2]/td[8]/select", "value=Label $title 2");
     $this->click("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[2]/td[9]/a");
     $this->click("_qf_Interview_cancel_interview");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -298,7 +298,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
 
     $this->waitForElementPresent('_qf_Search_refresh');
     $this->clickLink("_qf_Search_refresh");
-    $this->waitForText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[1]",'1 Result');
+    $this->waitForText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[1]", '1 Result');
   }
 
   public function testSurveyReportTest() {
index a7c71e254cd9bf4d1fa071744ea240c3db4c9f8e..fd07cfc3d77883b5d5b0c2b2534ae101e9cf4133 100644 (file)
@@ -232,7 +232,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase {
     $this->clickAt("xpath=//div[@class='select2-result-label']");
 
     // ...again, waiting for the box with contact name to show up...
-    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']","$firstName1");
+    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']", "$firstName1");
 
     // ...and verifying if the page contains properly formatted display name for chosen contact.
     $this->assertElementContainsText("xpath=//div[@id='s2id_assignee_contact_id']", "Summerson, $firstName1", 'Contact not found in line ' . __LINE__);
index b0d71e8a709a09744ce6933d936212fb68d99247..a335d94fbbb8b0957babad5b199c23fb1f38b86a 100644 (file)
@@ -129,7 +129,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase {
     //change the case status to Resolved to get the end date
     $this->click("xpath=//form[@id='CaseView']/div[2]/table/tbody/tr/td[4]/a");
     $this->waitForElementPresent("_qf_Activity_cancel-bottom");
-    $this->select("case_status_id","value=2");
+    $this->select("case_status_id", "value=2");
     $this->click("_qf_Activity_upload-top");
 
     $this->_testSearchbyDate($client['first_name'], $client['last_name'], "this.quarter");
@@ -277,7 +277,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase {
    *
    * test for assign case to another client
    */
-   public function _testAssignToClient($firstName, $lastName, $caseTypeLabel) {
+  public function _testAssignToClient($firstName, $lastName, $caseTypeLabel) {
     $this->openCiviPage('case/search', 'reset=1', '_qf_Search_refresh-bottom');
     $this->type('sort_name', $firstName);
     $this->clickLink('_qf_Search_refresh-bottom');
index 78bb0fc7771d165db15de65140a6faaa500533c9..49083679eb97eae8461c0d0a9837711618479d07 100644 (file)
@@ -37,8 +37,8 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase {
 
   public function testAddEditCaseType() {
     $caseRoles = array(1 => 'Parent of', 2 => 'Spouse of', 3 => 'Partner of');
-    $activityTypes = array(1 => 'Meeting',2 => 'Contribution',3 => 'Event Registration');
-    $timelineActivityTypes = array(1 => 'Meeting',2 => 'Phone Call',3 => 'Email');
+    $activityTypes = array(1 => 'Meeting', 2 => 'Contribution', 3 => 'Event Registration');
+    $timelineActivityTypes = array(1 => 'Meeting', 2 => 'Phone Call', 3 => 'Email');
     // Log in as admin first to verify permissions for CiviCase
     $this->webtestLogin('admin');
 
index a99bd5e377c7b228a01682a3b865d8ff0f9a1085..f47dec00e16fb3df3fcd3d0b71209e02671e0a3b 100644 (file)
@@ -177,7 +177,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase {
    *
    * @return array
    */
-  public function _testGetCustomFieldId($customGrpId1, $noteRichEditor=FALSE) {
+  public function _testGetCustomFieldId($customGrpId1, $noteRichEditor = FALSE) {
     $customId = array();
     $this->openCiviPage('admin/custom/group/field/add', array('reset' => 1, 'action' => 'add', 'gid' => $customGrpId1));
 
index 18fe0f54ad1aee0b8fdd5606fe51f7ef928b2915..77225702bd51a0a0046b478058704ba1fc1bec41 100644 (file)
@@ -48,7 +48,6 @@ class WebTest_Contact_AddContactsToEventAdvancedSearchTest extends CiviSeleniumT
 
     $this->select('task', "label=Add Contacts to Event");
 
-
     // Select event. Based on label for now.
     $this->waitForElementPresent('event_id');
     $this->select2('event_id', "Rain-forest Cup Youth Soccer Tournament");
index e4d37dbec4e527e312345c75b1e67233d680fc29..17daa2834e7367dc5f3339ad9096b4294af268b2 100644 (file)
@@ -409,7 +409,6 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase {
     //create new current employer
     $currentEmployer = substr(sha1(rand()), 0, 7) . "Web Access";
 
-
     //fill in email
     $this->type("email_1_email", substr(sha1(rand()), 0, 7) . "john@gmail.com");
 
index d07e969c510ff0ce97a2669bbd41edd3b93b255c..40b7094ae407827473af2f397e064650f5b522ed 100644 (file)
@@ -89,8 +89,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase {
   /**
    * @param array $openedPanes
    */
-  function _checkOpenedPanes($openedPanes = array(
-    )) {
+  function _checkOpenedPanes($openedPanes = array()) {
     if (!$this->isTextPresent('None found.')) {
       $this->click('css=div.crm-advanced_search_form-accordion div.crm-accordion-header');
     }
@@ -112,8 +111,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase {
    * @param $paneRef
    * @param array $selectFields
    */
-  function _selectPaneFields($paneRef, $selectFields = array(
-    )) {
+  function _selectPaneFields($paneRef, $selectFields = array()) {
     $pane = $this->_advanceSearchPanes($paneRef);
 
     $this->click("css=div.crm-accordion-wrapper {$pane['headerLocator']}");
index aa1eccedf1b3cfa63d03a2bb118ee134da15f9cc..65c297baedadbf409fe754a4e7592034e597073c 100644 (file)
@@ -187,7 +187,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
       $cal = $count / $perPageRow;
       $mod = $count % $perPageRow;
       $j = 1;
-      for ($i=1; $i<=$cal; $i++) {
+      for ($i = 1; $i <= $cal; $i++) {
         $subTotal = $i * $perPageRow;
         $lastPageSub = $subTotal + 1;
 
@@ -236,7 +236,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
     $this->select2("group", "Summer", TRUE);
     $this->select2("group", "Advisory", TRUE);
     $this->clickAjaxLink("location", 'country');
-    $this->select2("country", "United States", False);
+    $this->select2("country", "United States", FALSE);
     $this->waitForElementPresent('state_province');
     $this->multiselect2("state_province", array("Ohio", "New York", "New Mexico", "Connecticut", "Georgia", "New Jersey", "Texas"));
     $this->clickLink("_qf_Advanced_refresh", "xpath=//div[@class='crm-search-results']//table/tbody/tr[1]/td[6]");
@@ -307,7 +307,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
       $this->click("xpath=//div[@id='activity']/table/tbody/tr[2]/td[1]/div[1]//div/label[text()=\"$labels\"]");
     }
     // fill date range
-    $this->select("activity_date_relative","value=0");
+    $this->select("activity_date_relative", "value=0");
     $this->webtestFillDate("activity_date_low", "-1 day");
     $this->webtestFillDate("activity_date_high", "+1 day");
     $this->type("activity_subject", "Student - membership source$firstName - Status: New");
@@ -320,12 +320,12 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
   // function to fill demographic search details
   public function addDemographicSearchDetail() {
     // fill birth date range
-    $this->select("birth_date_relative","value=0");
+    $this->select("birth_date_relative", "value=0");
     $this->webtestFillDate("birth_date_low", "-3 year");
     $this->webtestFillDate("birth_date_high", "now");
     // fill deceased date range
     $this->click("xpath=//div[@id='demographics']/table/tbody//tr/td/label[text()='Deceased']/../label[text()='Yes']");
-    $this->select("deceased_date_relative","value=0");
+    $this->select("deceased_date_relative", "value=0");
     $this->webtestFillDate("deceased_date_low", "-1 month");
     $this->webtestFillDate("deceased_date_high", "+1 month");
     // fill gender (male)
@@ -338,7 +338,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
    */
   public function addContributionSearchDetail($firstName) {
     // fill contribution date range
-    $this->select("contribution_date_relative","value=0");
+    $this->select("contribution_date_relative", "value=0");
     $this->webtestFillDate("contribution_date_low", "-1 day");
     $this->webtestFillDate("contribution_date_high", "+1 day");
     // fill amount range
@@ -351,8 +351,8 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
     $this->type("contribution_check_number", "chqNo$firstName");
     // fill transaction id
     $this->type("contribution_transaction_id", "trid$firstName");
-      // fill financial type
-      $this->select("financial_type_id", "Event Fee");
+    // fill financial type
+    $this->select("financial_type_id", "Event Fee");
     // fill currency type
     $this->select("contribution_currency_type", "USD");
   }
@@ -388,15 +388,15 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
     // check to search primary member
     $this->click("xpath=//div[@id='memberForm']/table/tbody/tr[2]/td[2]/p/input");
     // add join date range
-    $this->select("member_join_date_relative","value=0");
+    $this->select("member_join_date_relative", "value=0");
     $this->webtestFillDate("member_join_date_low", "-1 day");
     $this->webtestFillDate("member_join_date_high", "+1 day");
     // add start date range
-    $this->select("member_start_date_relative","value=0");
+    $this->select("member_start_date_relative", "value=0");
     $this->webtestFillDate("member_start_date_low", "-1 day");
     $this->webtestFillDate("member_start_date_high", "+1 day");
     // add end date range
-    $this->select("member_end_date_relative","value=0");
+    $this->select("member_end_date_relative", "value=0");
     $this->webtestFillDate("member_end_date_low", "-1 year");
     $this->webtestFillDate("member_end_date_high", "+2 year");
   }
@@ -407,7 +407,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
    */
   public function addPledgeSearchDetail($firstName) {
     // fill pledge schedule date range
-    $this->select("pledge_payment_date_relative","value=0");
+    $this->select("pledge_payment_date_relative", "value=0");
     $this->webtestFillDate("pledge_payment_date_low", "-1 day");
     $this->webtestFillDate("pledge_payment_date_high", "+1 day");
     // fill Pledge payment status
index c026d41d332f628ad9b9edbfaa115f4f3b162767..52377cbfd5fdd5826092de8e2ac69261af50fef8 100644 (file)
@@ -60,7 +60,8 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $Id = explode('-', $this->getAttribute("xpath=//div[@id='event_status_id']/div[2]/table/tbody/tr@id"));
     $eventId = $Id[1];
 
-    $params = array('label_a_b' => 'Owner of ' . rand(),
+    $params = array(
+    'label_a_b' => 'Owner of ' . rand(),
       'label_b_a' => 'Belongs to ' . rand(),
       'contact_type_a' => 'Individual',
       'contact_type_b' => 'Individual',
@@ -303,11 +304,11 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->assertElementContainsText('search-status', '2 Contacts');
   }
 
- public function testAdvanceSearchForLog() {
 public function testAdvanceSearchForLog() {
     $this->webtestLogin();
 
-    $Pdate     = date('F jS, Y h:i:s A', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) - 1,   date( 'Y' )) );
-    $Ndate     = date('F jS, Y h:i:s A', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) + 1,   date( 'Y' )) );
+    $Pdate     = date('F jS, Y h:i:s A', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) - 1, date( 'Y' )) );
+    $Ndate     = date('F jS, Y h:i:s A', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) + 1, date( 'Y' )) );
 
     //create a contact and return the contact id
     $firstNameSoft = "John_".substr(sha1(rand()), 0, 5);
@@ -320,15 +321,15 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->type('sort_name', $lastNameSoft.', '.$firstNameSoft);
     $this->click('changeLog');
     $this->waitForElementPresent("log_date_low");
-    $this->select("log_date_relative","value=0");
+    $this->select("log_date_relative", "value=0");
     $this->webtestFillDate('log_date_low', "-1 day");
     $this->webtestFillDate('log_date_high', "+1 day");
     $this->click('_qf_Advanced_refresh');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->assertTrue(True, 'greater than or equal to "{$Pdate}" AND less than or equal to "{$Ndate}"');
+    $this->assertTrue(TRUE, 'greater than or equal to "{$Pdate}" AND less than or equal to "{$Ndate}"');
     $value = "$lastNameSoft, $firstNameSoft";
     $this->verifyText("xpath= id('rowid{$cid}')/td[3]/a", preg_quote($value));
 
-}
+  }
 
 }
index 0d13e9c013a980f782a046e2fc7129aeb2d48988..5e4ab7eac9628b2cb6f450390d26de38e50505a2 100644 (file)
@@ -136,7 +136,6 @@ class WebTest_Contact_ContactTagTest extends CiviSeleniumTestCase {
     // ...need to use mouseDownAt on first result (which is a li element), click does not work
     $this->clickAt("xpath=//div[@class='select2-result-label']");
 
-
     // Type search name in autocomplete.
     $this->click("css=input#sort_name_navigation");
     $this->type("css=input#sort_name_navigation", $firstName);
index 0af12c2c52eb8d64b902c22b8ca04dd34ea269ce..0e73c825a656132f7316303d63c475302156bfab 100644 (file)
@@ -206,7 +206,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase {
     //Get the customFieldsetID
     $this->openCiviPage('admin/custom/group', 'reset=1');
     $customFieldsetId = explode('&gid=', $this->getAttribute("xpath=//div[@id='custom_group']//table/tbody//tr/td/span[text()='$customGroupTitle']/../../td[7]/span/a@href"));
-    $customFieldsetId =  $customFieldsetId[1];
+    $customFieldsetId = $customFieldsetId[1];
 
     //create Individual contact
     $this->openCiviPage("contact/add", "reset=1&ct=Individual");
@@ -285,7 +285,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase {
 
     $this->click("xpath=//table//tr/td/label[text()=\"$customField\"]");
     $value = "custom".rand();
-    $this->type("xpath=//table//tr/td/label[text()=\"$customField\"]/../following-sibling::td/input",$value);
+    $this->type("xpath=//table//tr/td/label[text()=\"$customField\"]/../following-sibling::td/input", $value);
 
     //check for matching contact
     $this->click("_qf_Contact_refresh_dedupe");
@@ -318,7 +318,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase {
     $this->clickLink("xpath=//ul[@id='actions']/li[2]/a/span");
     $this->click("xpath=//table//tr/td/label[text()=\"$customField\"]");
     $value1 = "custom_1".rand();
-    $this->type("xpath=//table//tr/td/label[text()=\"$customField\"]/../following-sibling::td/input",$value1);
+    $this->type("xpath=//table//tr/td/label[text()=\"$customField\"]/../following-sibling::td/input", $value1);
     $this->click("_qf_Contact_upload_view-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->click("css=#tab_log a");
index d73fe00bb8006813bcc380c508f07419038e437e..c941b0b988e741dabe32b79c214141bb16af1a25 100644 (file)
@@ -68,7 +68,7 @@ class WebTest_Contact_DupeContactTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->waitForText('crm-notification-container', "Contact Saved");
 
-    $this->openCiviPage('contact/add' , 'reset=1&ct=Individual');
+    $this->openCiviPage('contact/add', 'reset=1&ct=Individual');
 
     //contact details section
 
index f4d9453cb855f162527c0c895a118a74a589f7ae..b39909663d330f2cddd96d8f7e6d1d4b8f71ba35 100644 (file)
@@ -42,8 +42,8 @@ class WebTest_Contact_EditContactTest extends CiviSeleniumTestCase {
     $firstName = 'WebTest' . substr(sha1(rand()), 0, 7);
     $lastName  = 'ContactEdit' . substr(sha1(rand()), 0, 7);
     $this->openCiviPage("contact/add", "reset=1&ct=Individual");
-    $this->type("first_name",$firstName);
-    $this->type("last_name",$lastName);
+    $this->type("first_name", $firstName);
+    $this->type("last_name", $lastName);
 
     //fill in phone  1
     $this->type("phone_1_phone", "111113333");
@@ -91,7 +91,7 @@ class WebTest_Contact_EditContactTest extends CiviSeleniumTestCase {
     $this->type("phone_2_phone_ext", "111");
     $this->select('phone_2_location_type_id', 'value=3');
 
-     //Edit in phone  3
+    //Edit in phone  3
     $this->type("phone_3_phone", "777777699");
     $this->type("phone_3_phone_ext", "197");
     $this->select('phone_3_location_type_id', 'value=1');
index 5ed83771bfc8f92f0626c8e7d872b895cf54d91d..d79c2b4d38cd3a6ec561e58a2f62d44ae43f76cd 100644 (file)
@@ -232,9 +232,9 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
     $this->waitForTextPresent("The role has been deleted.");
   }
 
-   /**
-   * Webtest for add contact to group (CRM-15108)
-   */
+  /**
+    * Webtest for add contact to group (CRM-15108)
+    */
   public function testAddContactToGroup() {
     $this->webtestLogin();
     $this->openCiviPage("contact/add", "reset=1&ct=Individual");
@@ -273,7 +273,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
     $this->openCiviPage('contact/search', 'reset=1');
     $this->waitForElementPresent("_qf_Basic_refresh");
     $this->type('sort_name', $firstName);
-    $this->select('group',"Advisory Board");
+    $this->select('group', "Advisory Board");
     $this->click('_qf_Basic_refresh');
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[3]/a[text()='{$lastName}, {$firstName}']"));
index 6aa890b982e8798aa4229c9c87b998cf4599b8c8..4ff94545c895fec8bf071640a74bb90af216f018 100644 (file)
@@ -261,6 +261,7 @@ class WebTest_Contact_InlineFieldsEditTest extends CiviSeleniumTestCase {
         case 'boolean':
           $this->click($item);
           break;
+
         case 'string':
           if (substr($val, 0, 5) == 'date:') {
             $this->webtestFillDate($item, trim(substr($val, 5)));
@@ -269,10 +270,12 @@ class WebTest_Contact_InlineFieldsEditTest extends CiviSeleniumTestCase {
             $this->type($item, $val);
           }
           break;
+
         case 'integer':
           $method = $val ? 'check' : 'uncheck';
           $this->$method($item);
           break;
+
         case 'array':
           foreach ($val as $option) {
             $selector = is_int($option) ? 'value' : 'label';
@@ -282,7 +285,7 @@ class WebTest_Contact_InlineFieldsEditTest extends CiviSeleniumTestCase {
       }
     }
     $this->click("css=#$block input.crm-form-submit");
-    if ($valid !== 'error' && $valid !='errorJs') {
+    if ($valid !== 'error' && $valid != 'errorJs') {
       // Verify the form saved
       $this->waitForElementPresent("css=#$block > .crm-inline-block-content");
       $validate = FALSE;
@@ -316,10 +319,12 @@ class WebTest_Contact_InlineFieldsEditTest extends CiviSeleniumTestCase {
                 $this->assertElementValueEquals($item, $val);
               }
               break;
+
             case 'integer':
               $method = $val ? 'assertChecked' : 'assertNotChecked';
               $this->$method($item);
               break;
+
             case 'array':
               foreach ($val as $option) {
                 $method = is_int($option) ? 'assertIsSelected' : 'assertSelected';
@@ -339,6 +344,7 @@ class WebTest_Contact_InlineFieldsEditTest extends CiviSeleniumTestCase {
         case 'errorJs':
           $this->waitForElementPresent('css=label.error');
           break;
+
         default:
           $this->waitForElementPresent('css=#crm-notification-container .error.ui-notify-message');
           $this->click('css=#crm-notification-container .error .ui-notify-cross');
index 8b32daa61960f8fa01d25c2e83c0194195337095..bd671eb5e3476a165da219bf9e38e1f89f31f716 100644 (file)
@@ -276,7 +276,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
 
     // Now we're filling the "Assigned To" field.
     // Typing contact's name into the field (using typeKeys(), not type()!)...
-    $this->select2("assignee_contact_id", $firstName,TRUE,FALSE);
+    $this->select2("assignee_contact_id", $firstName, TRUE, FALSE);
 
     // ...and verifying if the page contains properly formatted display name for chosen contact.
     $this->assertTrue($this->isTextPresent("$lastName, " . $firstName), "Contact not found in line " . __LINE__);
@@ -507,7 +507,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $firstName = "Kerry".substr(sha1(rand()), 0, 7);
     //last name
     $lastName = "King".substr(sha1(rand()), 0, 7);
-    $this->_createContacts($firstName,$lastName);
+    $this->_createContacts($firstName, $lastName);
 
     //add contact2 and its duplicate
     //These are the contacts with conflicts in communication preference.these contacts will be skipped during merge.
@@ -579,14 +579,14 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $firstName2 = "David".substr(sha1(rand()), 0, 7);
     //fill in last name
     $lastName2 = "Gilmour".substr(sha1(rand()), 0, 7);
-    $this->_createContacts($firstName2,$lastName2);
+    $this->_createContacts($firstName2, $lastName2);
 
     // add contact4 and its duplicate
     //fill in first name
     $firstName3 = "Dave".substr(sha1(rand()), 0, 7);
     //fill in last name
     $lastName3 = "Mustaine".substr(sha1(rand()), 0, 7);
-    $this->_createContacts($firstName3,$lastName3);
+    $this->_createContacts($firstName3, $lastName3);
 
     // Find and Merge Contacts with Supervised Rule
     $this->openCiviPage("contact/dedupefind", "reset=1&rgid=1&action=renew", "css=#DedupeFind table.pagerDisplay tbody tr");
@@ -597,7 +597,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
 
     // Check confirmation alert.
     $this->assertTrue(
-      (bool)preg_match("/^This will run the batch merge process on the listed duplicates. The operation will run in safe mode - only records with no direct data conflicts will be merged. Click OK to proceed if you are sure you wish to run this operation./",
+      (bool) preg_match("/^This will run the batch merge process on the listed duplicates. The operation will run in safe mode - only records with no direct data conflicts will be merged. Click OK to proceed if you are sure you wish to run this operation./",
         $this->getConfirmation()
                                        ));
     $this->chooseOkOnNextConfirmation();
@@ -972,7 +972,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
 
     $this->openCiviPage("contact/dedupefind", "reset=1&action=update&rgid=4");
     $this->click("xpath=//a/span[text()='Refresh Duplicates']");
-    $this->assertTrue((bool)preg_match("/This will refresh the duplicates list. Click OK to proceed./", $this->getConfirmation()));
+    $this->assertTrue((bool) preg_match("/This will refresh the duplicates list. Click OK to proceed./", $this->getConfirmation()));
     $this->chooseOkOnNextConfirmation();
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->waitForElementPresent("xpath=//a[text()='$firstName $lastName']/../../td[4]/a[text()='merge']");
index 7750dad7a28526bdf125cdce20cb987d36083bcc..0bcbaba77f863dcb6ff9e8db35e775de26fc879e 100644 (file)
@@ -198,7 +198,7 @@ class WebTest_Contact_MultipleContactSubTypes extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Check confirmation alert.
-    $this->assertTrue((bool)preg_match("/One or more contact subtypes have been de-selected from the list for this contact. Any custom data associated with de-selected subtype will be removed. Click OK to proceed, or Cancel to review your changes before saving./", $this->getConfirmation()));
+    $this->assertTrue((bool) preg_match("/One or more contact subtypes have been de-selected from the list for this contact. Any custom data associated with de-selected subtype will be removed. Click OK to proceed, or Cancel to review your changes before saving./", $this->getConfirmation()));
     $this->chooseOkOnNextConfirmation();
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
index d669c3285be5518aaa45116cf3b756e5d2a6f3a8..f200fdb267e923aa794afb5ec98a4f43bce666cd 100644 (file)
@@ -79,7 +79,6 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
     //fill in the individual
     $this->select2('related_contact_id', $sortName, TRUE);
 
-
     //fill in the relationship start date
     $this->webtestFillDate('start_date', '-2 year');
     $this->webtestFillDate('end_date', '+1 year');
@@ -164,7 +163,6 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
     //fill in the individual
     $this->select2('related_contact_id', $sortName, TRUE);
 
-
     //fill in the relationship start date
     $this->webtestFillDate('start_date', '-2 year');
     $this->webtestFillDate('end_date', '+1 year');
@@ -323,7 +321,7 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
     $this->type('organization_name', $orgName);
     $this->type('email-Primary', "info@" . $orgName . ".com");
     $this->click('_qf_Edit_next');
-    $this->waitForText("xpath=//div[@id='s2id_related_contact_id']","$orgName");
+    $this->waitForText("xpath=//div[@id='s2id_related_contact_id']", "$orgName");
 
     //fill in the relationship start date
     $this->webtestFillDate('start_date', '-2 year');
@@ -336,7 +334,6 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
     //$this->click("_qf_Relationship_upload");
     $this->click("_qf_Relationship_upload-bottom");
 
-
     //check the status message
     $this->waitForText('crm-notification-container', 'Relationship created.');
 
@@ -402,7 +399,7 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
     $this->type('organization_name', $orgName);
     $this->type('email-Primary', "info@" . $orgName . ".com");
     $this->click('_qf_Edit_next');
-    $this->waitForText("xpath=//div[@id='s2id_related_contact_id']","$orgName");
+    $this->waitForText("xpath=//div[@id='s2id_related_contact_id']", "$orgName");
 
     //fill in the relationship start date
     $this->webtestFillDate('start_date', '-2 year');
@@ -411,7 +408,6 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
     $description = "Current employee test.";
     $this->type("description", $description);
 
-
     //save the relationship
     //$this->click("_qf_Relationship_upload");
     $this->click('_qf_Relationship_upload-bottom');
@@ -429,6 +425,6 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
         'Status' => 'Enabled',
       )
     );
-    $this->assertTrue($this->isTextPresent("Employee of"),"Employee of relationship type not visible on View Relationship page.");
+    $this->assertTrue($this->isTextPresent("Employee of"), "Employee of relationship type not visible on View Relationship page.");
   }
 }
index d5db1f9ab0eb33647444f940c6577ff580188029..7d62358848c15cd716fa9da92cccdcc4e4177e66 100644 (file)
@@ -117,7 +117,7 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase {
     // add to group
     $this->select("group_id", "label=$groupName");
     $this->click("_qf_GroupContact_next");
-    $this->waitForText("crm-notification-container","Contact has been added to '$groupName'.");
+    $this->waitForText("crm-notification-container", "Contact has been added to '$groupName'.");
 
     // tag a contact
     // visit tag tab
@@ -206,7 +206,7 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase {
     // add to group
     $this->select("group_id", "label=$parentGroupName");
     $this->click("_qf_GroupContact_next");
-    $this->waitForText("crm-notification-container","Contact has been added to '$parentGroupName'.");
+    $this->waitForText("crm-notification-container", "Contact has been added to '$parentGroupName'.");
 
     // Adding child group contact
     // We're using Quick Add block on the main page for this.
@@ -224,7 +224,7 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase {
     // add to child group
     $this->select("group_id", "*$childGroupName");
     $this->click("_qf_GroupContact_next");
-    $this->waitForText("crm-notification-container","Contact has been added to '$childGroupName'.");
+    $this->waitForText("crm-notification-container", "Contact has been added to '$childGroupName'.");
 
     // visit contact search page
     $this->openCiviPage("contact/search", "reset=1");
index d93e0211db5aa3f821bb2c33749b4dc6d0eeccd1..dc70445f81b8d92439a8bb3e49263e4619ff7bdc 100644 (file)
@@ -65,90 +65,90 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
     $this->webtestLogin();
 
     $this->openCiviPage("contribute/search", "reset=1");
-    $this->select("contribution_date_relative","value=previous_before.quarter");
+    $this->select("contribution_date_relative", "value=previous_before.quarter");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("contribution_date_relative","value=previous_2.quarter");
+    $this->select("contribution_date_relative", "value=previous_2.quarter");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("contribution_date_relative","value=earlier.quarter");
+    $this->select("contribution_date_relative", "value=earlier.quarter");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("contribution_date_relative","value=ending.year");
+    $this->select("contribution_date_relative", "value=ending.year");
 
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
 
     $this->openCiviPage("member/search", "reset=1");
-    $this->select("member_end_date_relative","value=previous_before.month");
+    $this->select("member_end_date_relative", "value=previous_before.month");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("member_end_date_relative","value=previous_2.month");
+    $this->select("member_end_date_relative", "value=previous_2.month");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("member_end_date_relative","value=earlier.month");
+    $this->select("member_end_date_relative", "value=earlier.month");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("member_end_date_relative","value=ending.month");
+    $this->select("member_end_date_relative", "value=ending.month");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
 
     $this->openCiviPage("event/search", "reset=1");
-    $this->select("event_relative","value=previous_before.week");
+    $this->select("event_relative", "value=previous_before.week");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("event_relative","value=previous_2.week");
+    $this->select("event_relative", "value=previous_2.week");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("event_relative","value=earlier.week");
+    $this->select("event_relative", "value=earlier.week");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("event_relative","value=ending.week");
+    $this->select("event_relative", "value=ending.week");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
 
     $this->openCiviPage("activity/search", "reset=1");
-    $this->select("activity_date_relative","value=previous_before.day");
+    $this->select("activity_date_relative", "value=previous_before.day");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("activity_date_relative","value=previous_2.day");
+    $this->select("activity_date_relative", "value=previous_2.day");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("activity_date_relative","value=earlier.day");
+    $this->select("activity_date_relative", "value=earlier.day");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("activity_date_relative","value=ending.quarter");
+    $this->select("activity_date_relative", "value=ending.quarter");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
 
     $this->openCiviPage("pledge/search", "reset=1");
-    $this->select("pledge_payment_date_relative","value=greater.week");
+    $this->select("pledge_payment_date_relative", "value=greater.week");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
     $this->click("xpath=//form[@id='Search']/div[2]/div/div");
-    $this->select("pledge_payment_date_relative","value=greater.day");
+    $this->select("pledge_payment_date_relative", "value=greater.day");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
     $this->click("xpath=//form[@id='Search']/div[2]/div/div");
-    $this->select("pledge_payment_date_relative","value=greater.quarter");
+    $this->select("pledge_payment_date_relative", "value=greater.quarter");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
     $this->click("xpath=//form[@id='Search']/div[2]/div/div");
-    $this->select("pledge_payment_date_relative","value=greater.month");
+    $this->select("pledge_payment_date_relative", "value=greater.month");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
 
     $this->openCiviPage("mailing", "reset=1");
-    $this->select("mailing_relative","value=previous_before.year");
+    $this->select("mailing_relative", "value=previous_before.year");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("mailing_relative","value=previous_2.year");
+    $this->select("mailing_relative", "value=previous_2.year");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("mailing_relative","value=earlier.year");
+    $this->select("mailing_relative", "value=earlier.year");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
-    $this->select("mailing_relative","value=greater.year");
+    $this->select("mailing_relative", "value=greater.year");
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
   }
@@ -156,8 +156,7 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
   /**
    * @param array $openedPanes
    */
-  function _checkOpenedPanes($openedPanes = array(
-    )) {
+  function _checkOpenedPanes($openedPanes = array()) {
     if (!$this->isTextPresent('None found.')) {
       $this->click('css=div.crm-advanced_search_form-accordion div.crm-accordion-header');
     }
@@ -179,8 +178,7 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
    * @param $paneRef
    * @param array $selectFields
    */
-  function _selectPaneFields($paneRef, $selectFields = array(
-    )) {
+  function _selectPaneFields($paneRef, $selectFields = array()) {
     $pane = $this->_advanceSearchPanesDateFilter($paneRef);
 
     $this->click("css=div.crm-accordion-wrapper {$pane['headerLocator']}");
index 02da19d9e3ac3c02e11093ae5c5b3a3e0d236ae4..42ac2ce6ce189d273ffec403254e27e1cd454625 100644 (file)
@@ -122,7 +122,7 @@ class WebTest_Contact_TaskActionAddToGroupTest extends CiviSeleniumTestCase {
     $this->select("task", "label=Add Contacts to Group");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-     // Select the new group and click to add
+    // Select the new group and click to add
     $this->click("group_id");
     $this->select("group_id", "label=" . $newGroupName);
     $this->click("_qf_AddToGroup_next-bottom");
index 7aed12092f77631e5e6ff6611426f75e043d73e6..5b682729edd8914fa6f0d8b2157e0326e1208ab5 100644 (file)
@@ -37,7 +37,7 @@ class WebTest_Contact_UpdateProfileTest extends CiviSeleniumTestCase {
 
   public function testUpdateProfile() {
     // Create new via profile
-    include_once ('WebTest/Contact/AddViaProfileTest.php');
+    include_once 'WebTest/Contact/AddViaProfileTest.php';
     WebTest_Contact_AddViaProfileTest::testAddViaCreateProfile();
 
     // Open profile for editing
index 46069009dfa64f83208d5a0fbac384dc6ee9da91..738245953b393246a9ab75db1e224fca00db88e2 100644 (file)
@@ -211,7 +211,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
         $this->click("css=span#{$row}.pledge-adjust-option a");
         $this->type("field_{$row}_total_amount", $data['amount']);
       }
-         }
+    }
     elseif ($type == "Contribution") {
       $this->select("field_{$row}_financial_type", $data['financial_type']);
       $this->type("field_{$row}_total_amount", $data['amount']);
index 0b83135ac46b35238050f06c644ad8ca7db5a66b..e6e04636cb69e6a7d47d3d6629f53645c6310a28 100644 (file)
@@ -76,7 +76,7 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase {
       $isDefault
     );
 
-    $this->webtestAddContact($firstName, "Anderson", true);
+    $this->webtestAddContact($firstName, "Anderson", TRUE);
 
     // Get the contact id of the new contact
     $contactUrl = $this->parseURL();
@@ -128,7 +128,6 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase {
     $this->type("invoice_id", time());
     $this->webtestFillDate('thankyou_date');
 
-
     //Premium section
     $this->click("Premium");
     $this->waitForElementPresent("fulfilled_date");
index 570e1779a55c5838bb357a9fa2ef8651660b6926..e4bec6a24724e633b6b7761eaa75484a412b7660 100644 (file)
@@ -225,7 +225,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     $this->type('first_name', $firstName);
     $this->type('last_name', $lastName);
 
-    $this->select('state_province-1',"value=1002");
+    $this->select('state_province-1', "value=1002");
     $this->clickLink('_qf_Main_upload-bottom', '_qf_Confirm_next-bottom');
 
     $this->click('_qf_Confirm_next-bottom');
@@ -238,7 +238,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     $this->openCiviPage("contribute/search", "reset=1", 'contribution_date_low');
 
     $this->type('sort_name', "$lastName $firstName");
-    $this->select('financial_type_id',"label=Member Dues");
+    $this->select('financial_type_id', "label=Member Dues");
     $this->clickLink('_qf_Search_refresh', "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
     $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", '_qf_ContributionView_cancel-bottom', FALSE);
     $expected = array(
@@ -256,7 +256,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     $this->click("xpath=id('Search')/div[2]/div/div[1]");
     $this->waitForElementPresent("financial_type_id");
     $this->type("sort_name", $firstName);
-    $this->select('financial_type_id',"label=Donation");
+    $this->select('financial_type_id', "label=Donation");
     $this->clickLink('_qf_Search_refresh', "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
 
     $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", '_qf_ContributionView_cancel-bottom', FALSE);
index 68354ecd6ac5fde9c0e1d5193cbdaccd36eec497..14be82225611381e3e6befca51e91b2b8cd47a07 100644 (file)
@@ -137,8 +137,6 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
     $this->type("invoice_id", time());
     $this->webtestFillDate('thankyou_date');
 
-
-
     //Premium section
     $this->click("Premium");
     $this->waitForElementPresent("fulfilled_date");
index 6040db78e4f240396373cfe2f3a0453d1e65a12d..e66f3207cfb14ef51404aa4d88f524023203feb4 100644 (file)
@@ -537,7 +537,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $pageId = $this->webtestAddContributionPage($hash,
       $rand,
       $pageTitle,
-      null,
+      NULL,
       $amountSection,
       $payLater,
       $onBehalf,
@@ -557,7 +557,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
       $honoreeSection
     );
 
-     $this->_testOrganization($pageId, $cid, $pageTitle);
+    $this->_testOrganization($pageId, $cid, $pageTitle);
   }
 
   public function testWithContactSubtypeDupe() {
@@ -598,7 +598,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $pageId = $this->webtestAddContributionPage($hash,
       $rand,
       $pageTitle,
-      null,
+      NULL,
       $amountSection,
       $payLater,
       $onBehalf,
@@ -618,7 +618,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
       $honoreeSection
     );
 
-     //Open Live Contribution Page
+    //Open Live Contribution Page
     $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom");
     $this->waitForElementPresent("onbehalf_state_province-3");
 
@@ -1368,7 +1368,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $this->click("xpath=//div[@id='current-relationships']/div/table/tbody//tr/td[2]/a[text()='{$orgName1}']/../../td[9]/span[2][text()='more ']/ul/li[2]/a[text()='Delete']");
 
     // Check confirmation alert.
-    $this->assertTrue((bool)preg_match("/^Are you sure you want to delete this relationship?/",
+    $this->assertTrue((bool) preg_match("/^Are you sure you want to delete this relationship?/",
         $this->getConfirmation()
       ));
     $this->chooseOkOnNextConfirmation();
@@ -1508,8 +1508,8 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
       or die("Cannot Initialize new GD image stream");
     $background_color = imagecolorallocate($im, 0, 0, 0);
     $text_color = imagecolorallocate($im, 233, 14, 91);
-    imagestring($im, 1, 5, 5,  "On Behalf-Org Logo", $text_color);
-    imagepng($im,"/tmp/file.png");
+    imagestring($im, 1, 5, 5, "On Behalf-Org Logo", $text_color);
+    imagepng($im, "/tmp/file.png");
 
     $imagePath = "/tmp/file.png";
     $this->webtestAttachFile('onbehalf_image_URL', $imagePath);
index 27c4f586cc5a14a94d143270863d92a50466ce0d..093d9e6675d34caa5475f2183440f31b5d98ca75 100644 (file)
@@ -146,7 +146,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
 
     $this->type("sort_name", "$lastName $firstName");
     $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom",FALSE);
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
 
     //View Contribution Record and verify data
     $expected = array(
@@ -176,7 +176,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
     // Is contact present?
     $this->assertTrue($this->isTextPresent("$honorDisplayName"), "Honoree contact not found.");
 
-    }
+  }
 
   public function testOnlineContributionWithZeroAmount () {
     $this->webtestLogin();
@@ -293,13 +293,12 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
 
     $this->clickLink("_qf_Confirm_next-bottom", NULL);
 
-
     //login to check contribution
 
     // Log in using webtestLogin() method
     $this->webtestLogin();
 
-      //Find Contribution
+    //Find Contribution
     $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
 
     $this->type("sort_name", "$lastName $firstName");
index 529cef24ad9e6e56b8bc65d34d53a29d19085cc6..cc91535ff749f3f6f18032a9db9474d40c01c4cf 100644 (file)
@@ -115,7 +115,6 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase {
     $this->type("invoice_id", time());
     $this->webtestFillDate('thankyou_date');
 
-
     //Premium section
     $this->click("Premium");
     $this->waitForElementPresent("fulfilled_date");
@@ -126,7 +125,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase {
     // Clicking save.
     $this->click("_qf_Contribution_upload");
     // Ask for confirmation to send a receipt to the contributor on 'is_email_reciept' check
-    $this->assertTrue((bool)preg_match("/^Click OK to save this contribution record AND send a receipt to the contributor now./",$this->getConfirmation()));
+    $this->assertTrue((bool) preg_match("/^Click OK to save this contribution record AND send a receipt to the contributor now./", $this->getConfirmation()));
     $this->chooseOkOnNextConfirmation();
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
index f59904a5ad0458e357cecc3c9bc5e0d2ee4a47a9..6ce7c1b187bff31604545994ea66f42be7b0ebac 100755 (executable)
@@ -32,338 +32,338 @@ require_once 'CiviTest/CiviSeleniumTestCase.php';
  */
 class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
 
- protected function setUp() {
 protected function setUp() {
     parent::setUp();
   }
 
- public function testChangeContributionAmount() {
-   $this->webtestLogin();
-   $amount = 100;
-   //Offline Pay Later Contribution
-   $contact = $this->_testOfflineContribution($amount, "Pending");
-
-   $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
-
-   $this->type("sort_name", $contact['sort_name']);
-   $this->click("_qf_Search_refresh");
-
-   $this->waitForElementPresent("xpath=//*[@id='Search']//div[@id='contributionSearch']");
-   $contriIDOff = explode('&', $this->getAttribute("xpath=//div[@id='contributionSearch']//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span/a[1]@href"));
-   if (!empty($contriIDOff)) {
-     $contriIDOff = substr($contriIDOff[1], (strrpos($contriIDOff[1], '=') + 1));
-   }
-
-   $this->clickLink("xpath=//tr[@id='rowid{$contriIDOff}']/td[11]/span/a[2]", "total_amount", FALSE);
-   $this->type("total_amount", "90");
-   $this->clickLink('_qf_Contribution_upload','',FALSE);
-
-   // Is status message correct?
-   $this->waitForText('crm-notification-container', "The contribution record has been saved.");
-
-   //For Contribution
-   $searchParams = array('id' => $contriIDOff);
-   $compareParams = array('total_amount' => '90.00');
-   //For LineItem
-   $lineItemSearchParams = array('entity_id' => $contriIDOff);
-   $lineItemCompareParams = array('line_total' => '90.00');
-
-   $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compareParams);
-   $this->assertDBCompareValues('CRM_Price_DAO_LineItem', $lineItemSearchParams, $lineItemCompareParams);
-
-   $total = $this->_getTotalContributedAmount($contriIDOff);
-   $compare = array('total_amount' => $total);
-   $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compare);
-
-   $amount = $this->_getFinancialItemAmount($contriIDOff);
-   $compare = array('total_amount' => $amount);
-   $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compare);
-
-   $financialTrxnAmount = $this->_getFinancialTrxnAmount($contriIDOff);
-   $compare = array('total_amount' => $financialTrxnAmount);
-   $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compare);
- }
-
- public function testPayLater() {
-   $this->webtestLogin();
-   $amount = 100.00;
-   //Offline Pay Later Contribution
-   $this->_testOfflineContribution($amount, "Pending");
-   $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
-   $contId = $this->urlArg('id', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
-   $this->clickAjaxLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", '_qf_Contribution_cancel-bottom');
-   $this->select("contribution_status_id", "label=Completed");
-   $this->clickAjaxLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
-   $this->checkCRMAlert("The contribution record has been saved.");
-
-   //Assertions
-   $search = array('id' => $contId);
-   $compare = array('contribution_status_id' => 1);
-   $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $search, $compare);
-
-   $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
-   $search = array( 'entity_id' => $lineItem );
-   $compare = array( 'status_id' => 1 );
-   $this->assertDBCompareValues("CRM_Financial_DAO_FinancialItem", $search, $compare);
-
-   $status = $this->_getPremiumActualCost($contId, 'Accounts Receivable', 'Payment Processor Account', NULL, "'civicrm_contribution'",  "ft.status_id as status");
-   $this->assertEquals($status, '1', "Verify Completed Status");
- }
-
- public function testChangePremium() {
-   $this->webtestLogin();
-   $from = 'Premiums';
-   $to = 'Premiums inventory';
-   $financialType = array(
 public function testChangeContributionAmount() {
+    $this->webtestLogin();
+    $amount = 100;
+    //Offline Pay Later Contribution
+    $contact = $this->_testOfflineContribution($amount, "Pending");
+
+    $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
+
+    $this->type("sort_name", $contact['sort_name']);
+    $this->click("_qf_Search_refresh");
+
+    $this->waitForElementPresent("xpath=//*[@id='Search']//div[@id='contributionSearch']");
+    $contriIDOff = explode('&', $this->getAttribute("xpath=//div[@id='contributionSearch']//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span/a[1]@href"));
+    if (!empty($contriIDOff)) {
+      $contriIDOff = substr($contriIDOff[1], (strrpos($contriIDOff[1], '=') + 1));
+    }
+
+    $this->clickLink("xpath=//tr[@id='rowid{$contriIDOff}']/td[11]/span/a[2]", "total_amount", FALSE);
+    $this->type("total_amount", "90");
+    $this->clickLink('_qf_Contribution_upload', '', FALSE);
+
+    // Is status message correct?
+    $this->waitForText('crm-notification-container', "The contribution record has been saved.");
+
+    //For Contribution
+    $searchParams = array('id' => $contriIDOff);
+    $compareParams = array('total_amount' => '90.00');
+    //For LineItem
+    $lineItemSearchParams = array('entity_id' => $contriIDOff);
+    $lineItemCompareParams = array('line_total' => '90.00');
+
+    $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compareParams);
+    $this->assertDBCompareValues('CRM_Price_DAO_LineItem', $lineItemSearchParams, $lineItemCompareParams);
+
+    $total = $this->_getTotalContributedAmount($contriIDOff);
+    $compare = array('total_amount' => $total);
+    $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compare);
+
+    $amount = $this->_getFinancialItemAmount($contriIDOff);
+    $compare = array('total_amount' => $amount);
+    $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compare);
+
+    $financialTrxnAmount = $this->_getFinancialTrxnAmount($contriIDOff);
+    $compare = array('total_amount' => $financialTrxnAmount);
+    $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compare);
 }
+
 public function testPayLater() {
+    $this->webtestLogin();
+    $amount = 100.00;
+    //Offline Pay Later Contribution
+    $this->_testOfflineContribution($amount, "Pending");
+    $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
+    $contId = $this->urlArg('id', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
+    $this->clickAjaxLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", '_qf_Contribution_cancel-bottom');
+    $this->select("contribution_status_id", "label=Completed");
+    $this->clickAjaxLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
+    $this->checkCRMAlert("The contribution record has been saved.");
+
+    //Assertions
+    $search = array('id' => $contId);
+    $compare = array('contribution_status_id' => 1);
+    $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $search, $compare);
+
+    $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
+    $search = array( 'entity_id' => $lineItem );
+    $compare = array( 'status_id' => 1 );
+    $this->assertDBCompareValues("CRM_Financial_DAO_FinancialItem", $search, $compare);
+
+    $status = $this->_getPremiumActualCost($contId, 'Accounts Receivable', 'Payment Processor Account', NULL, "'civicrm_contribution'", "ft.status_id as status");
+    $this->assertEquals($status, '1', "Verify Completed Status");
 }
+
 public function testChangePremium() {
+    $this->webtestLogin();
+    $from = 'Premiums';
+    $to = 'Premiums inventory';
+    $financialType = array(
      'name' => 'Test Financial'.substr(sha1(rand()), 0, 7),
      'is_reserved' => 1,
      'is_deductible' => 1,
-   );
-   $this->addeditFinancialType($financialType);
-   $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='".$financialType['name']."']/../td[7]/span/a[text()='Accounts']");
-   $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='".$financialType['name']."']/../td[7]/span/a[text()='Accounts']");
-   $this->waitForElementPresent("xpath=//a[@id='newfinancialTypeAccount']");
-   $this->clickAjaxLink("xpath=//a[@id='newfinancialTypeAccount']", "_qf_FinancialTypeAccount_cancel-botttom");
-   $this->select("account_relationship", "label=Premiums Inventory Account is");
-   $this->waitForElementPresent("xpath=//select[@id='financial_account_id']/option[3][text()='Deposit Bank Account']");
-   $this->select("financial_account_id", "label=$to");
-   $this->clickAjaxLink("_qf_FinancialTypeAccount_next-botttom", "xpath=//a[@id='newfinancialTypeAccount']");
-
-   $premiumName = 'Premium'.substr(sha1(rand()), 0, 7);
-   $amount = 500;
-   $sku = 'SKU';
-   $price = 300;
-   $cost = 3.00;
-   $this->openCiviPage("admin/contribute/managePremiums", "action=add&reset=1");
-   // add premium
-   $this->addPremium($premiumName, $sku, $amount, $price, $cost, $financialType['name']);
-
-   //add second premium
-   $premiumName2 = 'Premium'.substr(sha1(rand()), 0, 7);
-   $amount2 = 600;
-   $sku2 = 'SKU';
-   $price2 = 200;
-   $cost2 = 2.00;
-   $this->openCiviPage("admin/contribute/managePremiums", "action=add&reset=1");
-   $this->addPremium($premiumName2, $sku2, $amount2, $price2, $cost2, $financialType['name']);
-
-   // add contribution with premium
-   $this->openCiviPage("contribute/add", "reset=1&action=add&context=standalone");
-
-   // create new contact using dialog
-   $this->createDialogContact();
-   // select financial type
-   $this->select( "financial_type_id", "value=1" );
-   // total amount
-   $this->type("total_amount", "100");
-   // fill Premium information
-   $this->clickAjaxLink("xpath=//div[@id='Premium']", "product_name_0");
-   $this->select('product_name_0', "label=$premiumName ( $sku )");
-   // Clicking save.
-   $this->clickAjaxLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[8]/span/a[text()='View']");
-   // Is status message correct?
-   $this->checkCRMAlert("The contribution record has been saved.");
-   // verify if Contribution is created
-   //click through to the Contribution edit screen
-   $contId = $this->urlArg('id', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
-   $this->clickAjaxLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", "product_name_0");
-
-   $this->select('product_name_0', "label=$premiumName2 ( $sku2 )");
-   // Clicking save.
-   $this->clickAjaxLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[7][text()='$premiumName2']");
-   $this->checkCRMAlert("The contribution record has been saved.");
-
-   //Assertions
-   $actualAmount = $this->_getPremiumActualCost($contId, $to, $from, $cost2, "'civicrm_contribution'");
-   $this->assertEquals($actualAmount, $cost2, "Verify actual cost for changed premium");
-
-   $deletedAmount = $this->_getPremiumActualCost($contId, $from, $to, $cost, "'civicrm_contribution'");
-   $this->assertEquals($deletedAmount, $cost, "Verify actual cost for deleted premium");
- }
-
- public function testDeletePremium() {
-   $this->webtestLogin();
-   $from = 'Premiums';
-   $to = 'Premiums inventory';
-   $financialType = array(
+    );
+    $this->addeditFinancialType($financialType);
+    $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='".$financialType['name']."']/../td[7]/span/a[text()='Accounts']");
+    $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='".$financialType['name']."']/../td[7]/span/a[text()='Accounts']");
+    $this->waitForElementPresent("xpath=//a[@id='newfinancialTypeAccount']");
+    $this->clickAjaxLink("xpath=//a[@id='newfinancialTypeAccount']", "_qf_FinancialTypeAccount_cancel-botttom");
+    $this->select("account_relationship", "label=Premiums Inventory Account is");
+    $this->waitForElementPresent("xpath=//select[@id='financial_account_id']/option[3][text()='Deposit Bank Account']");
+    $this->select("financial_account_id", "label=$to");
+    $this->clickAjaxLink("_qf_FinancialTypeAccount_next-botttom", "xpath=//a[@id='newfinancialTypeAccount']");
+
+    $premiumName = 'Premium'.substr(sha1(rand()), 0, 7);
+    $amount = 500;
+    $sku = 'SKU';
+    $price = 300;
+    $cost = 3.00;
+    $this->openCiviPage("admin/contribute/managePremiums", "action=add&reset=1");
+    // add premium
+    $this->addPremium($premiumName, $sku, $amount, $price, $cost, $financialType['name']);
+
+    //add second premium
+    $premiumName2 = 'Premium'.substr(sha1(rand()), 0, 7);
+    $amount2 = 600;
+    $sku2 = 'SKU';
+    $price2 = 200;
+    $cost2 = 2.00;
+    $this->openCiviPage("admin/contribute/managePremiums", "action=add&reset=1");
+    $this->addPremium($premiumName2, $sku2, $amount2, $price2, $cost2, $financialType['name']);
+
+    // add contribution with premium
+    $this->openCiviPage("contribute/add", "reset=1&action=add&context=standalone");
+
+    // create new contact using dialog
+    $this->createDialogContact();
+    // select financial type
+    $this->select( "financial_type_id", "value=1" );
+    // total amount
+    $this->type("total_amount", "100");
+    // fill Premium information
+    $this->clickAjaxLink("xpath=//div[@id='Premium']", "product_name_0");
+    $this->select('product_name_0', "label=$premiumName ( $sku )");
+    // Clicking save.
+    $this->clickAjaxLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[8]/span/a[text()='View']");
+    // Is status message correct?
+    $this->checkCRMAlert("The contribution record has been saved.");
+    // verify if Contribution is created
+    //click through to the Contribution edit screen
+    $contId = $this->urlArg('id', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
+    $this->clickAjaxLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", "product_name_0");
+
+    $this->select('product_name_0', "label=$premiumName2 ( $sku2 )");
+    // Clicking save.
+    $this->clickAjaxLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[7][text()='$premiumName2']");
+    $this->checkCRMAlert("The contribution record has been saved.");
+
+    //Assertions
+    $actualAmount = $this->_getPremiumActualCost($contId, $to, $from, $cost2, "'civicrm_contribution'");
+    $this->assertEquals($actualAmount, $cost2, "Verify actual cost for changed premium");
+
+    $deletedAmount = $this->_getPremiumActualCost($contId, $from, $to, $cost, "'civicrm_contribution'");
+    $this->assertEquals($deletedAmount, $cost, "Verify actual cost for deleted premium");
 }
+
 public function testDeletePremium() {
+    $this->webtestLogin();
+    $from = 'Premiums';
+    $to = 'Premiums inventory';
+    $financialType = array(
      'name' => 'Test Financial' . substr(sha1(rand()), 0, 7),
      'is_reserved' => 1,
      'is_deductible' => 1,
-   );
-   $this->addeditFinancialType($financialType);
-   $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='".$financialType['name']."']/../td[7]/span/a[text()='Accounts']");
-   $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='".$financialType['name']."']/../td[7]/span/a[text()='Accounts']");
-   $this->waitForElementPresent("xpath=//a[@id='newfinancialTypeAccount']");
-   $this->clickLink("xpath=//a[@id='newfinancialTypeAccount']", "_qf_FinancialTypeAccount_cancel-botttom", FALSE);
-
-   $this->select("account_relationship", "label=Premiums Inventory Account is");
-   $this->waitForElementPresent("xpath=//select[@id='financial_account_id']/option[3][text()='Deposit Bank Account']");
-   $this->select("financial_account_id", "label=$to");
-   $this->clickLink("_qf_FinancialTypeAccount_next-botttom", "xpath=//a[@id='newfinancialTypeAccount']", FALSE);
-   $premiumName = 'Premium' . substr(sha1(rand()), 0, 7);
-   $amount = 500;
-   $sku = 'SKU';
-   $price = 300;
-   $cost = 3.00;
-   $this->openCiviPage("admin/contribute/managePremiums", "action=add&reset=1");
-   // add premium
-   $this->addPremium($premiumName, $sku, $amount, $price, $cost, $financialType['name']);
-
-   // add contribution with premium
-   $this->openCiviPage("contribute/add", "reset=1&action=add&context=standalone");
-
-   // create new contact using dialog
-   $this->createDialogContact();
-   // select financial type
-   $this->select("financial_type_id", "value=1");
-   // total amount
-   $this->type("total_amount", "100");
-   // fill Premium information
-   $this->click("xpath=//div[@id='Premium']");
-   $this->waitForElementPresent("product_name_0");
-   $this->select('product_name_0', "label=$premiumName ( $sku )");
-   // Clicking save.
-   $this->clickLink("_qf_Contribution_upload");
-   // Is status message correct?
-   $this->waitForText('crm-notification-container', "The contribution record has been saved.");
-   // verify if Contribution is created
-   $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[8]/span/a[text()='View']");
-   //click through to the Contribution edit screen
-   $contId = explode('&id=', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
-   $contId = explode('&', $contId[1]);
-   $contId = $contId[0];
-   $this->clickLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", "_qf_Contribution_upload-bottom", FALSE);
-   $this->waitForElementPresent("product_name_0");
-   $this->select('product_name_0', "value=0");
-   // Clicking save.
-   $this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[7][not(text())]", FALSE);
-
-   //Assertions
-   $actualAmount = $this->_getPremiumActualCost($contId, $from, $to, NULL, "'civicrm_contribution'");
-   $this->assertEquals($actualAmount, $cost, "Verify actual cost for deleted premium");
- }
-
- public function testChangePaymentInstrument() {
-   $this->webtestLogin();
-   $label = 'TEST'.substr(sha1(rand()), 0, 7);
-   $amount = 100.00;
-   $financialAccount = CRM_Contribute_PseudoConstant::financialAccount();
-   $to = array_search('Accounts Receivable', $financialAccount);
-   $from = array_search('Deposit Bank Account', $financialAccount);
-   $this->addPaymentInstrument($label, $to);
-   $this->_testOfflineContribution($amount);
-   $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
-   $this->clickLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", '_qf_Contribution_cancel-bottom', FALSE);
-   $contId = explode('&id=', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
-   $contId = explode('&', $contId[1]);
-   $contId = $contId[0];
-   //change payment processor to newly created value
-   $this->select("payment_instrument_id", "label=$label");
-   $this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", FALSE);
-   $this->waitForAjaxContent();
-   //Assertions
-   $subtractedTotal = $this->_getPremiumActualCost($contId, NULL, 'Payment Processor Account');
-   $this->assertEquals($subtractedTotal, -$amount, "Verify amount deleted from old account");
-   $totalAmount = $this->_getPremiumActualCost($contId, NULL, 'Accounts Receivable');
-   $this->assertEquals($totalAmount, $amount, "Verify amount for newly inserted values");
- }
-
- public function testRefundContribution() {
-   $this->webtestLogin();
-   $amount = 100.00;
-   $this->_testOfflineContribution($amount);
-   $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
-   $this->clickAjaxLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", '_qf_Contribution_cancel-bottom');
-   //Contribution status
-   $this->select("contribution_status_id", "label=Refunded");
-   $contId = explode('&id=', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
-   $contId = explode('&', $contId[1]);
-   $contId = $contId[0];
-   $this->clickAjaxLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[6][text()='Refunded']");
-
-   //Assertions
-   $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
-   $search = array('entity_id' => $lineItem);
-   $compare = array(
+    );
+    $this->addeditFinancialType($financialType);
+    $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='".$financialType['name']."']/../td[7]/span/a[text()='Accounts']");
+    $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='".$financialType['name']."']/../td[7]/span/a[text()='Accounts']");
+    $this->waitForElementPresent("xpath=//a[@id='newfinancialTypeAccount']");
+    $this->clickLink("xpath=//a[@id='newfinancialTypeAccount']", "_qf_FinancialTypeAccount_cancel-botttom", FALSE);
+
+    $this->select("account_relationship", "label=Premiums Inventory Account is");
+    $this->waitForElementPresent("xpath=//select[@id='financial_account_id']/option[3][text()='Deposit Bank Account']");
+    $this->select("financial_account_id", "label=$to");
+    $this->clickLink("_qf_FinancialTypeAccount_next-botttom", "xpath=//a[@id='newfinancialTypeAccount']", FALSE);
+    $premiumName = 'Premium' . substr(sha1(rand()), 0, 7);
+    $amount = 500;
+    $sku = 'SKU';
+    $price = 300;
+    $cost = 3.00;
+    $this->openCiviPage("admin/contribute/managePremiums", "action=add&reset=1");
+    // add premium
+    $this->addPremium($premiumName, $sku, $amount, $price, $cost, $financialType['name']);
+
+    // add contribution with premium
+    $this->openCiviPage("contribute/add", "reset=1&action=add&context=standalone");
+
+    // create new contact using dialog
+    $this->createDialogContact();
+    // select financial type
+    $this->select("financial_type_id", "value=1");
+    // total amount
+    $this->type("total_amount", "100");
+    // fill Premium information
+    $this->click("xpath=//div[@id='Premium']");
+    $this->waitForElementPresent("product_name_0");
+    $this->select('product_name_0', "label=$premiumName ( $sku )");
+    // Clicking save.
+    $this->clickLink("_qf_Contribution_upload");
+    // Is status message correct?
+    $this->waitForText('crm-notification-container', "The contribution record has been saved.");
+    // verify if Contribution is created
+    $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[8]/span/a[text()='View']");
+    //click through to the Contribution edit screen
+    $contId = explode('&id=', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
+    $contId = explode('&', $contId[1]);
+    $contId = $contId[0];
+    $this->clickLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", "_qf_Contribution_upload-bottom", FALSE);
+    $this->waitForElementPresent("product_name_0");
+    $this->select('product_name_0', "value=0");
+    // Clicking save.
+    $this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[7][not(text())]", FALSE);
+
+    //Assertions
+    $actualAmount = $this->_getPremiumActualCost($contId, $from, $to, NULL, "'civicrm_contribution'");
+    $this->assertEquals($actualAmount, $cost, "Verify actual cost for deleted premium");
 }
+
 public function testChangePaymentInstrument() {
+    $this->webtestLogin();
+    $label = 'TEST'.substr(sha1(rand()), 0, 7);
+    $amount = 100.00;
+    $financialAccount = CRM_Contribute_PseudoConstant::financialAccount();
+    $to = array_search('Accounts Receivable', $financialAccount);
+    $from = array_search('Deposit Bank Account', $financialAccount);
+    $this->addPaymentInstrument($label, $to);
+    $this->_testOfflineContribution($amount);
+    $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
+    $this->clickLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", '_qf_Contribution_cancel-bottom', FALSE);
+    $contId = explode('&id=', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
+    $contId = explode('&', $contId[1]);
+    $contId = $contId[0];
+    //change payment processor to newly created value
+    $this->select("payment_instrument_id", "label=$label");
+    $this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", FALSE);
+    $this->waitForAjaxContent();
+    //Assertions
+    $subtractedTotal = $this->_getPremiumActualCost($contId, NULL, 'Payment Processor Account');
+    $this->assertEquals($subtractedTotal, -$amount, "Verify amount deleted from old account");
+    $totalAmount = $this->_getPremiumActualCost($contId, NULL, 'Accounts Receivable');
+    $this->assertEquals($totalAmount, $amount, "Verify amount for newly inserted values");
 }
+
 public function testRefundContribution() {
+    $this->webtestLogin();
+    $amount = 100.00;
+    $this->_testOfflineContribution($amount);
+    $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
+    $this->clickAjaxLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", '_qf_Contribution_cancel-bottom');
+    //Contribution status
+    $this->select("contribution_status_id", "label=Refunded");
+    $contId = explode('&id=', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
+    $contId = explode('&', $contId[1]);
+    $contId = $contId[0];
+    $this->clickAjaxLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[6][text()='Refunded']");
+
+    //Assertions
+    $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
+    $search = array('entity_id' => $lineItem);
+    $compare = array(
      'amount' => '100.00',
      'status_id' => 1,
-   );
-   $this->assertDBCompareValues("CRM_Financial_DAO_FinancialItem", $search, $compare);
-   $amount = $this->_getPremiumActualCost($contId, NULL, 'Payment Processor Account', -100.00, "'civicrm_contribution'");
-   $this->assertEquals($amount, '-100.00', 'Verify Financial Trxn Amount.');
- }
-
- public function testCancelPayLater() {
-   $this->webtestLogin();
-   $amount = 100.00;
-   $this->_testOfflineContribution($amount, "Pending");
-   $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
-   $this->clickLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", '_qf_Contribution_cancel-bottom', FALSE);
-   //Contribution status
-   $this->select("contribution_status_id", "label=Cancelled");
-   $contId = explode('&id=', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
-   $contId = explode('&', $contId[1]);
-   $contId = $contId[0];
-   $this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", FALSE);
-   $this->waitForText('crm-notification-container', "The contribution record has been saved.");
-
-   //Assertions
-   $search = array('id' => $contId);
-   $compare = array('contribution_status_id' => 3);
-   $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $search, $compare);
-   $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
-   $itemParams = array(
+    );
+    $this->assertDBCompareValues("CRM_Financial_DAO_FinancialItem", $search, $compare);
+    $amount = $this->_getPremiumActualCost($contId, NULL, 'Payment Processor Account', -100.00, "'civicrm_contribution'");
+    $this->assertEquals($amount, '-100.00', 'Verify Financial Trxn Amount.');
 }
+
 public function testCancelPayLater() {
+    $this->webtestLogin();
+    $amount = 100.00;
+    $this->_testOfflineContribution($amount, "Pending");
+    $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
+    $this->clickLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", '_qf_Contribution_cancel-bottom', FALSE);
+    //Contribution status
+    $this->select("contribution_status_id", "label=Cancelled");
+    $contId = explode('&id=', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
+    $contId = explode('&', $contId[1]);
+    $contId = $contId[0];
+    $this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", FALSE);
+    $this->waitForText('crm-notification-container', "The contribution record has been saved.");
+
+    //Assertions
+    $search = array('id' => $contId);
+    $compare = array('contribution_status_id' => 3);
+    $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $search, $compare);
+    $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
+    $itemParams = array(
      'amount' => '-100.00',
      'entity_id' => $lineItem,
-   );
-   $defaults = array();
-   $items = CRM_Financial_BAO_FinancialItem::retrieve($itemParams, $defaults);
-   $this->assertEquals($items->amount, $itemParams['amount'], 'Verify Amount for financial Item');
-   $totalAmount = $this->_getPremiumActualCost($items->id, 'Accounts Receivable', NULL, "-100.00", "'civicrm_financial_item'");
-   $this->assertEquals($totalAmount, "-$amount", 'Verify Amount for Financial Trxn');
-   $totalAmount = $this->_getPremiumActualCost($contId, 'Accounts Receivable', NULL, "-100.00", "'civicrm_contribution'");
-   $this->assertEquals($totalAmount, "-$amount", 'Verify Amount for Financial Trxn');
- }
-
- public function testChangeFinancialType() {
-   $this->webtestLogin();
-   $amount = 100.00;
-   $this->_testOfflineContribution($amount);
-   $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
-   $this->clickLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", '_qf_Contribution_cancel-bottom', FALSE);
-   //Contribution status
-   $this->select("financial_type_id", "value=3");
-   $contId = explode('&id=', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
-   $contId = explode('&', $contId[1]);
-   $contId = $contId[0];
-   $this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", FALSE);
-   $this->waitForText('crm-notification-container', "The contribution record has been saved.");
-
-   //Assertions
-   $search = array( 'id' => $contId );
-   $compare = array( 'financial_type_id' => 3 );
-   $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $search, $compare);
-
-   $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
-   $itemParams = array(
+    );
+    $defaults = array();
+    $items = CRM_Financial_BAO_FinancialItem::retrieve($itemParams, $defaults);
+    $this->assertEquals($items->amount, $itemParams['amount'], 'Verify Amount for financial Item');
+    $totalAmount = $this->_getPremiumActualCost($items->id, 'Accounts Receivable', NULL, "-100.00", "'civicrm_financial_item'");
+    $this->assertEquals($totalAmount, "-$amount", 'Verify Amount for Financial Trxn');
+    $totalAmount = $this->_getPremiumActualCost($contId, 'Accounts Receivable', NULL, "-100.00", "'civicrm_contribution'");
+    $this->assertEquals($totalAmount, "-$amount", 'Verify Amount for Financial Trxn');
 }
+
 public function testChangeFinancialType() {
+    $this->webtestLogin();
+    $amount = 100.00;
+    $this->_testOfflineContribution($amount);
+    $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']");
+    $this->clickLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", '_qf_Contribution_cancel-bottom', FALSE);
+    //Contribution status
+    $this->select("financial_type_id", "value=3");
+    $contId = explode('&id=', $this->getAttribute("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']@href"));
+    $contId = explode('&', $contId[1]);
+    $contId = $contId[0];
+    $this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", FALSE);
+    $this->waitForText('crm-notification-container', "The contribution record has been saved.");
+
+    //Assertions
+    $search = array( 'id' => $contId );
+    $compare = array( 'financial_type_id' => 3 );
+    $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $search, $compare);
+
+    $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
+    $itemParams = array(
      'amount' => '-100.00',
      'entity_id' => $lineItem,
-   );
-   $item1 = $item2 = array();
-   CRM_Financial_BAO_FinancialItem::retrieve($itemParams, $item1);
-   $this->assertEquals($item1['amount'], "-100.00", "Verify Amount for New Financial Item");
-   $itemParams['amount'] = '100.00';
-   CRM_Financial_BAO_FinancialItem::retrieve($itemParams, $item2);
-   $this->assertEquals($item2['amount'], "100.00", "Verify Amount for New Financial Item");
-
-   $cValue1 = $this->_getPremiumActualCost($contId, NULL, NULL, "-100.00", "'civicrm_contribution'");
-   $fValue1 = $this->_getPremiumActualCost($item1['id'], NULL, NULL, "-100.00", "'civicrm_financial_item'");
-   $this->assertEquals($cValue1, "-100.00", "Verify Amount");
-   $this->assertEquals($fValue1, "-100.00", "Verify Amount");
-   $cValue2 = $this->_getPremiumActualCost($contId, NULL, NULL, "100.00", "'civicrm_contribution'");
-   $fValue2 = $this->_getPremiumActualCost($item2['id'], NULL, NULL, "100.00", "'civicrm_financial_item'");
-   $this->assertEquals($cValue2, "100.00", "Verify Amount");
-   $this->assertEquals($fValue2, "100.00", "Verify Amount");
- }
+    );
+    $item1 = $item2 = array();
+    CRM_Financial_BAO_FinancialItem::retrieve($itemParams, $item1);
+    $this->assertEquals($item1['amount'], "-100.00", "Verify Amount for New Financial Item");
+    $itemParams['amount'] = '100.00';
+    CRM_Financial_BAO_FinancialItem::retrieve($itemParams, $item2);
+    $this->assertEquals($item2['amount'], "100.00", "Verify Amount for New Financial Item");
+
+    $cValue1 = $this->_getPremiumActualCost($contId, NULL, NULL, "-100.00", "'civicrm_contribution'");
+    $fValue1 = $this->_getPremiumActualCost($item1['id'], NULL, NULL, "-100.00", "'civicrm_financial_item'");
+    $this->assertEquals($cValue1, "-100.00", "Verify Amount");
+    $this->assertEquals($fValue1, "-100.00", "Verify Amount");
+    $cValue2 = $this->_getPremiumActualCost($contId, NULL, NULL, "100.00", "'civicrm_contribution'");
+    $fValue2 = $this->_getPremiumActualCost($item2['id'], NULL, NULL, "100.00", "'civicrm_financial_item'");
+    $this->assertEquals($cValue2, "100.00", "Verify Amount");
+    $this->assertEquals($fValue2, "100.00", "Verify Amount");
 }
 
   /**
    * @param int $entityId
@@ -376,29 +376,29 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    * @return null|string
    */
   function _getPremiumActualCost($entityId, $from = NULL, $to = NULL, $cost = NULL, $entityTable = NULL, $select = "ft.total_amount AS amount") {
-   $financialAccount = CRM_Contribute_PseudoConstant::financialAccount();
-   $query = "SELECT
+    $financialAccount = CRM_Contribute_PseudoConstant::financialAccount();
+    $query = "SELECT
      {$select}
      FROM civicrm_financial_trxn ft
      INNER JOIN civicrm_entity_financial_trxn eft ON eft.financial_trxn_id = ft.id AND eft.entity_id = {$entityId}";
-   if ($entityTable) {
-     $query .= " AND eft.entity_table = {$entityTable}";
-   }
-   if (!empty($to)) {
-     $to = array_search($to, $financialAccount);
-     $query .= " AND ft.to_financial_account_id = {$to}";
-   }
-   if (!empty($from)) {
-     $from = array_search($from, $financialAccount);
-     $query .= " AND ft.from_financial_account_id = {$from}";
-   }
-   if (!empty($cost)) {
-     $query .= " AND eft.amount = {$cost}";
-   }
-   $query .= " ORDER BY ft.id DESC LIMIT 1";
-   $result = CRM_Core_DAO::singleValueQuery($query);
-   return $result;
- }
+    if ($entityTable) {
+      $query .= " AND eft.entity_table = {$entityTable}";
+    }
+    if (!empty($to)) {
+      $to = array_search($to, $financialAccount);
+      $query .= " AND ft.to_financial_account_id = {$to}";
+    }
+    if (!empty($from)) {
+      $from = array_search($from, $financialAccount);
+      $query .= " AND ft.from_financial_account_id = {$from}";
+    }
+    if (!empty($cost)) {
+      $query .= " AND eft.amount = {$cost}";
+    }
+    $query .= " ORDER BY ft.id DESC LIMIT 1";
+    $result = CRM_Core_DAO::singleValueQuery($query);
+    return $result;
 }
 
   /**
    * @param int $contId
@@ -406,15 +406,15 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    * @return null|string
    */
   function _getFinancialTrxnAmount($contId) {
-   $query = "SELECT
+    $query = "SELECT
      SUM( ft.total_amount ) AS total
      FROM civicrm_financial_trxn AS ft
      LEFT JOIN civicrm_entity_financial_trxn AS ceft ON ft.id = ceft.financial_trxn_id
      WHERE ceft.entity_table = 'civicrm_contribution'
      AND ceft.entity_id = {$contId}";
-   $result = CRM_Core_DAO::singleValueQuery($query);
-   return $result;
- }
+    $result = CRM_Core_DAO::singleValueQuery($query);
+    return $result;
 }
 
   /**
    * @param int $contId
@@ -422,15 +422,15 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    * @return null|string
    */
   function _getFinancialItemAmount($contId) {
-   $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
-   $query = "SELECT
+    $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
+    $query = "SELECT
      SUM(amount)
      FROM civicrm_financial_item
      WHERE entity_table = 'civicrm_line_item'
      AND entity_id = {$lineItem}";
-   $result = CRM_Core_DAO::singleValueQuery($query);
-   return $result;
- }
+    $result = CRM_Core_DAO::singleValueQuery($query);
+    return $result;
 }
 
   /**
    * @param int $contId
@@ -438,66 +438,64 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
    * @return null|string
    */
   function _getTotalContributedAmount($contId) {
-   $query = "SELECT
+    $query = "SELECT
      SUM(amount)
      FROM civicrm_entity_financial_trxn
      WHERE entity_table = 'civicrm_contribution'
      AND entity_id = {$contId}";
-   $result = CRM_Core_DAO::singleValueQuery($query);
-   return $result;
- }
+    $result = CRM_Core_DAO::singleValueQuery($query);
+    return $result;
 }
 
   /**
    * @param $amount
    * @param string $status
    * @return array
    */
-  public function _testOfflineContribution($amount, $status="Completed") {
-
-   $this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload");
+  public function _testOfflineContribution($amount, $status = "Completed") {
 
-   // create new contact using dialog
-   $contact = $this->createDialogContact();
+    $this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload");
 
-   // select financial type
-   $this->select( "financial_type_id", "value=1" );
+    // create new contact using dialog
+    $contact = $this->createDialogContact();
 
-   //Contribution status
-   $this->select("contribution_status_id", "label=$status");
+    // select financial type
+    $this->select( "financial_type_id", "value=1" );
 
-   // total amount
-   $this->type("total_amount", $amount);
+    //Contribution status
+    $this->select("contribution_status_id", "label=$status");
 
-   // select payment instrument type
-   $this->select("payment_instrument_id", "label=Credit Card");
+    // total amount
+    $this->type("total_amount", $amount);
 
+    // select payment instrument type
+    $this->select("payment_instrument_id", "label=Credit Card");
 
-   $this->type("trxn_id", "P20901X1" . rand(100, 10000));
+    $this->type("trxn_id", "P20901X1" . rand(100, 10000));
 
+    //Custom Data
+    //$this->click('CIVICRM_QFID_3_6');
 
-   //Custom Data
-   //$this->click('CIVICRM_QFID_3_6');
+    // Clicking save.
+    $this->clickLink("_qf_Contribution_upload");
 
-   // Clicking save.
-   $this->clickLink("_qf_Contribution_upload");
+    // Is status message correct?
+    $this->checkCRMAlert("The contribution record has been saved.");
 
-   // Is status message correct?
-   $this->checkCRMAlert("The contribution record has been saved.");
+    $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[8]/span/a[text()='View']");
+    // verify if Membership is created
 
-   $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[8]/span/a[text()='View']");
-   // verify if Membership is created
+    //click through to the Membership view screen
+    $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
 
-   //click through to the Membership view screen
-   $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']");
-
-   $expected = array(
+    $expected = array(
      'Financial Type' => 'Donation',
      'Total Amount' => '100.00',
      'Contribution Status' => $status,
-   );
-   $this->webtestVerifyTabularData($expected);
-   $this->click("_qf_ContributionView_cancel-bottom");
+    );
+    $this->webtestVerifyTabularData($expected);
+    $this->click("_qf_ContributionView_cancel-bottom");
 
     return $contact;
- }
 }
 }
index a79ee310d42a35621e5d6aea803ce721e7314a7f..2d529a7da9e21e8adac74770c4da0cc28109847a 100644 (file)
@@ -126,7 +126,6 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC
     $this->type("invoice_id", time());
     $this->webtestFillDate('thankyou_date');
 
-
     //Premium section
     $this->click("Premium");
     $this->waitForElementPresent("fulfilled_date");
index 9cce6b59392e172028da0d3db994fc55ec2788ff..9b20ebaac5487086b40dd44766ac7388edffc62b 100644 (file)
@@ -52,7 +52,7 @@ class WebTest_Contribute_VerifySSLContributionTest extends CiviSeleniumTestCase
   public function _initialize() {
     if (!$this->initialized) {
       // log in
-        $this->webtestLogin();
+      $this->webtestLogin();
 
       // build names
       $hash = substr(sha1(rand()), 0, 7);
index 6569342dc1ae771f751e8bf98f2ec4f4f1146fa7..d008af01d91f1ebcac5a33d6be3b72b8cb510014 100644 (file)
@@ -915,11 +915,11 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'";
     $this->click('CIVICRM_QFID_1_is_monetary');
     $processorName = 'Test Processor';
     $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']");
-    $this->select('financial_type_id','label=Event Fee');
-    $this->type("label[1]",'Junior Stars');
-    $this->type("value[1]",'500.00');
-    $this->type("label[2]",'Super Stars');
-    $this->type("value[2]",'1000.00');
+    $this->select('financial_type_id', 'label=Event Fee');
+    $this->type("label[1]", 'Junior Stars');
+    $this->type("value[1]", '500.00');
+    $this->type("label[2]", 'Super Stars');
+    $this->type("value[2]", '1000.00');
     $this->check('default');
     $this->click('_qf_Fee_upload-bottom');
     $this->waitForText('crm-notification-container', "'Fees' information has been saved.");
@@ -927,41 +927,41 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'";
     // intro text for registration page
     $registerIntro = 'Fill in all the fields below and click Continue.';
 
-   // Go to Online Registration tab
-   $this->click('link=Online Registration');
-   $this->waitForElementPresent('_qf_Registration_upload-bottom');
-   $this->click('is_online_registration');
-   $this->assertChecked('is_online_registration');
-
-   //Requires Approvel
-   $this->click('requires_approval');
-   $this->assertChecked('requires_approval');
-   $this->click('_qf_Registration_upload-bottom');
-   $this->waitForText('crm-notification-container', "'Online Registration' information has been saved.");
-
-   // verify event input on info page
-   // start at Manage Events listing
-   $this->openCiviPage('event/manage', 'reset=1');
-   $this->click("link=$eventTitle");
-   $this->waitForPageToLoad($this->getTimeoutMsec());
-   $firstName = substr(sha1(rand()), 0, 7);
-   $this->webtestAddContact($firstName, 'Anderson', TRUE);
-   $contactName = "Anderson, $firstName";
-   $displayName = "$firstName Anderson";
-   $this->openCiviPage("event/register", "reset=1&id=$id", '_qf_Register_upload-bottom');
-   $this->type('first_name',$firstName);
-
-   //fill in last name
-   $lastName = 'Recuron'.substr(sha1(rand()), 0, 7);
-   $this->type('last_name', $contactName);
-   $email = $firstName . '@example.com';
-   $this->type('email-Primary', $email);
-   $this->click('_qf_Register_upload');
-   $this->waitForElementPresent("_qf_Confirm_next");
-   $this->click('_qf_Confirm_next');
+    // Go to Online Registration tab
+    $this->click('link=Online Registration');
+    $this->waitForElementPresent('_qf_Registration_upload-bottom');
+    $this->click('is_online_registration');
+    $this->assertChecked('is_online_registration');
+
+    //Requires Approvel
+    $this->click('requires_approval');
+    $this->assertChecked('requires_approval');
+    $this->click('_qf_Registration_upload-bottom');
+    $this->waitForText('crm-notification-container', "'Online Registration' information has been saved.");
+
+    // verify event input on info page
+    // start at Manage Events listing
+    $this->openCiviPage('event/manage', 'reset=1');
+    $this->click("link=$eventTitle");
+    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $firstName = substr(sha1(rand()), 0, 7);
+    $this->webtestAddContact($firstName, 'Anderson', TRUE);
+    $contactName = "Anderson, $firstName";
+    $displayName = "$firstName Anderson";
+    $this->openCiviPage("event/register", "reset=1&id=$id", '_qf_Register_upload-bottom');
+    $this->type('first_name', $firstName);
+
+    //fill in last name
+    $lastName = 'Recuron'.substr(sha1(rand()), 0, 7);
+    $this->type('last_name', $contactName);
+    $email = $firstName . '@example.com';
+    $this->type('email-Primary', $email);
+    $this->click('_qf_Register_upload');
+    $this->waitForElementPresent("_qf_Confirm_next");
+    $this->click('_qf_Confirm_next');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-   $this->waitForElementPresent("xpath=//div[@class='section']");
-   $this->assertTextPresent("Thank You for Registering");
+    $this->waitForElementPresent("xpath=//div[@class='section']");
+    $this->assertTextPresent("Thank You for Registering");
 
   }
 
@@ -969,10 +969,10 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'";
    * @param $status
    */
   public function _testEnableParticipantStatuses($status) {
-   // enable participant status
-   if ($this->isElementPresent("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']")) {
-     $this->click("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']");
-     $this->waitForElementPresent("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Disable']");
-   }
- }
+    // enable participant status
+    if ($this->isElementPresent("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']")) {
+      $this->click("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']");
+      $this->waitForElementPresent("xpath=//td[@class='crm-participant-label crm-editable crm-editable-enabled'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Disable']");
+    }
 }
 }
index e96484c5c56150acd9050281369be27ad8bb3a0b..2d853a456eeaed812277df328d91d0fc24962a5c 100644 (file)
@@ -349,16 +349,18 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
     foreach($contacts as $contact) {
       $this->verifyText("xpath=//div[@id='participantSearch']//table//tbody//tr/td[@class='crm-participant-sort_name']/a[text()='{$contact['sort_name']}']/../../td[9]", preg_quote($status));
       $this->verifyText("xpath=//div[@id='participantSearch']//table//tbody//tr/td[@class='crm-participant-sort_name']/a[text()='{$contact['sort_name']}']/../../td[4]/a", preg_quote($eventName));
-}
+    }
   }
 
   public function testAjaxCustomGroupLoad() {
     $this->webtestLogin();
 
     $customSets = array(
-      array('entity' => 'ParticipantEventName', 'subEntity' => 'Fall Fundraiser Dinner',
+      array(
+    'entity' => 'ParticipantEventName',
+    'subEntity' => 'Fall Fundraiser Dinner',
         'triggerElement' => array('name' => "event_id", 'type' => "select2")),
-      array('entity' => 'ParticipantRole', 'subEntity' => 'Attendee','triggerElement' => array('name' => 'role_id', 'type' => "select"))
+      array('entity' => 'ParticipantRole', 'subEntity' => 'Attendee', 'triggerElement' => array('name' => 'role_id', 'type' => "select"))
     );
     $pageUrl = array('url' => "participant/add", 'args' => "reset=1&action=add&context=standalone");
     $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, TRUE);
@@ -372,14 +374,20 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
     $this->webtestLogin();
 
     $customSets = array(
-      array('entity' => 'ParticipantEventType', 'subEntity' => '- Any -',
+      array(
+    'entity' => 'ParticipantEventType',
+    'subEntity' => '- Any -',
         'triggerElement' => array('name' => "event_id", 'type' => "select")),
-      array('entity' => 'ParticipantEventName', 'subEntity' => '- Any -',
+      array(
+    'entity' => 'ParticipantEventName',
+    'subEntity' => '- Any -',
         'triggerElement' => array('name' => "event_id", 'type' => "select")),
-      array('entity' => 'ParticipantEventName', 'subEntity' => 'Rain-forest Cup Youth Soccer Tournament',
+      array(
+    'entity' => 'ParticipantEventName',
+    'subEntity' => 'Rain-forest Cup Youth Soccer Tournament',
         'triggerElement' => array('name' => "event_id", 'type' => "select")),
-      array('entity' => 'ParticipantRole', 'subEntity' => '- Any -','triggerElement' => array('type' => "checkbox")),
-      array('entity' => 'ParticipantRole', 'subEntity' => 'Volunteer','triggerElement' => array('type' => "checkbox"))
+      array('entity' => 'ParticipantRole', 'subEntity' => '- Any -', 'triggerElement' => array('type' => "checkbox")),
+      array('entity' => 'ParticipantRole', 'subEntity' => 'Volunteer', 'triggerElement' => array('type' => "checkbox"))
     );
 
     $return = $this->addCustomGroupField($customSets);
index 9999a519314ab4ecf12338c9dc0dd6c0d8841840..0f822a94b71243442f53e38ee96f27a4bf914c84 100644 (file)
@@ -118,7 +118,8 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
 
         case 'Select':
           $options = array(
-            1 => array('label' => 'Chicken',
+            1 => array(
+          'label' => 'Chicken',
               'amount' => '30.00',
               'financial_type_id' => 'Donation'
             ),
@@ -136,7 +137,8 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
 
         case 'Radio':
           $options = array(
-            1 => array('label' => 'Yes',
+            1 => array(
+          'label' => 'Yes',
               'amount' => '50.00',
               'financial_type_id' => 'Donation'
 
@@ -156,7 +158,8 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
 
         case 'CheckBox':
           $options = array(
-            1 => array('label' => 'First Night',
+            1 => array(
+          'label' => 'First Night',
               'amount' => '15.00',
               'financial_type_id' => 'Donation'
             ),
@@ -261,10 +264,9 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('_qf_Fee_upload_done-bottom');
     $this->click('CIVICRM_QFID_1_is_monetary');
     $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']");
-    $this->select('financial_type_id','label=Event Fee');
+    $this->select('financial_type_id', 'label=Event Fee');
     $this->select('price_set_id', 'label=' . $setTitle);
 
-
     // intro text for registration page
     $registerIntro = 'Fill in all the fields below and click Continue.';
     $this->clickLink('_qf_Fee_upload-bottom', 'link=Online Registration', FALSE);
@@ -422,7 +424,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('_qf_Fee_upload-bottom');
     $this->click('CIVICRM_QFID_1_is_monetary');
     $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']");
-    $this->select('financial_type_id','label=Event Fee');
+    $this->select('financial_type_id', 'label=Event Fee');
     $this->select('price_set_id', 'label=' . $setTitle);
 
     $this->clickLink('_qf_Fee_upload-bottom', 'link=Online Registration', FALSE);
@@ -573,11 +575,11 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->click('link=Fees');
     $this->waitForElementPresent('_qf_Fee_upload-bottom');
     $this->click('CIVICRM_QFID_1_is_monetary');
-    $this->select('financial_type_id','label=Event Fee');
+    $this->select('financial_type_id', 'label=Event Fee');
     $this->select('price_set_id', 'label=' . $setTitle);
 
     $this->click('_qf_Fee_upload-bottom');
-    $this->waitForText("crm-notification-container","'Fees' information has been saved.");
+    $this->waitForText("crm-notification-container", "'Fees' information has been saved.");
 
     $this->openCiviPage('participant/add', 'reset=1&action=add&context=standalone', '_qf_Participant_upload-bottom');
 
@@ -719,7 +721,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->click('link=Fees');
     $this->waitForElementPresent('_qf_Fee_upload-bottom');
     $this->click('CIVICRM_QFID_1_is_monetary');
-    $this->select('financial_type_id','label=Event Fee');
+    $this->select('financial_type_id', 'label=Event Fee');
     $this->select('price_set_id', 'label=' . $setTitle);
     $templateId = $this->urlArg('id');
     $this->click('_qf_Fee_upload-bottom');
@@ -736,7 +738,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->openCiviPage("admin/price", "reset=1");
     $this->click("xpath=//table[@id='option11']/tbody/tr/td[4]/span[2]/ul/li[3]/a");
     // Check confirmation alert.
-    $this->assertTrue((bool)preg_match("/^Are you sure you want to delete this price set?/",
+    $this->assertTrue((bool) preg_match("/^Are you sure you want to delete this price set?/",
       $this->getConfirmation()
     ));
     $this->chooseOkOnNextConfirmation();
index 287f594ce8f886d79eee914ee6651f87a3d93ef8..b67ae2370d3ba9d4517f55d2548bd1ee68dccc81 100644 (file)
@@ -97,7 +97,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
     // check for proper info message displayed regarding status
     $this->chooseCancelOnNextConfirmation();
     $this->click('_qf_Participant_upload-bottom');
-    $this->assertTrue((bool)preg_match("/Payment amount is less than the amount owed. Expected participant status is 'Partially paid'. Are you sure you want to set the participant status to Registered/", $this->getConfirmation()));
+    $this->assertTrue((bool) preg_match("/Payment amount is less than the amount owed. Expected participant status is 'Partially paid'. Are you sure you want to set the participant status to Registered/", $this->getConfirmation()));
 
     // select partially paid status again and click on save
     $this->select('status_id', 'label=Partially paid');
@@ -155,7 +155,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
 
     // verify balance
     $text = $this->getText("xpath=id('AdditionalPayment')/div[2]//table/tbody/tr[3]/td[2]");
-    $this->assertTrue((bool)preg_match("/{$balance}/", $text));
+    $this->assertTrue((bool) preg_match("/{$balance}/", $text));
 
     // check form rule error
     $errorBalance = $balance + 1;
index fddc73fd249dfb26b23fdeae56d0ae350e88f0b4..b2d74127e5ac31455d59bde3aeb555e803c2a7f1 100644 (file)
@@ -493,7 +493,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase {
     $this->clickLink("_qf_Search_refresh");
 
     $this->clickLink("xpath=//div[@id='participantSearch']/table/tbody/tr[1]/td[@class='crm-participant-sort_name']/a[text()='{$sortName}']/../../td[11]/span/a[text()='View']", "xpath=//table[@class='selector row-highlight']/tbody/tr/td[8]/span/a[text()='View']", FALSE);
-    $this->clickLink("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']", "_qf_ParticipantView_cancel-bottom", false);
+    $this->clickLink("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']", "_qf_ParticipantView_cancel-bottom", FALSE);
 
     $this->webtestVerifyTabularData(
       array(
index c4eaab8da5b79154467747a7649f4ca122f2a49d..638ee82287db69b3da360372191e897c71a9a103 100644 (file)
@@ -158,7 +158,6 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase {
     $this->webtestFillDate('event_start_date_low', '-2 year');
     $this->webtestFillDate('event_end_date_high', '+1 year');
 
-
     $this->click("_qf_Search_refresh");
     $this->waitForElementPresent("xpath=//form[@id='Search']/div[3]/div/div[1]/div");
 
index 7d1c9d8cee937ff1e09dc43b3ac7e4e2f981912c..b244c7178dbe26d6ef62beacb6a9f45d89e4b2e4 100644 (file)
@@ -46,7 +46,7 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase {
     // We're using Quick Add block on the main page for this.
     $firstContactName = 'TestExport' . substr(sha1(rand()), 0, 7);
 
-    list($emailContactFirst,$prefixLabelContactFrst,$suffixLabelContactFrst,$genderLabelContactFrst) = WebTest_Export_ContactTest::webtestAddContactWithGenderPrefixSuffix($firstContactName, "Smith", "$firstContactName.smith@example.org", Null);
+    list($emailContactFirst, $prefixLabelContactFrst, $suffixLabelContactFrst, $genderLabelContactFrst) = WebTest_Export_ContactTest::webtestAddContactWithGenderPrefixSuffix($firstContactName, "Smith", "$firstContactName.smith@example.org", NULL);
 
     $sortFirstName = "Smith, $firstContactName";
     $displayFirstName = "$firstContactName Smith";
@@ -62,7 +62,7 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase {
     $this->waitForAjaxContent();
 
     $secondContactName = 'TestExport2' . substr(sha1(rand()), 0, 7);
-    list($emailContactSecond,$prefixLabelContactScnd,$suffixLabelContactScnd,$genderLabelContactScnd) = WebTest_Export_ContactTest::webtestAddContactWithGenderPrefixSuffix($secondContactName, "John", "$secondContactName.john@example.org", Null);
+    list($emailContactSecond, $prefixLabelContactScnd, $suffixLabelContactScnd, $genderLabelContactScnd) = WebTest_Export_ContactTest::webtestAddContactWithGenderPrefixSuffix($secondContactName, "John", "$secondContactName.john@example.org", NULL);
 
     $sortSecondName = "John, $secondContactName";
     $displaySecondName = "$secondContactName John";
@@ -446,14 +446,14 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase {
     $this->select("suffix_id", "value=$suffix");
     $this->click("demographics");
     $this->waitForElementPresent("civicrm_gender_Female_1");
-    $this->click($genderLabel,"value=$gender");
+    $this->click($genderLabel, "value=$gender");
     $this->waitForElementPresent('_qf_Contact_upload_view-bottom');
     $this->click('_qf_Contact_upload_view-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $prefixLabel = WebTest_Export_ContactTest::getOptionLabel('individual_prefix',$prefix);
-    $suffixLabel = WebTest_Export_ContactTest::getOptionLabel('individual_suffix',$suffix);
-    $genderLabel = WebTest_Export_ContactTest::getOptionLabel('gender',$gender);
-    return array($email,$prefixLabel,$suffixLabel,$genderLabel);
+    $prefixLabel = WebTest_Export_ContactTest::getOptionLabel('individual_prefix', $prefix);
+    $suffixLabel = WebTest_Export_ContactTest::getOptionLabel('individual_suffix', $suffix);
+    $genderLabel = WebTest_Export_ContactTest::getOptionLabel('gender', $gender);
+    return array($email, $prefixLabel, $suffixLabel, $genderLabel);
   }
 
   /**
@@ -462,7 +462,7 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase {
    *
    * @return array|int
    */
-  public function getOptionLabel($optionGroupName,$optionValue){
+  public function getOptionLabel($optionGroupName, $optionValue){
     $params = array(
       'version' => 3,
       'sequential' => 1,
@@ -470,7 +470,7 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase {
       'value' => $optionValue,
       'return' => 'label'
     );
-    $optionLabel = $this->webtest_civicrm_api("OptionValue", "getvalue",$params);
+    $optionLabel = $this->webtest_civicrm_api("OptionValue", "getvalue", $params);
     return $optionLabel;
   }
 }
index a02778755066833fcc49f3acaa29d1e36a962c27..5dbf2928d88ffef4fb51f990ee0eb76ba536bc63 100644 (file)
@@ -55,7 +55,7 @@ class ExportCiviSeleniumTestCase extends CiviSeleniumTestCase {
     $this->click($selector);
 
     // Wait for file to be downloaded
-    for ($i=1; $i<15; ++$i) {
+    for ($i = 1; $i < 15; ++$i) {
       sleep(2);
       if (file_exists($file)) {
         return $file;
@@ -77,13 +77,13 @@ class ExportCiviSeleniumTestCase extends CiviSeleniumTestCase {
    *   Array of header and rows according to row index.
    *                              eg: array(
    *                                    1 => array(
-      // Row index 1
-   // column name 'First Name', value 'Jones'
+  // Row index 1
+  // column name 'First Name', value 'Jones'
    *                                      'First Name' => 'Jones',
    *                                      'Last Name'  => 'Franklin'
    *                                    ),
    *                                    2 => array(
-      // Row index 2
+  // Row index 2
    *                                      'First Name' => 'Rajan',
    *                                      'Last Name'  => 'mayekar'
    *                                    ),
index a1a39328c1dfc89864cd494a06b90124c29713c3..883d070b1b857638aa22d35b486307140a1b3668 100644 (file)
@@ -40,7 +40,7 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
 
     // Add new Financial Account
     $orgName = 'Alberta '.substr(sha1(rand()), 0, 7);
-    $uniqueName = explode(" ",$orgName);
+    $uniqueName = explode(" ", $orgName);
     $financialAccountTitle = 'Financial Account '.substr(sha1(rand()), 0, 4);
     $financialAccountDescription = "{$financialAccountTitle} Description";
     $accountingCode = 1033;
@@ -72,7 +72,8 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
 
     $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE);
     //Varify Data after Adding new Financial Account
-    $verifyData = array('name' => $financialAccountTitle,
+    $verifyData = array(
+    'name' => $financialAccountTitle,
       'description' => $financialAccountDescription,
       'accounting_code' => $accountingCode,
       'tax_rate'   => $taxRate,
@@ -97,7 +98,7 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
     if ($orgNameEdit) {
       $orgNameEdit = 'NGO '.substr(sha1(rand()), 0, 7);
       $this->webtestAddOrganization($orgNameEdit);
-      $uniqueName = explode(" ",$orgNameEdit);
+      $uniqueName = explode(" ", $orgNameEdit);
     }
 
     $this->_testEditFinancialAccount($editfinancialAccount,
@@ -119,7 +120,8 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
     $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE);
 
-    $verifyData = array( 'name' => $financialAccountTitle,
+    $verifyData = array(
+    'name' => $financialAccountTitle,
       'description' => $financialAccountDescription,
       'accounting_code' => $accountingCode,
       'tax_rate'   => $taxRate,
@@ -131,7 +133,7 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
     $this->assertEquals($orgName, $this->getText("xpath=//*[@id='s2id_contact_id']/a/span[1]"));
 
     $this->_assertFinancialAccount($verifyData);
-    $verifySelectFieldData = array('financial_account_type_id'   => $financialAccountType);
+    $verifySelectFieldData = array('financial_account_type_id' => $financialAccountType);
     $this->_assertSelectVerify($verifySelectFieldData);
     $this->click('_qf_FinancialAccount_cancel-botttom');
     $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Delete']");
index 8b72ca92285c2a7608af3aef8c0eabd29c90b4df..e2e6ff774f41e9c97ba9cf45b2fe948d496857b0 100644 (file)
@@ -42,8 +42,8 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase {
 
     //Add new Financial Type
     $financialType['name'] = 'FinancialType '.substr(sha1(rand()), 0, 4);
-    $financialType['is_deductible'] = true;
-    $financialType['is_reserved'] = false;
+    $financialType['is_deductible'] = TRUE;
+    $financialType['is_reserved'] = FALSE;
     $this->addeditFinancialType($financialType);
     $expected = array(
       array(
@@ -68,7 +68,7 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase {
     $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[7]/span/a[text()='Accounts']");
     $this->waitForElementPresent('newfinancialTypeAccount');
 
-    foreach ($expected as  $value => $label) {
+    foreach ($expected as $value => $label) {
       $this->verifyText("xpath=//div[@id='ltype']/div/table/tbody/tr/td[2][text()='$label[financial_account]']/../td[1]", preg_quote($label['account_relationship']));
     }
 
@@ -93,10 +93,10 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase {
     //edit financial type
     $financialType['oldname'] = $financialType['name'];
     $financialType['name'] = 'Edited FinancialType '.substr(sha1(rand()), 0, 4);
-    $financialType['is_deductible'] = true;
-    $financialType['is_reserved'] = false;
-    $this->addeditFinancialType($financialType , 'Edit');
+    $financialType['is_deductible'] = TRUE;
+    $financialType['is_reserved'] = FALSE;
+    $this->addeditFinancialType($financialType, 'Edit');
     //delete financialtype
-    $this->addeditFinancialType($financialType , 'Delete');
+    $this->addeditFinancialType($financialType, 'Delete');
   }
 }
index 95cdd48b498a02a4aa83829d940995fc4f9f5b28..36ba575c38d3ef1d70edf05b950b37215a8ebd41 100644 (file)
@@ -64,7 +64,7 @@ class WebTest_Generic_CheckActivityTest extends CiviSeleniumTestCase {
     $this->clickAt("xpath=//div[@class='select2-result-label']");
 
     // ...again, waiting for the box with contact name to show up (span with delete token class indicates that it's present)...
-    $this->waitForText("xpath=//div[@id='s2id_target_contact_id']","$contactFirstName1");
+    $this->waitForText("xpath=//div[@id='s2id_target_contact_id']", "$contactFirstName1");
 
     // Now we're doing the same for "Assigned To" field.
     // Typing contact's name into the field (using typeKeys(), not type()!)...
@@ -80,6 +80,6 @@ class WebTest_Generic_CheckActivityTest extends CiviSeleniumTestCase {
     $this->clickAt("xpath=//div[@class='select2-result-label']");
 
     // ...again, waiting for the box with contact name to show up...
-    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']","$contactFirstName2");
+    $this->waitForText("xpath=//div[@id='s2id_assignee_contact_id']", "$contactFirstName2");
   }
 }
index 32684f2531c1493d56fa7ffd7516b974f310d48f..5514019865a5962de1a82e8694f9fc26a807c625 100644 (file)
@@ -257,7 +257,6 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase {
     $this->click("css=ul#civicrm-menu li.crm-Customize_Data_and_Screens");
     $this->clickLink("xpath=//div[@id='root-menu-div']//a[text()='Profiles']");
 
-
     $this->assertTextPresent("CiviCRM Profile");
     // Verify Reserved Profiles
 
@@ -315,7 +314,6 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase {
     $this->click("css=ul#civicrm-menu li.crm-Customize_Data_and_Screens");
     $this->clickLink("xpath=//div[@id='root-menu-div']//a[text()='Activity Types']");
 
-
     // Verify activity types
     $this->assertTextPresent("Meeting");
     $this->assertTextPresent("Print PDF Letter");
index 91e64336d3039fc392e78b1e677a869630b3159d..8b7e1224516761888c243455b147ee6b2817c7f7 100644 (file)
@@ -84,11 +84,12 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase {
       'state' => 'State',
       'country' => 'Country',
     );
-    foreach( $customDataParams['headers'] as $key =>$value){
+    foreach( $customDataParams['headers'] as $key => $value){
       $headers[$key] = $value;
     }
 
-    $rows = array( 0 =>
+    $rows = array(
+    0 =>
 
       array(
         'first_name' => $firstName1,
@@ -140,7 +141,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase {
     // clicking save
     $this->click('_qf_Field_done-bottom');
 
-    $this->waitForText('crm-notification-container',"Custom field '{$customField}' has been saved.");
+    $this->waitForText('crm-notification-container', "Custom field '{$customField}' has been saved.");
     $this->waitForElementPresent("xpath=//span[text()='$customField']");
     $customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField']/../../td[8]/span/a@href"));
     $customFieldId = $customFieldId[1];
@@ -150,7 +151,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase {
     $this->waitForElementPresent('_qf_Field_done-bottom');
     $customField1 = 'Customfield_int ' . substr(sha1(rand()), 0, 4);
     $this->type('label', $customField1);
-    $this->select("data_type[0]","value=1");
+    $this->select("data_type[0]", "value=1");
 
     // clicking save
     $this->click('_qf_Field_done-bottom');
@@ -165,7 +166,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase {
     $this->waitForElementPresent('_qf_Field_done-bottom');
     $customField2 = 'Customfield_Number ' . substr(sha1(rand()), 0, 4);
     $this->type('label', $customField2);
-    $this->select("data_type[0]","value=2");
+    $this->select("data_type[0]", "value=2");
 
     // clicking save
     $this->click('_qf_Field_done-bottom');
@@ -179,44 +180,44 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase {
     $this->click("newCustomField");
     $this->waitForElementPresent('_qf_Field_done-bottom');
     $customField3 = 'Customfield_alp_select' . substr(sha1(rand()), 0, 4);
-    $customFieldId3 = $this->_createMultipleValueCustomField($customField3,'Select');
+    $customFieldId3 = $this->_createMultipleValueCustomField($customField3, 'Select');
 
     // create custom field - "alphanumeric radio"
     $this->click("newCustomField");
     $this->waitForElementPresent('_qf_Field_done-bottom');
     $customField4 = 'Customfield_alp_radio' . substr(sha1(rand()), 0, 4);
-    $customFieldId4 = $this->_createMultipleValueCustomField($customField4,'Radio');
+    $customFieldId4 = $this->_createMultipleValueCustomField($customField4, 'Radio');
 
     // create custom field - "alphanumeric checkbox"
     $this->click("newCustomField");
     $this->waitForElementPresent('_qf_Field_done-bottom');
     $customField5 = 'Customfield_alp_checkbox' . substr(sha1(rand()), 0, 4);
-    $customFieldId5 = $this->_createMultipleValueCustomField($customField5,'CheckBox');
+    $customFieldId5 = $this->_createMultipleValueCustomField($customField5, 'CheckBox');
 
     // create custom field - "alphanumeric multiselect"
     $this->click("newCustomField");
     $this->waitForElementPresent('_qf_Field_done-bottom');
     $customField6 = 'Customfield_alp_multiselect' . substr(sha1(rand()), 0, 4);
-    $customFieldId6 = $this->_createMultipleValueCustomField($customField6,'Multi-Select');
+    $customFieldId6 = $this->_createMultipleValueCustomField($customField6, 'Multi-Select');
 
     // create custom field - "alphanumeric advmultiselect"
     $this->click("newCustomField");
     $this->waitForElementPresent('_qf_Field_done-bottom');
     $customField7 = 'Customfield_alp_advmultiselect' . substr(sha1(rand()), 0, 4);
-    $customFieldId7 = $this->_createMultipleValueCustomField($customField7,'AdvMulti-Select');
+    $customFieldId7 = $this->_createMultipleValueCustomField($customField7, 'AdvMulti-Select');
 
     // create custom field - "alphanumeric autocompleteselect"
     $this->click("newCustomField");
     $this->waitForElementPresent('_qf_Field_done-bottom');
     $customField8 = 'Customfield_alp_autocompleteselect' . substr(sha1(rand()), 0, 4);
-    $customFieldId8 = $this->_createMultipleValueCustomField($customField8,'Autocomplete-Select');
+    $customFieldId8 = $this->_createMultipleValueCustomField($customField8, 'Autocomplete-Select');
 
     // create custom field - Money
     $this->click("newCustomField");
     $this->waitForElementPresent('_qf_Field_done-bottom');
     $customField9 = 'Customfield_Money' . substr(sha1(rand()), 0, 4);
     $this->type('label', $customField9);
-    $this->select("data_type[0]","value=3");
+    $this->select("data_type[0]", "value=3");
 
     // clicking save
     $this->click('_qf_Field_done-bottom');
@@ -231,8 +232,8 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase {
     $this->waitForElementPresent('_qf_Field_done-bottom');
     $customField10 = 'Customfield_Date' . substr(sha1(rand()), 0, 4);
     $this->type('label', $customField10);
-    $this->select("data_type[0]","value=5");
-    $this->select("date_format","value=yy-mm-dd");
+    $this->select("data_type[0]", "value=5");
+    $this->select("date_format", "value=yy-mm-dd");
 
     // clicking save
     $this->click('_qf_Field_done-bottom');
@@ -293,14 +294,14 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase {
    *
    * @return array
    */
-  public function _createMultipleValueCustomField( $customFieldName, $type ){
+  public function _createMultipleValueCustomField($customFieldName, $type){
     $this->type('label', $customFieldName);
-    $this->select("data_type[0]","value=0");
-    $this->select("data_type[1]","value=".$type);
-    $this->type("option_label_1","label1");
-    $this->type("option_value_1","label1");
-    $this->type("option_label_2","label2");
-    $this->type("option_value_2","label2");
+    $this->select("data_type[0]", "value=0");
+    $this->select("data_type[1]", "value=".$type);
+    $this->type("option_label_1", "label1");
+    $this->type("option_value_1", "label1");
+    $this->type("option_label_2", "label2");
+    $this->type("option_value_2", "label2");
 
     // clicking save
     $this->click('_qf_Field_done-bottom');
index ced446e19718e7b5da4776135330dee4139a466a..e399dbc142a8bb429e23f7914eb85490ffae2789 100644 (file)
@@ -203,7 +203,8 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => 'A' . substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => 'A' . substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => substr(sha1(rand()), 0, 7) . 'and',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -215,7 +216,8 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase {
         'state' => 'NY',
         'country' => 'United States',
       ),
-      array('first_name' => 'S' . substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => 'S' . substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => substr(sha1(rand()), 0, 7) . 'sum',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
index ba58e0241323b0f0f061c09ddbf579cddf8d844d..2a71a658bc60f9968be51aeb13fb20696f742c9d 100644 (file)
@@ -121,7 +121,8 @@ class WebTest_Import_ContactCustomDataTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => $firstName1,
+      array(
+    'first_name' => $firstName1,
         'last_name' => 'Anderson',
         "custom_{$customDataParams[0]}" => 'This is a test field',
       ),
index af48ac108d510cdc860ede7325f4b69fae8213cc..52761f2c69fcec97326da7453efdd71d38f75669 100644 (file)
@@ -313,7 +313,8 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Anderson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -324,7 +325,8 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase {
         'state' => 'NY',
         'country' => 'United States',
       ),
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Summerson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -359,7 +361,8 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('organization_name' => 'org_' . substr(sha1(rand()), 0, 7),
+      array(
+    'organization_name' => 'org_' . substr(sha1(rand()), 0, 7),
         'email' => substr(sha1(rand()), 0, 7) . '@example.org',
         'phone' => '9949912154',
         'address_1' => 'Add 1',
@@ -368,7 +371,8 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase {
         'state' => 'NY',
         'country' => 'United States',
       ),
-      array('organization_name' => 'org_' . substr(sha1(rand()), 0, 7),
+      array(
+    'organization_name' => 'org_' . substr(sha1(rand()), 0, 7),
         'email' => substr(sha1(rand()), 0, 7) . '@example.org',
         'phone' => '6949412154',
         'address_1' => 'Add 1',
@@ -401,7 +405,8 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('household_name' => 'household_' . substr(sha1(rand()), 0, 7),
+      array(
+    'household_name' => 'household_' . substr(sha1(rand()), 0, 7),
         'email' => substr(sha1(rand()), 0, 7) . '@example.org',
         'phone' => '3949912154',
         'address_1' => 'Add 1',
@@ -410,7 +415,8 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase {
         'state' => 'NY',
         'country' => 'United States',
       ),
-      array('household_name' => 'household_' . substr(sha1(rand()), 0, 7),
+      array(
+    'household_name' => 'household_' . substr(sha1(rand()), 0, 7),
         'email' => substr(sha1(rand()), 0, 7) . '@example.org',
         'phone' => '5949412154',
         'address_1' => 'Add 1',
index 86f56d78bec61c88aac08d8c86eeb8ae4d64f97a..c2bf05c0d6a418d916be2d537b31af4360c57da6 100644 (file)
@@ -305,7 +305,8 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Anderson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -316,7 +317,8 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase {
         'state' => 'NY',
         'country' => 'United States',
       ),
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Summerson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -351,7 +353,8 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('organization_name' => 'org_' . substr(sha1(rand()), 0, 7),
+      array(
+    'organization_name' => 'org_' . substr(sha1(rand()), 0, 7),
         'email' => substr(sha1(rand()), 0, 7) . '@example.org',
         'phone' => '9949912154',
         'address_1' => 'Add 1',
@@ -360,7 +363,8 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase {
         'state' => 'NY',
         'country' => 'United States',
       ),
-      array('organization_name' => 'org_' . substr(sha1(rand()), 0, 7),
+      array(
+    'organization_name' => 'org_' . substr(sha1(rand()), 0, 7),
         'email' => substr(sha1(rand()), 0, 7) . '@example.org',
         'phone' => '6949412154',
         'address_1' => 'Add 1',
@@ -393,7 +397,8 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('household_name' => 'household_' . substr(sha1(rand()), 0, 7),
+      array(
+    'household_name' => 'household_' . substr(sha1(rand()), 0, 7),
         'email' => substr(sha1(rand()), 0, 7) . '@example.org',
         'phone' => '3949912154',
         'address_1' => 'Add 1',
@@ -402,7 +407,8 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase {
         'state' => 'NY',
         'country' => 'United States',
       ),
-      array('household_name' => 'household_' . substr(sha1(rand()), 0, 7),
+      array(
+    'household_name' => 'household_' . substr(sha1(rand()), 0, 7),
         'email' => substr(sha1(rand()), 0, 7) . '@example.org',
         'phone' => '5949412154',
         'address_1' => 'Add 1',
index a3924724e91d846f651e8ef82b7f32b18bebea67..85ad21d2a05857d3f2d91f77417bfa585f1c5f4d 100644 (file)
@@ -172,7 +172,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Anderson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -184,7 +185,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
         'country' => 'United States',
         'birth_date' => '1998-12-25',
       ),
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Summerson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -223,7 +225,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Anderson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -235,7 +238,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
         'country' => 'United States',
         'birth_date' => '12/23/98',
       ),
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Summerson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -274,7 +278,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Anderson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -286,7 +291,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
         'country' => 'United States',
         'birth_date' => '11/12/1995',
       ),
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Summerson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -325,7 +331,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Anderson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -337,7 +344,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
         'country' => 'United States',
         'birth_date' => 'December 12, 1998',
       ),
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Summerson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -376,7 +384,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Anderson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -388,7 +397,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
         'country' => 'United States',
         'birth_date' => '25/12/98',
       ),
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Summerson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -427,7 +437,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Anderson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -439,7 +450,8 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
         'country' => 'United States',
         'birth_date' => '25/12/1998',
       ),
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Summerson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
index c8830ed7de668db43f1a8287befb125b99935813..0f62bb6b6db5418046a1a4fff8121bb07ea4e9a4 100644 (file)
@@ -370,7 +370,8 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => isset($individualFields['first_name']) ? $individualFields['first_name'] : substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => isset($individualFields['first_name']) ? $individualFields['first_name'] : substr(sha1(rand()), 0, 7),
         'middle_name' => isset($individualFields['middle_name']) ? $individualFields['middle_name'] : substr(sha1(rand()), 0, 7),
         'last_name' => isset($individualFields['last_name']) ? $individualFields['last_name'] : 'Anderson',
         'email' => isset($individualFields['email']) ? $individualFields['email'] : substr(sha1(rand()), 0, 7) . '@example.com',
@@ -381,7 +382,8 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase {
         'state' => 'NY',
         'country' => 'United States',
       ),
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Summerson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -418,7 +420,8 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase {
       'country' => 'Country',
     );
     $rows = array(
-      array('organization_name' => isset($organizationFields['organization_name']) ? $organizationFields['organization_name'] : 'org_' . substr(sha1(rand()), 0, 7),
+      array(
+    'organization_name' => isset($organizationFields['organization_name']) ? $organizationFields['organization_name'] : 'org_' . substr(sha1(rand()), 0, 7),
         'email' => isset($organizationFields['email']) ? $organizationFields['email'] : substr(sha1(rand()), 0, 7) . 'example.org',
         'phone' => '9949912154',
         'address_1' => 'Add 1',
@@ -427,7 +430,8 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase {
         'state' => 'NY',
         'country' => 'United States',
       ),
-      array('organization_name' => 'org_' . substr(sha1(rand()), 0, 7),
+      array(
+    'organization_name' => 'org_' . substr(sha1(rand()), 0, 7),
         'email' => substr(sha1(rand()), 0, 7) . '@example.org',
         'phone' => '6949412154',
         'address_1' => 'Add 1',
@@ -463,7 +467,8 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('household_name' => isset($householdFields['household_name']) ? $householdFields['household_name'] : 'household_' . substr(sha1(rand()), 0, 7),
+      array(
+    'household_name' => isset($householdFields['household_name']) ? $householdFields['household_name'] : 'household_' . substr(sha1(rand()), 0, 7),
         'email' => isset($householdFields['email']) ? $householdFields['email'] : substr(sha1(rand()), 0, 7) . '@example.com',
         'phone' => '3949912154',
         'address_1' => 'Add 1',
@@ -472,7 +477,8 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase {
         'state' => 'NY',
         'country' => 'United States',
       ),
-      array('household_name' => 'household_' . substr(sha1(rand()), 0, 7),
+      array(
+    'household_name' => 'household_' . substr(sha1(rand()), 0, 7),
         'email' => substr(sha1(rand()), 0, 7) . '@example.org',
         'phone' => '5949412154',
         'address_1' => 'Add 1',
index a1e26b4357c8ef4e591ff42c76986b46dd928e7c..95978a8611d9fe721a4d9fb7052e1529f809d8ae 100644 (file)
@@ -111,7 +111,8 @@ class WebTest_Import_GroupTest extends ImportCiviSeleniumTestCase {
     );
 
     $rows = array(
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Anderson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -122,7 +123,8 @@ class WebTest_Import_GroupTest extends ImportCiviSeleniumTestCase {
         'state' => 'NY',
         'country' => 'United States',
       ),
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Summerson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
index 03dd1ad10bfa4740916f77865330d9b09b89cdd7..182b668b840303e1f029d5c6ad88cc094f79d417 100644 (file)
@@ -61,9 +61,9 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase {
     $headers,
     $rows,
     $contactType = 'Individual',
-    $mode        = 'Skip',
+    $mode = 'Skip',
     $fieldMapper = array(),
-    $other       = array()
+    $other = array()
   ) {
 
     // Go to contact import page.
@@ -197,7 +197,7 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase {
    *
    * @param string $type
    *   Import type (csv/sql).
-   *                             @todo:currently only supports csv, need to work on sql import
+   * @todo:currently only supports csv, need to work on sql import
    */
   public function importContacts($headers, $rows, $contactType = 'Individual', $mode = 'Skip', $fieldMapper = array(), $other = array(), $type = 'csv') {
 
@@ -364,7 +364,7 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Check confirmation alert.
-    $this->assertTrue((bool)preg_match("/^Are you sure you want to Import now[\s\S]$/", $this->getConfirmation()));
+    $this->assertTrue((bool) preg_match("/^Are you sure you want to Import now[\s\S]$/", $this->getConfirmation()));
     $this->chooseOkOnNextConfirmation();
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
index 3b18b4bff1bf951bec742077154cec295ff00b68..2123b58444610aef8cb6d971645bba62db264ef5 100644 (file)
@@ -318,7 +318,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
     $this->waitForElementPresent("_qf_Fee_upload-bottom");
     $this->click("CIVICRM_QFID_1_is_monetary");
     $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']");
-        $this->select( "financial_type_id", "value=4" );
+    $this->select( "financial_type_id", "value=4" );
 
     $counter = 1;
     foreach ($params['fee_level'] as $label => $amount) {
@@ -351,7 +351,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
     // verify event input on info page
     // start at Manage Events listing
     $this->openCiviPage('event/manage', 'reset=1');
-    $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$params['title']);
+    $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input", $params['title']);
     $this->click("_qf_SearchEvent_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->clickLink("link=" . $params['title'], NULL);
index 9f2b39df6818c820e0968d51a35c37b7106e2998..2e39076118ff55b575195e44c9e795c2ee314516 100644 (file)
@@ -71,7 +71,8 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase
       'country' => 'Country',
       'contact_relationships' =>
       array(
-        '4_a_b' => array('organization_name' => 'Organization Name',
+        '4_a_b' => array(
+    'organization_name' => 'Organization Name',
           'organization_email' => 'Organization Email',
           'organization_add' => 'Organization Street Address',
           'organization_city' => 'Organization City',
@@ -99,7 +100,8 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase
     );
 
     $rows = array(
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Anderson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -110,21 +112,25 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase
         'state' => 'NY',
         'country' => 'United States',
         'contact_relationships' =>
-        array('4_a_b' => array('organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
+        array(
+    '4_a_b' => array(
+    'organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
             'organization_email' => substr(sha1(rand()), 0, 7) . 'org@example.org',
             'organization_add' => 'Org Street Address',
             'organization_city' => 'Org City',
             'organization_state' => 'NY',
             'organization_country' => 'United States',
           ),
-          '7_a_b' => array('household_name' => 'House ' . substr(sha1(rand()), 0, 7),
+          '7_a_b' => array(
+    'household_name' => 'House ' . substr(sha1(rand()), 0, 7),
             'household_email' => substr(sha1(rand()), 0, 7) . 'house@example.org',
             'household_add' => 'House Street Address',
             'household_city' => 'House City',
             'household_state' => 'NY',
             'household_country' => 'United States',
           ),
-          '2_a_b' => array('spouse_f_name' => substr(sha1(rand()), 0, 7),
+          '2_a_b' => array(
+    'spouse_f_name' => substr(sha1(rand()), 0, 7),
             'spouse_l_name' => substr(sha1(rand()), 0, 7),
             'spouse_email' => substr(sha1(rand()), 0, 7) . 'spouse@example.org',
             'spouse_add' => 'Spouse Street Address',
@@ -134,7 +140,8 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase
           ),
         ),
       ),
-      array('first_name' => substr(sha1(rand()), 0, 7),
+      array(
+    'first_name' => substr(sha1(rand()), 0, 7),
         'middle_name' => substr(sha1(rand()), 0, 7),
         'last_name' => 'Summerson',
         'email' => substr(sha1(rand()), 0, 7) . '@example.com',
@@ -145,21 +152,25 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase
         'state' => 'NY',
         'country' => 'United States',
         'contact_relationships' =>
-        array('4_a_b' => array('organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
+        array(
+    '4_a_b' => array(
+    'organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
             'organization_email' => substr(sha1(rand()), 0, 7) . 'org@example.org',
             'organization_add' => 'Org Street Address',
             'organization_city' => 'Org City',
             'organization_state' => 'NY',
             'organization_country' => 'United States',
           ),
-          '7_a_b' => array('household_name' => 'House ' . substr(sha1(rand()), 0, 7),
+          '7_a_b' => array(
+    'household_name' => 'House ' . substr(sha1(rand()), 0, 7),
             'household_email' => substr(sha1(rand()), 0, 7) . 'house@example.org',
             'household_add' => 'House Street Address',
             'household_city' => 'House City',
             'household_state' => 'NY',
             'household_country' => 'United States',
           ),
-          '2_a_b' => array('spouse_f_name' => substr(sha1(rand()), 0, 7),
+          '2_a_b' => array(
+    'spouse_f_name' => substr(sha1(rand()), 0, 7),
             'spouse_l_name' => substr(sha1(rand()), 0, 7),
             'spouse_email' => substr(sha1(rand()), 0, 7) . 'spouse@example.org',
             'spouse_add' => 'Spouse Street Address',
@@ -170,7 +181,7 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase
         ),
       ),
     );
-      // for Employee of relationship
+    // for Employee of relationship
     $fieldMapper = array(
       'mapper[10][0]' => '5_a_b',
       'mapper[10][1]' => 'organization_name',
index af07b05e07caae599be66ed409e6eb43c6396e2e..1c1f72a533918f55ff7a7ae7a4cf2a3609654c66 100644 (file)
@@ -103,7 +103,7 @@ class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Is status message correct.
-    $this->waitForText('crm-notification-container',  "The mailing component '$componentName' has been saved.");
+    $this->waitForText('crm-notification-container', "The mailing component '$componentName' has been saved.");
 
     // Verify text.
     $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Footer']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details");
@@ -140,7 +140,7 @@ class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Is status message correct.
-    $this->waitForText('crm-notification-container',  "The mailing component '$componentName' has been saved.");
+    $this->waitForText('crm-notification-container', "The mailing component '$componentName' has been saved.");
 
     // Verify text
     $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Reply']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details");
index 684a996fcc96abf04094cdbe674d24b0dcb4bb2f..724ee0d96cfb64f0726fb23455f0f18926deb676 100644 (file)
@@ -421,13 +421,13 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
     // verify successful deliveries
     $this->verifyText("xpath=//table//tr[td/a[text()='Successful Deliveries']]/descendant::td[2]", preg_quote("1 (100.00%)"));
 
-    $summaryInfoLinks = array('Intended Recipients', 'Successful Deliveries', 'Tracked Opens', 'Click-throughs', 'Forwards', 'Replies', 'Bounces', 'Unsubscribe Requests','Opt-out Requests');
+    $summaryInfoLinks = array('Intended Recipients', 'Successful Deliveries', 'Tracked Opens', 'Click-throughs', 'Forwards', 'Replies', 'Bounces', 'Unsubscribe Requests', 'Opt-out Requests');
 
     //check for report and adv search links
     foreach($summaryInfoLinks as $value) {
       $this->assertTrue($this->isElementPresent("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$value}']]/descendant::td[3]/span/a[1][text()='Report']"), "Report link missing for {$value}");
       $this->assertTrue($this->isElementPresent("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$value}']]/descendant::td[3]/span/a[2][text()='Advanced Search']"), "Advance Search link missing for {$value}");
-}
+    }
     // verify mailing name
     $this->verifyText("xpath=//table//tr[td[1]/text()='Mailing Name']/descendant::td[2]", preg_quote("Mailing $mailingName Webtest"));
 
@@ -444,7 +444,9 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
         ),
         'Successful Deliveries' =>
         array(
-          'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest",
+          'report' => array(
+    'report_name' => 'Mailing Details',
+    'Mailing' => "Mailing $mailingName Webtest",
                     "Delivery Status" => " Successful"),
           'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing Delivery -' => "Successful")
         ),
@@ -460,13 +462,17 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
         ),
         'Forwards' =>
         array(
-          'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest",
+          'report' => array(
+    'report_name' => 'Mailing Details',
+    'Mailing' => "Mailing $mailingName Webtest",
                     'Forwarded' => 'Is equal to Yes'),
           'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: -' => "Forwards")
         ),
         'Replies' =>
         array(
-          'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest",
+          'report' => array(
+    'report_name' => 'Mailing Details',
+    'Mailing' => "Mailing $mailingName Webtest",
                     'Replied' => 'Is equal to Yes'),
           'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: Trackable Replies -' => "Replied")
         ),
@@ -477,13 +483,17 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
         ),
         'Unsubscribe Requests' =>
         array(
-          'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest",
+          'report' => array(
+    'report_name' => 'Mailing Details',
+    'Mailing' => "Mailing $mailingName Webtest",
                     'Unsubscribed' => 'Is equal to Yes'),
           'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: -' => "Unsubscribe Requests")
         ),
         'Opt-out Requests' =>
         array(
-          'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest",
+          'report' => array(
+    'report_name' => 'Mailing Details',
+    'Mailing' => "Mailing $mailingName Webtest",
                     'Opted-out' => 'Is equal to Yes'),
           'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: -' => "Opt-out Requests")
         ),
@@ -521,14 +531,14 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
           $this->assertElementContainsText('page-title', "{$value}");
           continue;
         }
-        $this->assertTrue($this->isElementPresent("xpath=//form//div[3]/table/tbody//tr/th[contains(text(),'{$key}')]/../td[contains(text(),'{$value}')]"),"Criteria check for {$key} failed for Report for {$summaryInfo}");
+        $this->assertTrue($this->isElementPresent("xpath=//form//div[3]/table/tbody//tr/th[contains(text(),'{$key}')]/../td[contains(text(),'{$value}')]"), "Criteria check for {$key} failed for Report for {$summaryInfo}");
       } else {
         $this->assertElementContainsText('page-title', "Advanced Search");
         $assertedValue = $this->isElementPresent("xpath=//div[@class='crm-results-block']//div[@class='qill'][contains(text(),'{$key} {$value}')]");
         if (!$assertedValue) {
           $assertedValue = $this->isTextPresent("{$key} {$value}");
         }
-       $this->assertTrue($assertedValue,"Criteria check for {$key} failed for Advance Search for {$summaryInfo}");
+        $this->assertTrue($assertedValue, "Criteria check for {$key} failed for Advance Search for {$summaryInfo}");
       }
     }
   }
index 977534311f2d053538988f28f348fa887d49b295..a226bb6cda8ffa5024ddaf83706af10844480d1a 100644 (file)
@@ -43,7 +43,7 @@ class WebTest_Mailing_SpoolTest extends CiviSeleniumTestCase {
     $this->webtestLogin();
 
     // Start spooling mail
-    $mut = new CiviMailUtils($this, true);
+    $mut = new CiviMailUtils($this, TRUE);
 
     // Add a contact
     $fname = substr(sha1(rand()), 0, 6);
index e27e4f8a63e557d33da7063683b5dee7baa12dfc..4347d21770545517f06ecb1e9043ee8805cf507a 100755 (executable)
@@ -245,7 +245,8 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase
       switch ($type) {
         case 'Radio':
           $options = array(
-            1 => array('label' => "$memTypeTitle1",
+            1 => array(
+          'label' => "$memTypeTitle1",
               'membership_type_id' => $memTypeId1,
               'amount' => '100.00',
             ),
@@ -265,7 +266,8 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase
 
         case 'CheckBox':
           $options = array(
-            1 => array('label' => "$memTypeTitle1",
+            1 => array(
+          'label' => "$memTypeTitle1",
               'membership_type_id' => $memTypeId1,
               'amount' => '100.00',
             ),
index 4b7c90687f4214c6e2cc4bcd4da5358d8c22405e..0aa4b8e6b22201cc74644ee6fb02d132088ab519 100644 (file)
@@ -59,7 +59,7 @@ class WebTest_Member_FixedMembershipTypeTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
 
     $this->type('name', "Membership Type $title");
-    $this->select2('member_of_contact_id',$title);
+    $this->select2('member_of_contact_id', $title);
 
     $this->type('minimum_fee', '100');
     $this->select( 'financial_type_id', 'value=2' );
@@ -78,7 +78,7 @@ class WebTest_Member_FixedMembershipTypeTest extends CiviSeleniumTestCase {
 
     $this->click('_qf_MembershipType_upload-bottom');
     $this->waitForElementPresent('link=Add Membership Type');
-    $this->waitForText('crm-notification-container',"The membership type 'Membership Type $title' has been saved.");
+    $this->waitForText('crm-notification-container', "The membership type 'Membership Type $title' has been saved.");
 
     $this->openCiviPage("contact/add", "reset=1&ct=Individual");
 
@@ -214,7 +214,7 @@ SELECT end_event_adjust_interval
     $this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
 
     $this->type('name', "Membership Type $title");
-    $this->select2('member_of_contact_id',$title);
+    $this->select2('member_of_contact_id', $title);
 
     $this->type('minimum_fee', '100');
     $this->select( 'financial_type_id', 'value=2' );
@@ -233,7 +233,7 @@ SELECT end_event_adjust_interval
 
     $this->click('_qf_MembershipType_upload-bottom');
     $this->waitForElementPresent('link=Add Membership Type');
-    $this->waitForText('crm-notification-container',"The membership type 'Membership Type $title' has been saved.");
+    $this->waitForText('crm-notification-container', "The membership type 'Membership Type $title' has been saved.");
 
     $this->openCiviPage("contact/add", "reset=1&ct=Individual");
 
@@ -371,7 +371,7 @@ SELECT end_event_adjust_interval
     $this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
 
     $this->type('name', "Membership Type $title");
-    $this->select2('member_of_contact_id',$title);
+    $this->select2('member_of_contact_id', $title);
 
     $this->type('minimum_fee', '100');
     $this->select( 'financial_type_id', 'value=2' );
@@ -389,7 +389,7 @@ SELECT end_event_adjust_interval
     $this->click('_qf_MembershipType_upload-bottom');
     $this->waitForElementPresent('link=Add Membership Type');
 
-    $this->waitForText('crm-notification-container',"The membership type 'Membership Type $title' has been saved.");
+    $this->waitForText('crm-notification-container', "The membership type 'Membership Type $title' has been saved.");
     $this->openCiviPage("contact/add", "reset=1&ct=Individual");
 
     $firstName = "John_" . substr(sha1(rand()), 0, 7);
@@ -520,7 +520,7 @@ SELECT end_event_adjust_interval
     $this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
 
     $this->type('name', "Membership Type $title");
-    $this->select2('member_of_contact_id',$title);
+    $this->select2('member_of_contact_id', $title);
 
     $this->type('minimum_fee', '100');
     $this->select( 'financial_type_id', 'value=2' );
@@ -538,7 +538,7 @@ SELECT end_event_adjust_interval
 
     $this->click('_qf_MembershipType_upload-bottom');
     $this->waitForElementPresent('link=Add Membership Type');
-    $this->waitForText('crm-notification-container',"The membership type 'Membership Type $title' has been saved.");
+    $this->waitForText('crm-notification-container', "The membership type 'Membership Type $title' has been saved.");
 
     $this->openCiviPage("contact/add", "reset=1&ct=Individual");
 
index 659ac9b49a35e533b50e7d3fda69bab35d40fdc0..6b538de46b974d30db33a56387ee11e62bb8b873 100644 (file)
@@ -145,7 +145,6 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase {
     $this->click('relationship_type_id');
     $this->select('relationship_type_id', 'label=Employee of');
 
-
     $this->select2('related_contact_id', $title1, TRUE);
 
     $description = 'Well here is some description !!!!';
index a860a92ab2fbac56858e0b62e096abf043a3baa2..dfe5aa61572219f1a2eda188a29c9298a7b1b7bb 100644 (file)
@@ -80,7 +80,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa
     $this->_testSignUpOrRenewMembership($sid, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = TRUE);
   }
 
-   public function testAddPriceSetWithMultipleTerms() {
+  public function testAddPriceSetWithMultipleTerms() {
     // Log in using webtestLogin() method
     $this->webtestLogin();
 
@@ -107,7 +107,8 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa
     $this->type('label', $fields[0]);
     $this->select('html_type', "value={$fields[1]}");
     $options = array(
-      1 => array('label' => $memTypeTitle1."_1",
+      1 => array(
+    'label' => $memTypeTitle1."_1",
          'membership_type_id' => $memTypeId1,
          'amount' => 50.00,
          'membership_num_terms' => 1,
@@ -132,9 +133,9 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa
       // Sleep should never be used for wait for anything to load from the server
       // Justification for this instance: FIXME
       sleep(1);
-      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[4]/input",$values['membership_num_terms']);
-      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[5]/input",$values['label']);
-      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[6]/input",$values['amount']);
+      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[4]/input", $values['membership_num_terms']);
+      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[5]/input", $values['label']);
+      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[6]/input", $values['amount']);
       if($i > 3){
         $this->click('link=another choice');
       }
@@ -229,7 +230,8 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa
       switch ($type) {
         case 'Radio':
           $options = array(
-            1 => array('label' => "$memTypeTitle1",
+            1 => array(
+          'label' => "$memTypeTitle1",
                'membership_type_id' => $memTypeId1,
                'amount' => 100.00,
             ),
@@ -244,7 +246,8 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa
 
         case 'CheckBox':
           $options = array(
-            1 => array('label' => "$memTypeTitle1",
+            1 => array(
+          'label' => "$memTypeTitle1",
                'membership_type_id' => $memTypeId1,
                'amount' => 100.00,
             ),
index 35f688614f82f0e7069463ecabc242a5e29e7882..d82c6cb00302e3ef8b7c4cefbea8b24097963708 100644 (file)
@@ -93,7 +93,6 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase {
     // save the renewed membership
     $this->click('_qf_MembershipRenewal_upload-bottom');
 
-
     // page was loaded
     $this->waitForTextPresent($sourceText);
 
@@ -118,7 +117,7 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase {
       'End date' => $endDate,
     );
     $this->webtestVerifyTabularData($verifyMembershipRenewData);
-   }
+  }
 
   public function testOfflineMemberRenewOverride() {
     $this->webtestLogin();
@@ -196,7 +195,6 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase {
     // save the renewed membership
     $this->click('_qf_MembershipRenewal_upload-bottom');
 
-
     // page was loaded
     $this->waitForTextPresent($sourceText);
 
@@ -294,7 +292,6 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase {
     // save the renewed membership
     $this->click('_qf_MembershipRenewal_upload-bottom');
 
-
     // page was loaded
     $this->waitForTextPresent($sourceText);
 
@@ -381,7 +378,6 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->waitForText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added.");
     $this->waitForText('crm-notification-container', "A membership confirmation and receipt has been sent to {$firstName}@memberson.com.");
 
-
     $this->waitForElementPresent("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']");
     // click through to the Membership Renewal Link
     $this->click("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']");
@@ -411,7 +407,6 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase {
     // save the renewed membership
     $this->click('_qf_MembershipRenewal_upload-bottom');
 
-
     // page was loaded
     $this->waitForTextPresent($sourceText);
 
index 0577614f72f61ea69c4076f6aa05b83c9ff682a5..31c5024da032ba0b761b5931e5340f47fcf4ec70 100644 (file)
@@ -122,7 +122,6 @@ class WebTest_Member_OnlineAutoRenewMembershipGCTest extends CiviSeleniumTestCas
       $this->type("duration_interval", "1");
       $this->select("duration_unit", "label=year");
 
-
       $this->click("_qf_MembershipType_upload-bottom");
       $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -134,7 +133,6 @@ class WebTest_Member_OnlineAutoRenewMembershipGCTest extends CiviSeleniumTestCas
       $this->type("duration_interval", "1");
       $this->select("duration_unit", "label=year");
 
-
       $this->click("_qf_MembershipType_upload-bottom");
       $this->waitForPageToLoad($this->getTimeoutMsec());
 
index 6ba841b11782fbdc7052632320124d5c8ac151c1..dde48702f99c0f818cb23e8b22ee5a6b83724606 100644 (file)
@@ -132,7 +132,7 @@ class WebTest_Member_OnlineAutoRenewMembershipTest extends CiviSeleniumTestCase
     static $pageId = NULL;
 
     if (!$pageId) {
-        $this->webtestLogin();
+      $this->webtestLogin();
 
       //add payment processor.
       $hash = substr(sha1(rand()), 0, 7);
@@ -148,7 +148,6 @@ class WebTest_Member_OnlineAutoRenewMembershipTest extends CiviSeleniumTestCase
       $this->type("duration_interval", "1");
       $this->select("duration_unit", "label=year");
 
-
       $this->click("_qf_MembershipType_upload-bottom");
       $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -159,7 +158,6 @@ class WebTest_Member_OnlineAutoRenewMembershipTest extends CiviSeleniumTestCase
       $this->type("duration_interval", "1");
       $this->select("duration_unit", "label=year");
 
-
       $this->click("_qf_MembershipType_upload-bottom");
       $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -202,7 +200,7 @@ class WebTest_Member_OnlineAutoRenewMembershipTest extends CiviSeleniumTestCase
       );
 
       //make sure we do have required permissions.
-      $permissions = array("edit-1-make-online-contributions",  "edit-1-profile-listings-and-forms");
+      $permissions = array("edit-1-make-online-contributions", "edit-1-profile-listings-and-forms");
       $this->changePermissions($permissions);
 
       // now logout and do membership test that way
index a54f1eca62759d0cf33c112de428035cac09ab72..3d7015ed738e7ee6eea8a2251f04dcb5ae085c43 100644 (file)
@@ -118,7 +118,8 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     $this->type('label', $fields[0]);
     $this->select('html_type', "value={$fields[1]}");
     $options = array(
-            1 => array('label' => $memTypeTitle1."_1",
+            1 => array(
+    'label' => $memTypeTitle1."_1",
               'membership_type_id' => $memTypeId1,
               'amount' => 50.00,
               'membership_num_terms' => 1,
@@ -142,9 +143,9 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
       $this->select("membership_type_id_{$index}", "value={$values['membership_type_id']}");
 
       $this->waitForElementPresent("xpath=//table[@id='optionField']/tbody/tr[$i]/td[4]/input");
-      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[4]/input",$values['membership_num_terms']);
-      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[5]/input",$values['label']);
-      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[6]/input",$values['amount']);
+      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[4]/input", $values['membership_num_terms']);
+      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[5]/input", $values['label']);
+      $this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[6]/input", $values['amount']);
       if($i > 3){
         $this->click('link=another choice');
       }
@@ -200,7 +201,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     }
     elseif ($usedFor == 'Membership') {
       $this->click('extends[3]');
-          $this->waitForElementPresent( 'financial_type_id' );
+      $this->waitForElementPresent( 'financial_type_id' );
       $this->select("css=select.crm-form-select", "label={$contributionType}");
     }
 
@@ -244,7 +245,8 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
       switch ($type) {
         case 'Radio':
           $options = array(
-            1 => array('label' => "$memTypeTitle1",
+            1 => array(
+          'label' => "$memTypeTitle1",
               'membership_type_id' => $memTypeId1,
               'amount' => 100.00,
             ),
@@ -259,7 +261,8 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
 
         case 'CheckBox':
           $options = array(
-            1 => array('label' => "$memTypeTitle1",
+            1 => array(
+          'label' => "$memTypeTitle1",
               'membership_type_id' => $memTypeId1,
               'amount' => 100.00,
             ),
index d0c175be1b79035003129bfbbb647550d4a8b7a8..c086990e842ad5f8c00a0987c3bc8824d63fd5b9 100644 (file)
@@ -196,7 +196,7 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase {
     // Select membership type 1
     $this->waitForElementPresent("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label");
     if ($memTypeId != 'No thank you') {
-    $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//div/span/label/span[1][contains(text(),'$memTypeId')]");
+      $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//div/span/label/span[1][contains(text(),'$memTypeId')]");
     }
 
     else {
@@ -317,7 +317,7 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase {
     $this->webtestLogin();
 
     //Find Contribution
-    $this->openCiviPage("contribute/search","reset=1", "contribution_date_low");
+    $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
 
     $this->type("sort_name", "$lastName $firstName");
     $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
index eb53d453a198100799fa9fe3878f7b0ad3f67c61..cc01c2661e6e523d1784bd7fd73a42175faf8bf0 100644 (file)
@@ -69,9 +69,9 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("new_title");
 
     if ($this->isElementPresent("member_price_set_id")) {
-    $this->waitForElementPresent("member_price_set_id");
+      $this->waitForElementPresent("member_price_set_id");
 
-    $this->select("member_price_set_id", "label=- none -");
+      $this->select("member_price_set_id", "label=- none -");
     }
 
     $this->waitForElementPresent("membership_type-block");
@@ -243,9 +243,9 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
 
     $this->waitForElementPresent("new_title");
     if ($this->isElementPresent("member_price_set_id")) {
-    $this->waitForElementPresent("member_price_set_id");
+      $this->waitForElementPresent("member_price_set_id");
 
-    $this->select("member_price_set_id", "label=- none -");
+      $this->select("member_price_set_id", "label=- none -");
     }
 
     $this->waitForElementPresent("membership_type-block");
index 618b60b2e24fe6be6cf53c7c04008949fde923aa..d719d4287dcfd4f2c74ff7e04f4b9cbf61803fe3 100644 (file)
@@ -125,11 +125,11 @@ class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase {
     // add softcredit details
     $totalAmount = 100;
     $financialType = 'Donation';
-    $this->clickLink('is_different_contribution_contact','total_amount',FALSE);
+    $this->clickLink('is_different_contribution_contact', 'total_amount', FALSE);
 
     $this->select('soft_credit_type_id', 'Gift');
     $this->select2('soft_credit_contact_id', $giftMembercontactName);
-    $this->select('financial_type_id','Donation');
+    $this->select('financial_type_id', 'Donation');
     $this->type('total_amount', $totalAmount);
     $this->select('payment_instrument_id', 'Check');
     $this->select('contribution_status_id', 'Completed');
@@ -198,7 +198,7 @@ class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase {
     // fill in Record Membership Payment?
     $this->click("record_contribution", "value=1");
     $this->waitForElementPresent("contribution_status_id");
-      // let financial type be default
+    // let financial type be default
 
     // let the amount be default
 
@@ -250,7 +250,7 @@ class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase {
     $test = $this;
     $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl,
       function() use ($test) {
-        $test->select('membership_type_id_0', 'value=1');
+      $test->select('membership_type_id_0', 'value=1');
       }
     );
   }
index 2ad44888c0acaf3b33bec36a042f56c93c6860af..be0068e19ee1bebed87931a6aff6348aef2af620 100644 (file)
@@ -90,8 +90,8 @@ class WebTest_Pledge_AddCancelPaymentTest extends CiviSeleniumTestCase {
 
     //Check whether the next two payments are done or not
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='View Payment']");
-    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]","Completed");
-    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[4]/td[7]","Completed");
+    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]", "Completed");
+    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[4]/td[7]", "Completed");
 
     //Cancel the contribution made for amount of 300.00
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='View Payment']");
@@ -110,15 +110,15 @@ class WebTest_Pledge_AddCancelPaymentTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]");
 
     // verify that first paayment is cancelled and the rest two payments are revert back to the pending status
-    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td[7]","Cancelled");
-    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]","Pending");
-    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[4]/td[7]","Pending");
+    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td[7]", "Cancelled");
+    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]", "Pending");
+    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[4]/td[7]", "Pending");
 
     // Check whether a new payment with pending status is added at the last or not
-    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[14]/td[7]","Pending");
+    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[14]/td[7]", "Pending");
 
     // verify that Balance sum is correct
-    $this->verifyText("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[4]","1,200.00");
+    $this->verifyText("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[4]", "1,200.00");
 
   }
 }
index 6e46a78c926705a317b63d904f0562d999f5930c..6368dc5e31a39a9d89d2dd60d2629cc98028cfa6 100644 (file)
@@ -74,7 +74,6 @@ class WebTest_Pledge_ContactContextAddTest extends CiviSeleniumTestCase {
 
     $this->select("contribution_page_id", "value=3");
 
-
     //PaymentReminders
     $this->click("PaymentReminders");
     $this->waitForElementPresent("additional_reminder_day");
index 6ed6b3c55b78229d8b9b12c152470cbf2346598e..04c2047084370ab9e5e7a94c78c336d8ce857550 100644 (file)
@@ -38,7 +38,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest
   public function testAddPledgePaymentWithAdjustPledgePaymentSchedule() {
     $this->webtestLogin();
     $this->openCiviPage('admin/setting/localization', 'reset=1');
-    $this->select("currencyLimit-f","value=FJD");
+    $this->select("currencyLimit-f", "value=FJD");
     $this->click("add");
     $this->click("_qf_Localization_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -71,18 +71,17 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest
     // check contact name on pledge form
     $this->assertElementContainsText('css=tr.crm-pledge-form-block-displayName', "$firstName $lastName");
 
-    $this->select("currency","value=FJD");
+    $this->select("currency", "value=FJD");
     $this->type("amount", "30");
     $this->type("installments", "3");
     $this->select("frequency_unit", "value=week");
     $this->type("frequency_day", "2");
 
     $this->webtestFillDate('acknowledge_date', 'now');
-        $this->select( "financial_type_id", "label=Donation");
+    $this->select( "financial_type_id", "label=Donation");
 
     $this->select("contribution_page_id", "value=3");
 
-
     //PaymentReminders
     $this->click("PaymentReminders");
     $this->waitForElementPresent("additional_reminder_day");
@@ -198,7 +197,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest
       )
     );
     $this->openCiviPage('admin/setting/localization', 'reset=1');
-    $this->select("currencyLimit-t","value=FJD");
+    $this->select("currencyLimit-t", "value=FJD");
     $this->click("remove");
     $this->click("_qf_Localization_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -245,8 +244,6 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest
 
     $this->select("contribution_page_id", "value=3");
 
-
-
     //PaymentReminders
     $this->click("PaymentReminders");
     $this->waitForElementPresent("additional_reminder_day");
@@ -392,7 +389,6 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest
 
     $this->select("contribution_page_id", "value=3");
 
-
     //PaymentReminders
     $this->click("PaymentReminders");
     $this->waitForElementPresent("additional_reminder_day");
index a6f79baa7ec6b99941d6a539b98ca5fd51753a07..5e1d40f333deb686d0611f5a2c325bb8ad2295e1 100644 (file)
@@ -125,14 +125,14 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase {
     $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]");
 
-    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]","Pending");
+    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]", "Pending");
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td");
 
     // verify that payment owed amount is correct (250.00)
-    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td","250.00");
+    $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td", "250.00");
     // verify that Total Paid and Balance sums are correct
-    $this->verifyText("xpath=//div[@class='view-content' and contains(., 'view pledge payments')]/table[@class='selector row-highlight']//tbody/tr[1]/td[3]","470.00");
-    $this->verifyText("xpath=//div[@class='view-content' and contains(., 'view pledge payments')]/table[@class='selector row-highlight']//tbody/tr[1]/td[4]","1,930.00");
+    $this->verifyText("xpath=//div[@class='view-content' and contains(., 'view pledge payments')]/table[@class='selector row-highlight']//tbody/tr[1]/td[3]", "470.00");
+    $this->verifyText("xpath=//div[@class='view-content' and contains(., 'view pledge payments')]/table[@class='selector row-highlight']//tbody/tr[1]/td[4]", "1,930.00");
 
   }
 }
index 1af63905b493da15523afddef89f0e8170def0c2..517c0e9cc85b3137f6467a39ef3852ca0229b237 100644 (file)
@@ -52,7 +52,6 @@ class WebTest_Pledge_StandaloneAddTest extends CiviSeleniumTestCase {
 
     $this->select('contribution_page_id', 'value=3');
 
-
     //PaymentReminders
     $this->click('PaymentReminders');
     $this->waitForElementPresent('additional_reminder_day');
index d2ebb6b7fc98443c0039e1fc32dd7fb0579c12b8..742014dc8d2b66ef524e15002e634821b13619b0 100644 (file)
@@ -380,14 +380,14 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase {
       $this->type('first_name', $params['firstname']);
       $params['lastname'] = 'Anderson' . substr(sha1(rand()), 0, 3);
       $this->type('last_name', $params['lastname']);
-      $params['email'] =  $params['firstname'].$params['lastname'].'@exa.com';
+      $params['email'] = $params['firstname'].$params['lastname'].'@exa.com';
       $this->type('email-Primary', $params['email']);
       $this->waitForElementPresent("//div[@id='crm-profile-block']//div/div[2]/select");
-      $this->select("//div[@id='crm-profile-block']//div/div[2]/select",'value=1');
+      $this->select("//div[@id='crm-profile-block']//div/div[2]/select", 'value=1');
     }
     else {
       $this->waitForElementPresent("//div[@id='crm-profile-block']//div/div[2]/select");
-      $this->select("//div[@id='crm-profile-block']//div/div[2]/select",'value=1');
+      $this->select("//div[@id='crm-profile-block']//div/div[2]/select", 'value=1');
 
     }
     if ($dialog) {
index ef03f5be42ef8e4261efbe9d21db3d3f4332809d..feff9842b5b73bfbabaf62e5dbc02dc2540dd763 100644 (file)
@@ -103,7 +103,6 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase {
 
     $gid = $this->urlArg('gid');
 
-
     //Add field to profile
     $this->waitForElementPresent("field_name[0]");
     $this->click('field_name[0]');
@@ -130,7 +129,7 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase {
     $groupName = 'group_' . substr(sha1(rand()), 0, 7);
     $this->WebtestAddGroup($groupName);
 
-     // Add new profile.
+    // Add new profile.
     $this->openCiviPage('admin/uf/group', 'reset=1');
 
     $this->click('newCiviCRMProfile-top');
index 6f666c5a85adbbfcaf6d046e9bf9f03e543096f3..074bc5b07e290b1d78b687a627e64ea8368fe806 100644 (file)
@@ -54,7 +54,6 @@ class WebTest_Profile_ProfileCountryState extends CiviSeleniumTestCase {
     $this->click('_qf_Group_next');
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-
     //check for  profile create
     $this->waitForText('crm-notification-container', "Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
     $gid = $this->urlArg('gid');
@@ -102,7 +101,7 @@ class WebTest_Profile_ProfileCountryState extends CiviSeleniumTestCase {
           $this->click("//option[@value='$countryID']");
           $this->click("xpath=//tr[@class='crm-localization-form-block-provinceLimit']/td[2]/table//tbody/tr/td[2]/input[@name='add']");
         }
-        $added = true;
+        $added = TRUE;
       }
       if ($added) {
         $this->click("_qf_Localization_next-bottom");
@@ -130,16 +129,16 @@ class WebTest_Profile_ProfileCountryState extends CiviSeleniumTestCase {
       $this->openCiviPage("admin/setting/localization", "reset=1", "_qf_Localization_next-bottom");
       $enabledCountries = $this->getSelectOptions("countryLimit-t");
       $enabledStates = $this->getSelectOptions("provinceLimit-t");
-      $removed = false;
+      $removed = FALSE;
       foreach($newCountry as $countryID => $countryName) {
-          $this->addSelection("countryLimit-t", "label=$countryName");
-          $this->click("xpath=//select[@id='countryLimit-t']/option[@value='$countryID']");
-          $this->click("xpath=//tr[@class='crm-localization-form-block-countryLimit']/td[2]/table//tbody/tr/td[2]/input[@name='remove']");
-
-          $this->addSelection("provinceLimit-t", "label=$countryName");
-          $this->click("//option[@value='$countryID']");
-          $this->click("xpath=//tr[@class='crm-localization-form-block-provinceLimit']/td[2]/table//tbody/tr/td[2]/input[@name='remove']");
-          $removed = true;
+        $this->addSelection("countryLimit-t", "label=$countryName");
+        $this->click("xpath=//select[@id='countryLimit-t']/option[@value='$countryID']");
+        $this->click("xpath=//tr[@class='crm-localization-form-block-countryLimit']/td[2]/table//tbody/tr/td[2]/input[@name='remove']");
+
+        $this->addSelection("provinceLimit-t", "label=$countryName");
+        $this->click("//option[@value='$countryID']");
+        $this->click("xpath=//tr[@class='crm-localization-form-block-provinceLimit']/td[2]/table//tbody/tr/td[2]/input[@name='remove']");
+        $removed = TRUE;
       }
       if ($removed) {
         $this->click("_qf_Localization_next-bottom");
index d553ea4e72d917ba7650fd49c0152f300ecfb5db..8ea217b0caaad2876447139472e28231c2d9aa95 100644 (file)
@@ -120,7 +120,6 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase
 
     $this->click('_qf_Edit_next');
 
-
     // assert for subscription message
 
     $this->isTextPresent("Your subscription request has been submitted for");
index a2fa2f12734c7dbe617a6abc9be7aab0cc1f3afd..8a16a97e409cb14b86334247731da3d260f1897e 100644 (file)
@@ -50,8 +50,7 @@ class WebTest_Release_ReleaseTestCase extends CiviSeleniumTestCase {
    * @param string $dataName
    * @param array $browser
    */
-  function __construct($name = NULL, array$data = array(
-    ), $dataName = '', array$browser = array()) {
+  function __construct($name = NULL, array$data = array(), $dataName = '', array$browser = array()) {
     parent::__construct($name, $data, $dataName, $browser);
 
     require_once 'CiviTest/ReleaseTestSettings.php';
index da7c75656e234834969eafc36cdf6f4e043afd18..78ed4ce90085ec4840c0b15e65adcde4389f0e89 100644 (file)
@@ -139,7 +139,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase {
     $this->click("xpath=//div[@id='Contact']//table/tbody//tr/td/a/strong[text() = '$reportName']");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-   // Is filter statistics present?
+    // Is filter statistics present?
     $this->assertElementContainsText("xpath=//tr/th[@class='statistics'][text()='Contact Name']/../td", "Contains $firstName", "Statistics did not found!");
 
     // Is Contact Name present in result?
index febed4d7a342bbcbc3da49a1fdc6ba6cb65f8cae..766013bdcb0571c130874209480e219ac0911df9 100644 (file)
@@ -150,7 +150,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[8]/span/a[2]");
     $this->click("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[8]/span/a[2]");
     $this->waitForElementPresent("_qf_Activity_cancel-bottom");
-    $this->select("status_id","value=2");
+    $this->select("status_id", "value=2");
     $this->click('_qf_Activity_upload-bottom');
     $this->waitForText("crm-notification-container", "Activity has been saved.");
     $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[7][text()='Completed']");
@@ -161,15 +161,15 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("xpath=//div[@class='view-content']//div[@class='action-link']/a");
     $this->click("xpath=//div[@class='view-content']//div[@class='action-link']/a");
     $this->waitForElementPresent("_qf_Case_cancel-bottom");
-    $this->type('activity_subject',"subject".rand());
-    $this->select('case_type_id','value=1');
+    $this->type('activity_subject', "subject".rand());
+    $this->select('case_type_id', 'value=1');
     $this->click('_qf_Case_upload-bottom');
     $this->waitForElementPresent("xpath=//form[@id='Search']/div[2]/div/table/tbody/tr[2]/td[9]/span[1]/a[1][text()='Manage']");
     $this->click("xpath=//form[@id='Search']/div[2]/div/table/tbody/tr[2]/td[9]/span[1]/a[1][text()='Manage']");
     $this->waitForElementPresent("xpath=//form[@id='CaseView']/div[2]/table/tbody/tr/td[4]/a");
     $this->click("xpath=//form[@id='CaseView']/div[2]/table/tbody/tr/td[4]/a");
     $this->waitForElementPresent("_qf_Activity_cancel-bottom");
-    $this->select("case_status_id","value=2");
+    $this->select("case_status_id", "value=2");
     $this->click("_qf_Activity_upload-top");
     $this->waitForElementPresent("_qf_CaseView_cancel-bottom");
     $this->click("_qf_CaseView_cancel-bottom");
@@ -310,17 +310,17 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
         }
       }
 
-    //visit the logging contact summary report
-    $this->openCiviPage('report/logging/contact/summary', 'reset=1');
-    foreach ($filters as $type => $filter) {
-      if ($type == 'text' ) {
-        foreach ($filter as $filterName => $filterValue) {
-          $this->type($filterName, $filterValue);
+      //visit the logging contact summary report
+      $this->openCiviPage('report/logging/contact/summary', 'reset=1');
+      foreach ($filters as $type => $filter) {
+        if ($type == 'text' ) {
+          foreach ($filter as $filterName => $filterValue) {
+            $this->type($filterName, $filterValue);
+          }
         }
       }
-    }
-    $this->click("_qf_LoggingSummary_submit");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+      $this->click("_qf_LoggingSummary_submit");
+      $this->waitForPageToLoad($this->getTimeoutMsec());
     }
   }
 }
index 3a68ce01b812119b32e8ae05b0df3d90ff0bfaaa..4dd7ef511e8f1230718a4f299b9545e6d1dc76d4 100644 (file)
@@ -31,8 +31,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * This class is intended to test ACL permission using the multisite module
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Contact
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contact
  */
 
 class api_v3_ACLCachingTest extends CiviUnitTestCase {
@@ -44,10 +44,10 @@ class api_v3_ACLCachingTest extends CiviUnitTestCase {
   public function setUp() {
     parent::setUp();
   }
-/**
- * (non-PHPdoc)
- * @see CiviUnitTestCase::tearDown()
- */
+  /**
  * (non-PHPdoc)
  * @see CiviUnitTestCase::tearDown()
  */
   public function tearDown() {
     $tablesToTruncate = array(
       'civicrm_activity',
@@ -56,7 +56,7 @@ class api_v3_ACLCachingTest extends CiviUnitTestCase {
   }
 
   public function testActivityCreateCustomBefore() {
-    $values = $this->callAPISuccess('custom_field', 'getoptions', array('field' => 'custom_group_id',));
+    $values = $this->callAPISuccess('custom_field', 'getoptions', array('field' => 'custom_group_id'));
     $this->assertTrue($values['count'] == 0);
     $this->CustomGroupCreate(array('extends' => 'Activity'));
     $groupCount = $this->callAPISuccess('custom_group', 'getcount', array('extends' => 'activity'));
index 3d22cc196a277b8700f8213082e693ebf203e107..d695ed106d6dc8c0a5d56d67e97cc189380173e6 100644 (file)
@@ -302,7 +302,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase {
    * @return array
    */
   public static function entities() {
-    return array(array('contribution'), array('participant'),);// @todo array('pledge' => 'pledge')
+    return array(array('contribution'), array('participant'));// @todo array('pledge' => 'pledge')
   }
 
   /**
index ef2cd3e9c64e4b4bcfb01cadbeb86d0254d1e44e..ea364ba65baeb7a6d65f82cb81c6dcb863656c78 100644 (file)
@@ -6,11 +6,11 @@
  *
  *  (PHP 5)
  *
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id:
- *   @package   CiviCRM
+ * @version   $Id:
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -37,8 +37,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_activity_* functions
  *
- *  @package CiviCRM_APIv3
- *  @todo determine where help functions should sit (here or 'up the tree'), & best way to define API dir
+ * @package CiviCRM_APIv3
+ * @todo determine where help functions should sit (here or 'up the tree'), & best way to define API dir
  */
 class api_v3_APIStandardsTest extends CiviUnitTestCase {
 
index f043e92c7dda837ad16039d901e53414894d83da..dc29ed34c73175b5edd133555f65415b2b2334b8 100644 (file)
@@ -31,12 +31,12 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for API functions
  *
- *  @package CiviCRM_APIv3
+ * @package CiviCRM_APIv3
  */
 class api_v3_APITest extends CiviUnitTestCase {
   public $DBResetRequired = FALSE;
 
-  protected $_apiversion =3;
+  protected $_apiversion = 3;
 
   public function testAPIReplaceVariables() {
     $result = array();
@@ -73,7 +73,6 @@ class api_v3_APITest extends CiviUnitTestCase {
     */
   public function testAPIWrapperIncludeNoFile() {
 
-
     $result = $this->callAPIFailure('RandomFile', 'get', array(), 'API (RandomFile,get) does not exist (join the API team and implement it!)');
   }
 
@@ -132,9 +131,9 @@ class api_v3_APITest extends CiviUnitTestCase {
       $this->assertEquals($expected, $actual, sprintf('input=%s expected=%s actual=%s', $input, $expected, $actual));
     }
   }
-/**
- * Test that calling via wrapper works
- */
+  /**
  * Test that calling via wrapper works
  */
   public function testv3Wrapper() {
     try{
       $result = civicrm_api3('contact', 'get', array());
index 080e988ea194adaf18eaf391f4d6109833b216f0..63536847e4a4ebc8c6e83a5f5062e219cbe67020 100644 (file)
@@ -28,8 +28,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_action_schedule functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_ActionSchedule
+ * @package CiviCRM_APIv3
+ * @subpackage API_ActionSchedule
  */
 
 class api_v3_ActionScheduleTest extends CiviUnitTestCase {
@@ -76,7 +76,7 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase {
     $this->assertTrue(is_numeric($actionSchedule['id']), "In line " . __LINE__);
     $this->assertTrue($actionSchedule['id'] > 0, "In line " . __LINE__);
     $newCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule');
-    $this->assertEquals($oldCount+1, $newCount);
+    $this->assertEquals($oldCount + 1, $newCount);
   }
 
   /**
@@ -113,7 +113,7 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase {
       'start_action_condition' => 'before',
       'start_action_date' => 'activity_date_time',
       'is_repeat' => 1,
-      'repetition_frequency_unit'=> 'day',
+      'repetition_frequency_unit' => 'day',
       'repetition_frequency_interval' => 3,
       'end_frequency_unit' => 'hour',
       'end_frequency_interval' => 0,
@@ -127,7 +127,7 @@ class api_v3_ActionScheduleTest extends CiviUnitTestCase {
     $this->assertTrue($actionSchedule['id'] > 0, "In line " . __LINE__);
     $this->assertEquals($actionSchedule['values'][$actionSchedule['id']]['start_action_offset'][0], $params['start_action_offset']);
     $newCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_action_schedule');
-    $this->assertEquals($oldCount+1, $newCount);
+    $this->assertEquals($oldCount + 1, $newCount);
 
   }
 
index fffac72874b38a9aa9df3d645ae5044a8621a8e9..7ed66e4817664ad89514754edfd23ec9ae9db32a 100644 (file)
@@ -32,8 +32,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_activity_contact* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Activity
+ * @package CiviCRM_APIv3
+ * @subpackage API_Activity
  */
 class api_v3_ActivityContactTest extends CiviUnitTestCase {
   protected $_apiversion;
@@ -71,7 +71,7 @@ class api_v3_ActivityContactTest extends CiviUnitTestCase {
     //create one
     $create = $this->callAPISuccess('activity_contact', 'create', $this->_params);
 
-    $result = $this->callAPIAndDocument('activity_contact', 'delete', array('id' => $create['id'],), __FUNCTION__, __FILE__);
+    $result = $this->callAPIAndDocument('activity_contact', 'delete', array('id' => $create['id']), __FUNCTION__, __FILE__);
     $this->assertEquals(1, $result['count']);
     $get = $this->callAPISuccess('activity_contact', 'get', array(
       'id' => $create['id'],
index 692001ffc45e1385c9c7b8470969ffb5e3ba1cb2..c09d83240f445909d3459d9b1f82c60feeb103d4 100644 (file)
@@ -4,12 +4,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: ActivityTest.php 31254 2010-12-15 10:09:29Z eileen $
- *   @package   CiviCRM
+ * @version   $Id: ActivityTest.php 31254 2010-12-15 10:09:29Z eileen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -37,8 +37,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_activity_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Activity
+ * @package CiviCRM_APIv3
+ * @subpackage API_Activity
  */
 
 class api_v3_ActivityTest extends CiviUnitTestCase {
@@ -457,7 +457,6 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
    */
   public function testActivityCreateTextStatus() {
 
-
     $params = array(
       'source_contact_id' => $this->_contactID,
       'subject' => 'Make-it-Happen Meeting',
@@ -496,11 +495,12 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
 
     $contact = $this->callAPISuccess('Contact', 'Create', array(
                  'first_name' => "The Rock",
-                 'last_name' =>'roccky',
+                 'last_name' => 'roccky',
                  'contact_type' => 'Individual',
                  'version' => 3,
                  'api.activity.create' => array(
-                   'id' => $activity['id'], 'assignee_contact_id' => '$value.id',
+                   'id' => $activity['id'],
+    'assignee_contact_id' => '$value.id',
                  ),
                ));
 
@@ -580,11 +580,11 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
     $params['target_contact_id'] = array($contact2 => $contact2);
     $activity = $this->callAPISuccess('Activity', 'Create', $params);
 
-    $activityget   = $this->callAPISuccess('Activity', 'get', array('id' => $activity['id'], 'target_contact_id' => $contact2,'return.target_contact_id' => 1));
+    $activityget   = $this->callAPISuccess('Activity', 'get', array('id' => $activity['id'], 'target_contact_id' => $contact2, 'return.target_contact_id' => 1));
     $this->assertEquals($activity['id'], $activityget['id'], 'In line ' . __LINE__);
     $this->assertEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0], 'In line ' . __LINE__);
 
-    $activityget   = $this->callAPISuccess('activity', 'get', array('target_contact_id' => $this->_contactID,'return.target_contact_id' => 1,'id' => $activity['id']));
+    $activityget   = $this->callAPISuccess('activity', 'get', array('target_contact_id' => $this->_contactID, 'return.target_contact_id' => 1, 'id' => $activity['id']));
     if ($activityget['count'] > 0) {
       $this->assertNotEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0], 'In line ' . __LINE__);
     }
@@ -619,7 +619,6 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
                 'status_id' => '2'));
     $this->assertEquals(0, $result['count'], 'No activities of status 1 should exist');
 
-
   }
 
   /*
@@ -936,7 +935,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
       'version' => $this->_apiversion,
       'id' => $activityId,
     );
-    $result = $this->callAPISuccess($this->_entity, 'get',$getParams );
+    $result = $this->callAPISuccess($this->_entity, 'get', $getParams );
     $assignee = $result['values'][$result['id']]['assignee_contact_id'];
     $target = $result['values'][$result['id']]['target_contact_id'];
     $this->assertEquals(2, count($assignee), ' in line ' . __LINE__);
index 355967b78b877ace98632c1bbbd49db4c4568a64..927ff42ea23c024f5a6c94d93538b18b43d67b6c 100644 (file)
@@ -5,7 +5,7 @@
  *
  *  (PHP 5)
  *
- *   @package   CiviCRM
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -29,8 +29,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_activity_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Activity
+ * @package CiviCRM_APIv3
+ * @subpackage API_Activity
  */
 
 class api_v3_ActivityTypeTest extends CiviUnitTestCase {
index 1f00f7cd58b7183e104265e832942c543acfcd52..6abce24415ba48498f2383a77899f2204136adcb 100644 (file)
@@ -28,8 +28,8 @@
 /**
  *  Test APIv3 civicrm_activity_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Contact
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contact
  */
 
 require_once 'CiviTest/CiviUnitTestCase.php';
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  * Class api_v3_AddressTest
  */
 class api_v3_AddressTest extends CiviUnitTestCase {
-  protected $_apiversion =3;
+  protected $_apiversion = 3;
   protected $_contactID;
   protected $_locationType;
   protected $_params;
@@ -131,8 +131,8 @@ class api_v3_AddressTest extends CiviUnitTestCase {
   }
 
   /**
- * Create an address with a master ID and ensure that a relationship is created
- */
  * Create an address with a master ID and ensure that a relationship is created
  */
   public function testCreateAddressWithMasterRelationshipOrganization() {
     $address = $this->callAPISuccess('address', 'create', $this->_params);
     $individualID = $this->individualCreate();
@@ -160,7 +160,7 @@ class api_v3_AddressTest extends CiviUnitTestCase {
     $individualParams['master_id'] = $address2['id'];
     $individualParams['id'] = $individualAddress['id'];
     $this->callAPISuccess('address', 'create', $individualParams);
-    $this->callAPISuccessGetCount('relationship', array('contact_id_a' => $individualID,), 2);
+    $this->callAPISuccessGetCount('relationship', array('contact_id_a' => $individualID), 2);
     $this->markTestIncomplete('Remainder of test checks that employer relationship is disabled when new one is created but turns out to be not happening - by design?');
     $this->callAPISuccessGetCount('relationship', array('contact_id_a' => $individualID, 'is_active' => FALSE), 1);
     $this->callAPISuccessGetCount('relationship', array('contact_id_a' => $individualID, 'is_active' => TRUE, 'contact_id_b' => $organisation2ID), 1);
@@ -198,7 +198,7 @@ class api_v3_AddressTest extends CiviUnitTestCase {
     //create one
     $create = $this->callAPISuccess('address', 'create', $this->_params);
 
-    $result = $this->callAPIAndDocument('address', 'delete', array('id' => $create['id'],), __FUNCTION__, __FILE__);
+    $result = $this->callAPIAndDocument('address', 'delete', array('id' => $create['id']), __FUNCTION__, __FILE__);
     $this->assertEquals(1, $result['count'], 'In line ' . __LINE__);
     $get = $this->callAPISuccess('address', 'get', array(
      'location_type_id' => $this->_locationType->id,
@@ -264,7 +264,8 @@ class api_v3_AddressTest extends CiviUnitTestCase {
     $this->callAPISuccess('address', 'create', $this->_params);
     $subfile     = "AddressLike";
     $description = "Demonstrates Use of Like";
-    $params      = array('street_address' => array('LIKE' => '%mb%'),
+    $params      = array(
+    'street_address' => array('LIKE' => '%mb%'),
       'sequential' => 1,
     );
     $result = $this->callAPIAndDocument('Address', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile);
index af92f1b55b339d795b30ccebd456a838eec0a996..65da48f3ee945031b166bf9f6051951800985142 100644 (file)
@@ -6,12 +6,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: AllTests.php 31254 2010-12-15 10:09:29Z eileen $
- *   @package   CiviCRM
+ * @version   $Id: AllTests.php 31254 2010-12-15 10:09:29Z eileen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -38,7 +38,7 @@ require_once 'CiviTest/CiviTestSuite.php';
 /**
  *  Class containing all API v3 test suites
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class api_v3_AllTests extends CiviTestSuite {
   private static $instance = NULL;
index fd65aa1b3edfe5d12b94118e0e83c9313eeab691..80b204e4e3614782d86775b0c9c7134daf454d73 100644 (file)
@@ -30,7 +30,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for Batch API - civicrm_batch_*
  *
- *  @package CiviCRM_APIv3
+ * @package CiviCRM_APIv3
  */
 class api_v3_BatchTest extends CiviUnitTestCase {
 
index fc94e968456c74bad2058ee57c588fb8f07d9833..2fecf4f014ed70b9d55e5b86661acecba03f1761 100644 (file)
@@ -9,7 +9,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_activity_* functions
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class api_v3_CRM11793Test extends CiviUnitTestCase {
 
index b52f1fce7e43be02c14437cba9da531c698d2fa6..9a85228a5702a5bea9e4445d4e7ec0c449c72e9f 100644 (file)
@@ -4,12 +4,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: ActivityTest.php 31254 2010-12-15 10:09:29Z eileen $
- *   @package   CiviCRM
+ * @version   $Id: ActivityTest.php 31254 2010-12-15 10:09:29Z eileen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -36,12 +36,12 @@ require_once 'CiviTest/CiviCaseTestCase.php';
 /**
  *  Test APIv3 civicrm_case_* functions
  *
- *  @package CiviCRM_APIv3
+ * @package CiviCRM_APIv3
  */
 class api_v3_CaseTest extends CiviCaseTestCase {
   protected $_params;
   protected $_entity;
-  protected $_apiversion =3;
+  protected $_apiversion = 3;
   protected $followup_activity_type_value;
 
   /**
index 73d50b6e70380542fd4ebb1db5666329d7245d2a..764dacff127a43de3c58f1a12332744ac74d80c2 100644 (file)
@@ -138,7 +138,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase {
    */
   public function testCaseTypeUpdate() {
     // Create Case Type
-    $params =  array(
+    $params = array(
       'title' => 'Application',
       'name' => 'Application',
       'is_active' => 1,
@@ -164,7 +164,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase {
    */
   public function testCaseTypeDelete_New() {
     // Create Case Type
-    $params =  array(
+    $params = array(
       'title' => 'Application',
       'name' => 'Application',
       'is_active' => 1,
index 07b23983ee2db746c81c7fefb36bf9d9bd51a8d5..baa5501acb0e3a3801ed616479990d25e5aacd0e 100644 (file)
@@ -4,13 +4,13 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: ConstantTest.php 31254 2010-12-15 10:09:29Z eileen $
- *   @package CiviCRM_APIv3
- *   @subpackage API_Constant
+ * @version   $Id: ConstantTest.php 31254 2010-12-15 10:09:29Z eileen $
+ * @package CiviCRM_APIv3
+ * @subpackage API_Constant
  *
  *   This file is part of CiviCRM
  *
@@ -37,8 +37,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_activity_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Constant
+ * @package CiviCRM_APIv3
+ * @subpackage API_Constant
  */
 class api_v3_ConstantTest extends CiviUnitTestCase {
   protected $_apiversion = 3;
index 67b54d7a49e1ea1f3fa7eedf984e4362409ed8e1..713b33e5c0ba34aff4a0531b8f9670c457f0add0 100644 (file)
@@ -4,12 +4,12 @@
  *
  *  (PHP 5)
  *
- *   @author Walt Haas <walt@dharmatech.org> (801) 534-1262
- *   @copyright Copyright CiviCRM LLC (C) 2009
- *   @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
+ * @author Walt Haas <walt@dharmatech.org> (801) 534-1262
+ * @copyright Copyright CiviCRM LLC (C) 2009
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html
  *              GNU Affero General Public License version 3
- *   @version   $Id: ContactTest.php 31254 2010-12-15 10:09:29Z eileen $
- *   @package   CiviCRM
+ * @version   $Id: ContactTest.php 31254 2010-12-15 10:09:29Z eileen $
+ * @package   CiviCRM
  *
  *   This file is part of CiviCRM
  *
@@ -37,8 +37,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_contact* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Contact
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contact
  */
 
 class api_v3_ContactTest extends CiviUnitTestCase {
@@ -48,7 +48,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
   protected $_params;
 
   protected $_contactID;
-  protected $_financialTypeId =1;
+  protected $_financialTypeId = 1;
 
   /**
    *  Test setup for every test
@@ -102,7 +102,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     $this->assertTrue(is_numeric($contact['id']), "In line " . __LINE__);
     $this->assertTrue($contact['id'] > 0, "In line " . __LINE__);
     $newCount = CRM_Core_DAO::singleValueQuery('select count(*) from civicrm_contact');
-    $this->assertEquals($oldCount+1, $newCount);
+    $this->assertEquals($oldCount + 1, $newCount);
 
     $this->assertDBState('CRM_Contact_DAO_Contact',
       $contact['id'],
@@ -152,7 +152,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
       'email' => 'man1@yahoo.com',
       'contact_type' => 'Does not Exist',
     );
-    $this->callAPIFailure('contact', 'create', $params,"'Does not Exist' is not a valid option for field contact_type");
+    $this->callAPIFailure('contact', 'create', $params, "'Does not Exist' is not a valid option for field contact_type");
   }
 
   /**
@@ -361,7 +361,8 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     ));
     // do it again as an update to check it doesn't cause an error
     $employerResult = $this->callAPISuccess('contact', 'create', array_merge($this->_params, array(
-        'current_employer' => 'new employer org', 'id' => $employerResult['id'])
+        'current_employer' => 'new employer org',
+    'id' => $employerResult['id'])
     ));
     $expectedCount = 1;
     $this->callAPISuccess('contact', 'getcount', array(
@@ -386,25 +387,26 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     $employerResult = $this->callAPISuccess('contact', 'create', array_merge($this->_params, array(
         'current_employer' => 'new employer org',)
     ));
-    $relationship = $this->callAPISuccess('relationship','get', array(
+    $relationship = $this->callAPISuccess('relationship', 'get', array(
       'contact_id_a' => $employerResult['id'],
-   ));
+    ));
 
     //disable & check it is disabled
     $this->callAPISuccess('relationship', 'create', array('id' => $relationship['id'], 'is_active' => 0));
-    $this->callAPISuccess('relationship','getvalue', array(
+    $this->callAPISuccess('relationship', 'getvalue', array(
       'id' => $relationship['id'],
       'return' => 'is_active'
     ), 0);
 
     //re-set the current employer - thus enabling the relationshp
     $this->callAPISuccess('contact', 'create', array_merge($this->_params, array(
-        'current_employer' => 'new employer org', 'id' => $employerResult['id'])
+        'current_employer' => 'new employer org',
+    'id' => $employerResult['id'])
     ));
     //check is_active is now 1
-   $relationship = $this->callAPISuccess('relationship','getsingle', array(
+    $relationship = $this->callAPISuccess('relationship', 'getsingle', array(
      'return' => 'is_active',));
-   $this->assertEquals(1, $relationship['is_active']);
+    $this->assertEquals(1, $relationship['is_active']);
   }
 
   /**
@@ -625,18 +627,21 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     $this->callAPISuccess('contact', 'get', $params);
 
     // testing as string
-    $params = array('filter.group_id' => array($groupId, 26),
+    $params = array(
+    'filter.group_id' => array($groupId, 26),
       'contact_type' => 'Individual',
     );
     $result = $this->callAPIAndDocument('contact', 'get', $params, __FUNCTION__, __FILE__, $description, $subFile);
     $this->assertEquals(1, $result['count']);
 
     //test in conjunction with other criteria
-      $params = array('filter.group_id' => array($groupId, 26),
+    $params = array(
+    'filter.group_id' => array($groupId, 26),
       'contact_type' => 'Organization',
     );
-   $this->callAPISuccess('contact', 'get', $params);
-    $params = array('filter.group_id' => array(26, 27),
+    $this->callAPISuccess('contact', 'get', $params);
+    $params = array(
+    'filter.group_id' => array(26, 27),
       'contact_type' => 'Individual',
     );
     $result = $this->callAPISuccess('contact', 'get', $params);
@@ -810,7 +815,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
         'is_active' => 1,
         'relationship_type_id' => $relTypeId,
       ));
-   }
+    }
 
     // Add second employer
     $params['employer_id'] = $employer2;
@@ -983,8 +988,6 @@ class api_v3_ContactTest extends CiviUnitTestCase {
       )
     );
 
-
-
     $params = array(
       'id' => 23,
       'first_name' => 'abcd',
@@ -1278,7 +1281,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     $extraParams = array('nick_name' => 'Bob', 'phone' => '456', 'email' => 'e@mail.com');
     $contactID = $this->individualCreate($extraParams);
     //actually it turns out the above doesn't create a phone
-    $this->callAPISuccess('phone', 'create', array('contact_id' => $contactID, 'phone' => '456',));
+    $this->callAPISuccess('phone', 'create', array('contact_id' => $contactID, 'phone' => '456'));
     $result = $this->callAPISuccess('contact', 'getsingle', array('id' => $contactID));
     foreach ($extraParams as $key => $value) {
       $this->assertEquals($result[$key], $value);
@@ -1364,7 +1367,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
       'api.contribution.create.1' => array(
         'receive_date' => '2011-01-01',
         'total_amount' => 120.00,
-        'financial_type_id' => $this->_financialTypeId =1,
+        'financial_type_id' => $this->_financialTypeId = 1,
         'payment_instrument_id' => 1,
         'non_deductible_amount' => 10.00,
         'fee_amount' => 50.00,
@@ -1442,7 +1445,6 @@ class api_v3_ContactTest extends CiviUnitTestCase {
       ),
     );
 
-
     $result = $this->callAPISuccess('Contact', 'create', $params);
     $params = array(
       'id' => $result['id'],
@@ -1512,10 +1514,12 @@ class api_v3_ContactTest extends CiviUnitTestCase {
       'custom_' . $andmoreids['custom_field_id'][1] => "vegemite",
     );
 
-
     $result = $this->callAPISuccess('Contact', 'create', $params);
     $result = $this->callAPISuccess('Contact', 'create', array(
-      'contact_type' => 'Individual', 'id' => $result['id'], 'custom_' . $moreids['custom_field_id'][0] => "value 3", 'custom_' . $ids['custom_field_id'] => "value 4",
+      'contact_type' => 'Individual',
+    'id' => $result['id'], 'custom_' .
+    $moreids['custom_field_id'][0] => "value 3", 'custom_' .
+    $ids['custom_field_id'] => "value 4",
       ));
 
     $params = array(
@@ -1541,7 +1545,8 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     2 child functions - one receives values from the parent (Contact) and the other child (Tag). ";
     $subfile = "APIChainedArrayValuesFromSiblingFunction";
     $params = array(
-      'display_name' => 'batman', 'contact_type' => 'Individual',
+      'display_name' => 'batman',
+    'contact_type' => 'Individual',
       'api.tag.create' => array('name' => '$value.id', 'description' => '$value.display_name', 'format.only_id' => 1),
       'api.entity_tag.create' => array('tag_id' => '$value.api.tag.create'),
     );
@@ -1635,7 +1640,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
     /* it will be ignored if there is not exactly 1 result";
     $subFile = "FormatSingleValue";
     $params  = array('id' => 17, 'return' => 'display_name');
-    $result  = $this->callAPIAndDocument('Contact', 'getvalue', $params, __FUNCTION__, __FILE__, $description, $subFile,'getvalue');
+    $result  = $this->callAPIAndDocument('Contact', 'getvalue', $params, __FUNCTION__, __FILE__, $description, $subFile, 'getvalue');
     $this->assertEquals('Test Contact', $result);
     $this->callAPISuccess('Contact', 'Delete', $params);
   }
@@ -1645,7 +1650,8 @@ class api_v3_ContactTest extends CiviUnitTestCase {
    */
   public function testContactCreationPermissions() {
     $params = array(
-      'contact_type' => 'Individual', 'first_name' => 'Foo',
+      'contact_type' => 'Individual',
+    'first_name' => 'Foo',
       'last_name' => 'Bear',
       'check_permissions' => TRUE,
     );
@@ -1659,10 +1665,10 @@ class api_v3_ContactTest extends CiviUnitTestCase {
   }
 
   public function testContactUpdatePermissions() {
-    $params = array('contact_type' => 'Individual', 'first_name' => 'Foo', 'last_name' => 'Bear', 'check_permissions' => TRUE,);
+    $params = array('contact_type' => 'Individual', 'first_name' => 'Foo', 'last_name' => 'Bear', 'check_permissions' => TRUE);
     $result = $this->callAPISuccess('contact', 'create', $params);
     $config = CRM_Core_Config::singleton();
-    $params = array('id' => $result['id'], 'contact_type' => 'Individual', 'last_name' => 'Bar', 'check_permissions' => TRUE,);
+    $params = array('id' => $result['id'], 'contact_type' => 'Individual', 'last_name' => 'Bar', 'check_permissions' => TRUE);
 
     $config->userPermissionClass->permissions = array('access CiviCRM');
     $result = $this->callAPIFailure('contact', 'update', $params);
@@ -1840,7 +1846,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
   public function testReturnCityProfile () {
     $contactID = $this->individualCreate();
     CRM_Core_Config::singleton()->defaultSearchProfileID = 1;
-    $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1,));
+    $this->callAPISuccess('address', 'create', array('contact_id' => $contactID, 'city' => 'Cool City', 'location_type_id' => 1));
     $result = $this->callAPISuccess('contact', 'get', array('city' => 'Cool City', 'return' => 'contact_type'));
     $this->assertEquals(1, $result['count']);
   }
index 4bbf74403341dc514b925c5f2718d27ed9b02f35..fc068c3b398a15d85f6092f0337e3cbbb776b173 100644 (file)
@@ -302,7 +302,6 @@ class api_v3_ContactTypeTest extends CiviUnitTestCase {
     $this->assertEquals(end($result['contact_sub_type']), $updateParams['contact_sub_type'], "In line " . __LINE__);
     $this->callAPISuccess('contact', 'delete', $params);
 
-
     $params = array(
       'label' => 'sub2_organization',
       'name' => 'sub2_organization',
index a73de2517fb67000355b847f48b12d18f01f0909..12c05dbf8584f39bd30d7862ff3c13b8e11dd3db 100644 (file)
@@ -31,8 +31,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_contribute_recur* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Contribution
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contribution
  */
 
 class api_v3_ContributionPageTest extends CiviUnitTestCase {
@@ -42,7 +42,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
   protected $id = 0;
   protected $contactIds = array();
   protected $_entity = 'contribution_page';
-  protected $contribution_result = null;
+  protected $contribution_result = NULL;
   protected $_priceSetParams = array();
   /**
    * Payment processor details
@@ -211,7 +211,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     );
 
     $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL, 'Submit');
-    $contributions = $this->callAPISuccess('contribution', 'get', array('contribution_page_id' => $this->_ids['contribution_page'],));
+    $contributions = $this->callAPISuccess('contribution', 'get', array('contribution_page_id' => $this->_ids['contribution_page']));
     $this->assertCount(2, $contributions['values']);
     $ids = array_keys($contributions['values']);
     $this->assertEquals('10.00', $contributions['values'][$ids[0]]['total_amount']);
@@ -264,7 +264,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     $this->params['recur_frequency_unit'] = 'month';
     $this->setUpMembershipContributionPage();
     $dummyPP = CRM_Core_Payment::singleton('live', $this->_paymentProcessor);
-    $dummyPP->setDoDirectPaymentResult(array('contribution_status_id' => 1, 'trxn_id' => 'create_first_success',));
+    $dummyPP->setDoDirectPaymentResult(array('contribution_status_id' => 1, 'trxn_id' => 'create_first_success'));
 
     $submitParams = array(
       'price_' . $this->_ids['price_field'][0] => reset($this->_ids['price_field_value']),
@@ -297,7 +297,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     //$this->callAPISuccess('line_item', 'getsingle', array('contribution_id' => $contribution['id'], 'entity_id' => $membership['id']));
     //renew it with processor setting completed - should extend membership
     $submitParams['contact_id'] = $contribution['contact_id'];
-    $dummyPP->setDoDirectPaymentResult(array('contribution_status_id' => 1, 'trxn_id' => 'create_second_success',));
+    $dummyPP->setDoDirectPaymentResult(array('contribution_status_id' => 1, 'trxn_id' => 'create_second_success'));
     $this->callAPISuccess('contribution_page', 'submit', $submitParams);
     $this->callAPISuccess('contribution', 'getsingle', array('id' => array('NOT IN' => array($contribution['id'])), 'contribution_page_id' => $this->_ids['contribution_page'], 'contribution_status_id' => 1));
     $renewedMembership = $this->callAPISuccessGetSingle('membership', array('id' => $membershipPayment['membership_id']));
@@ -319,7 +319,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     $this->params['recur_frequency_unit'] = 'month';
     $this->setUpMembershipContributionPage();
     $dummyPP = CRM_Core_Payment::singleton('live', $this->_paymentProcessor);
-    $dummyPP->setDoDirectPaymentResult(array('contribution_status_id' => 2,));
+    $dummyPP->setDoDirectPaymentResult(array('contribution_status_id' => 2));
 
     $submitParams = array(
       'price_' . $this->_ids['price_field'][0] => reset($this->_ids['price_field_value']),
@@ -358,10 +358,12 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'frequency_interval' => 1,
       'frequency_unit' => 'month',)
     );
-    $dummyPP->setDoDirectPaymentResult(array('contribution_status_id' => 2,));
+    $dummyPP->setDoDirectPaymentResult(array('contribution_status_id' => 2));
     $this->callAPISuccess('contribution_page', 'submit', $submitParams);
-    $newContribution = $this->callAPISuccess('contribution', 'getsingle', array('id' => array(
-      'NOT IN' => array($contribution['id'])), 'contribution_page_id' => $this->_ids['contribution_page'], 'contribution_status_id' => 2)
+    $newContribution = $this->callAPISuccess('contribution', 'getsingle', array(
+    'id' => array(
+      'NOT IN' => array($contribution['id'])), 'contribution_page_id' => $this->_ids['contribution_page'],
+    'contribution_status_id' => 2)
     );
 
     $renewedMembership = $this->callAPISuccessGetSingle('membership', array('id' => $membershipPayment['membership_id']));
@@ -467,7 +469,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
   }
 
   public static function setUpBeforeClass() {
-      // put stuff here that should happen before all tests in this unit
+    // put stuff here that should happen before all tests in this unit
   }
 
   public static function tearDownAfterClass(){
index 3fcd39b3585370d9cbe13b7d35ebea9e2a518786..8676533e19af6a30d3e1e2240d99c405eca3c2d9 100644 (file)
@@ -31,8 +31,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_contribute_recur* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Contribution
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contribution
  */
 
 
@@ -80,8 +80,7 @@ class api_v3_ContributionRecurTest extends CiviUnitTestCase {
     $result = $this->callAPISuccess($this->_entity, 'create', $this->params);
     $deleteParams = array('id' => $result['id']);
     $result = $this->callAPIAndDocument($this->_entity, 'delete', $deleteParams, __FUNCTION__, __FILE__);
-    $checkDeleted = $this->callAPISuccess($this->_entity, 'get', array(
-      ));
+    $checkDeleted = $this->callAPISuccess($this->_entity, 'get', array());
     $this->assertEquals(0, $checkDeleted['count']);
   }
 
index 92af8cdb01939c76824cacc3c4d7ab013b9d1f47..bb208a7633e97eb93833d5356256724158c68321 100644 (file)
@@ -30,8 +30,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_contribute_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_ContributionSoft
+ * @package CiviCRM_APIv3
+ * @subpackage API_ContributionSoft
  */
 
 class api_v3_ContributionSoftTest extends CiviUnitTestCase {
@@ -112,29 +112,29 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase {
 
     //create a second soft contribution on the same hard contribution - we are testing that 'id' gets the right soft contribution id (not the contribution id)
     $p['contact_id'] = $this->_softIndividual2Id;
-    $this->_softcontribution2 =  $this->callAPISuccess('contribution_soft', 'create', $p);
+    $this->_softcontribution2 = $this->callAPISuccess('contribution_soft', 'create', $p);
 
     // now we have 2 - test getcount
-    $softcontribution =  $this->callAPISuccess('contribution_soft', 'getcount', array());
+    $softcontribution = $this->callAPISuccess('contribution_soft', 'getcount', array());
     $this->assertEquals(2, $softcontribution);
 
     //check first contribution
-    $result =  $this->callAPISuccess('contribution_soft', 'get', array(
+    $result = $this->callAPISuccess('contribution_soft', 'get', array(
       'id' => $this->_softcontribution['id'],
     ));
     $this->assertEquals(1, $result['count'], 'In line ' . __LINE__);
     $this->assertEquals($this->_softcontribution['id'], $result['id']);
-    $this->assertEquals($this->_softcontribution['id'], $result['id'], print_r($softcontribution,true));
+    $this->assertEquals($this->_softcontribution['id'], $result['id'], print_r($softcontribution, TRUE));
 
     //test id only format - second soft credit
-    $resultID2 =  $this->callAPISuccess('contribution_soft', 'get', array(
+    $resultID2 = $this->callAPISuccess('contribution_soft', 'get', array(
       'id' => $this->_softcontribution2['id'],
       'format.only_id' => 1,
     ));
     $this->assertEquals($this->_softcontribution2['id'], $resultID2);
 
     //test get by contact id works
-    $result =  $this->callAPISuccess('contribution_soft', 'get', array(
+    $result = $this->callAPISuccess('contribution_soft', 'get', array(
       'contact_id' => $this->_softIndividual2Id)
     );
     $this->assertEquals(1, $result['count'], 'In line ' . __LINE__);
@@ -248,7 +248,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase {
     $this->assertEquals($old_contact_id, $this->_softIndividual1Id, 'In line ' . __LINE__);
     $this->assertEquals($old_amount, 10.00, 'In line ' . __LINE__);
     $this->assertEquals($old_currency, 'USD', 'In line ' . __LINE__);
-    $this->assertEquals($old_soft_credit_type_id, 6 , 'In line ' . __LINE__);
+    $this->assertEquals($old_soft_credit_type_id, 6, 'In line ' . __LINE__);
     $params = array(
       'id' => $softcontributionID,
       'contribution_id' => $this->_contributionId,
index 1c5cf7956758047c1d893bd996b5ed7e236b1cdc..9adb5138cfb044c1d80581eed350c312c87f7a08 100644 (file)
@@ -32,8 +32,8 @@ require_once 'CiviTest/CiviMailUtils.php';
 /**
  *  Test APIv3 civicrm_contribute_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Contribution
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contribution
  */
 
 class api_v3_ContributionTest extends CiviUnitTestCase {
@@ -118,7 +118,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
 
     $contribution = $this->callAPIAndDocument('contribution', 'get', $params, __FUNCTION__, __FILE__);
     $financialParams['id'] = $this->_financialTypeId;
-    $default = null;
+    $default = NULL;
     CRM_Financial_BAO_FinancialType::retrieve($financialParams, $default);
 
     $this->assertEquals(1, $contribution['count']);
@@ -148,7 +148,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       'id' => $this->_contribution['id'],
       'format.only_id' => 1,
     ));
-    $this->assertEquals($this->_contribution['id'], $contribution, print_r($contribution,true) . " in line " . __LINE__);
+    $this->assertEquals($this->_contribution['id'], $contribution, print_r($contribution, TRUE) . " in line " . __LINE__);
     //test id only format
     $contribution = $this->callAPISuccess('contribution', 'get', array(
       'id' => $contribution2['id'],
@@ -173,9 +173,9 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     ));
   }
 
-/**
- * We need to ensure previous tested behaviour still works as part of the api contract
- */
+  /**
  * We need to ensure previous tested behaviour still works as part of the api contract
  */
   public function testGetContributionLegacyBehaviour() {
     $p = array(
       'contact_id' => $this->_individualId,
@@ -197,10 +197,10 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     );
     $contribution = $this->callAPIAndDocument('contribution', 'get', $params, __FUNCTION__, __FILE__);
     $financialParams['id'] = $this->_financialTypeId;
-    $default = null;
+    $default = NULL;
     CRM_Financial_BAO_FinancialType::retrieve($financialParams, $default);
 
-    $this->assertEquals(1,$contribution['count']);
+    $this->assertEquals(1, $contribution['count']);
     $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
     $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->_financialTypeId);
     $this->assertEquals($contribution['values'][$contribution['id']]['contribution_type_id'], $this->_financialTypeId);
@@ -226,7 +226,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       'id' => $this->_contribution['id'],
       'format.only_id' => 1,
     ));
-    $this->assertEquals($this->_contribution['id'], $contribution, print_r($contribution,true) . " in line " . __LINE__);
+    $this->assertEquals($this->_contribution['id'], $contribution, print_r($contribution, TRUE) . " in line " . __LINE__);
     //test id only format
     $contribution = $this->callAPISuccess('contribution', 'get', array(
       'id' => $contribution2['id'],
@@ -256,11 +256,11 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       'contribution_id' => FALSE,
       'contact_id' => 1,
       'total_amount' => 1,
-      'check_permissions' => false,
+      'check_permissions' => FALSE,
       'financial_type_id' => 'Donation',
     );
     $this->callAPISuccess('contribution', 'create', $params);
- }
 }
   /*
    * ensure we continue to support contribution_type_id as part of the api commitment to
    * stability
@@ -271,7 +271,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       'contribution_id' => FALSE,
       'contact_id' => 1,
       'total_amount' => 1,
-      'check_permissions' => false,
+      'check_permissions' => FALSE,
       'contribution_type_id' => 3,
     );
     $contribution = $this->callAPISuccess('contribution', 'create', $params);
@@ -291,7 +291,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $params = $this->_params;
     $params['custom_' . $ids['custom_field_id']] = "custom string";
 
-    $result = $this->callAPIAndDocument($this->_entity, 'create', $params,  __FUNCTION__, __FILE__);
+    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__);
     $this->assertEquals($result['id'], $result['values'][$result['id']]['id']);
     $check = $this->callAPISuccess($this->_entity, 'get', array(
       'return.custom_' . $ids['custom_field_id'] => 1,
@@ -339,7 +339,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     );
 
     $contribution = $this->callAPISuccess('contribution', 'create', $params);
-    $lineItems = $this->callAPISuccess('line_item','get',array(
+    $lineItems = $this->callAPISuccess('line_item', 'get', array(
       'entity_id' => $contribution['id'],
       'entity_table' => 'civicrm_contribution',
       'sequential' => 1,
@@ -383,9 +383,9 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
 
     $description = "Create Contribution with Nested Line Items";
     $subfile = "CreateWithNestedLineItems";
-    $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__,__FILE__, $description, $subfile);
+    $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
 
-    $lineItems = $this->callAPISuccess('line_item','get',array(
+    $lineItems = $this->callAPISuccess('line_item', 'get', array(
       'entity_id' => $contribution['id'],
       'contribution_id' => $contribution['id'],
       'entity_table' => 'civicrm_contribution',
@@ -409,12 +409,12 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
     $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00);
-    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'],1 );
+    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1 );
     $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345);
     $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890);
     $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF');
     $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 1);
-    $lineItems = $this->callAPISuccess('line_item','get',array(
+    $lineItems = $this->callAPISuccess('line_item', 'get', array(
       'entity_id' => $contribution['id'],
       'contribution_id' => $contribution['id'],
       'entity_table' => 'civicrm_contribution',
@@ -432,7 +432,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   public function testCreateContributionWithPaymentInstrument() {
     $params = $this->_params + array('payment_instrument' => 'EFT');
     $contribution = $this->callAPISuccess('contribution', 'create', $params);
-    $contribution = $this->callAPISuccess('contribution','get', array(
+    $contribution = $this->callAPISuccess('contribution', 'get', array(
       'sequential' => 1,
       'id' => $contribution['id']
     ));
@@ -440,7 +440,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $this->assertEquals('EFT', $contribution['values'][0]['payment_instrument']);
 
     $this->callAPISuccess('contribution', 'create', array('id' => $contribution['id'], 'payment_instrument' => 'Credit Card'));
-    $contribution = $this->callAPISuccess('contribution','get', array(
+    $contribution = $this->callAPISuccess('contribution', 'get', array(
       'sequential' => 1,
       'id' => $contribution['id']
     ));
@@ -451,29 +451,29 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   public function testGetContributionByPaymentInstrument() {
     $params = $this->_params + array('payment_instrument' => 'EFT');
     $params2 = $this->_params + array('payment_instrument' => 'Cash');
-    $this->callAPISuccess('contribution','create',$params);
-    $this->callAPISuccess('contribution','create',$params2);
-    $contribution = $this->callAPISuccess('contribution','get',array( 'sequential' => 1, 'contribution_payment_instrument_id' => 'Cash'));
+    $this->callAPISuccess('contribution', 'create', $params);
+    $this->callAPISuccess('contribution', 'create', $params2);
+    $contribution = $this->callAPISuccess('contribution', 'get', array( 'sequential' => 1, 'contribution_payment_instrument_id' => 'Cash'));
     $this->assertArrayHasKey('payment_instrument', $contribution['values'][0]);
-    $this->assertEquals('Cash',$contribution['values'][0]['payment_instrument']);
-    $this->assertEquals(1,$contribution['count']);
-    $contribution = $this->callAPISuccess('contribution','get',array('sequential' => 1, 'payment_instrument_id' => 'EFT'));
+    $this->assertEquals('Cash', $contribution['values'][0]['payment_instrument']);
+    $this->assertEquals(1, $contribution['count']);
+    $contribution = $this->callAPISuccess('contribution', 'get', array('sequential' => 1, 'payment_instrument_id' => 'EFT'));
     $this->assertArrayHasKey('payment_instrument', $contribution['values'][0]);
-    $this->assertEquals('EFT',$contribution['values'][0]['payment_instrument']);
+    $this->assertEquals('EFT', $contribution['values'][0]['payment_instrument']);
     $this->assertEquals(1, $contribution['count']);
-    $contribution = $this->callAPISuccess('contribution','get',array( 'sequential' => 1, 'payment_instrument_id' => 5));
+    $contribution = $this->callAPISuccess('contribution', 'get', array( 'sequential' => 1, 'payment_instrument_id' => 5));
     $this->assertArrayHasKey('payment_instrument', $contribution['values'][0]);
-    $this->assertEquals('EFT',$contribution['values'][0]['payment_instrument']);
-    $this->assertEquals(1,$contribution['count']);
-    $contribution = $this->callAPISuccess('contribution','get',array( 'sequential' => 1, 'payment_instrument' => 'EFT'));
+    $this->assertEquals('EFT', $contribution['values'][0]['payment_instrument']);
+    $this->assertEquals(1, $contribution['count']);
+    $contribution = $this->callAPISuccess('contribution', 'get', array( 'sequential' => 1, 'payment_instrument' => 'EFT'));
     $this->assertArrayHasKey('payment_instrument', $contribution['values'][0]);
     $this->assertEquals('EFT', $contribution['values'][0]['payment_instrument']);
     $this->assertEquals(1, $contribution['count']);
     $contribution = $this->callAPISuccess('contribution', 'create', array('id' => $contribution['id'], 'payment_instrument' => 'Credit Card'));
-    $contribution = $this->callAPISuccess('contribution','get',array( 'sequential' => 1, 'id' => $contribution['id'], ));
+    $contribution = $this->callAPISuccess('contribution', 'get', array( 'sequential' => 1, 'id' => $contribution['id'] ));
     $this->assertArrayHasKey('payment_instrument', $contribution['values'][0]);
-    $this->assertEquals('Credit Card',$contribution['values'][0]['payment_instrument']);
-    $this->assertEquals(1,$contribution['count']);
+    $this->assertEquals('Credit Card', $contribution['values'][0]['payment_instrument']);
+    $this->assertEquals(1, $contribution['count']);
   }
 
   /**
@@ -616,7 +616,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $description = "Demonstrates creating contribution with SoftCredit";
     $subfile     = "ContributionCreateWithSoftCredit";
     $contact2    = $this->callAPISuccess('Contact', 'create', array('display_name' => 'superman', 'contact_type' => 'Individual'));
-    $softparams  =  array(
+    $softparams  = array(
       'contact_id' => $contact2['id'],
       'amount' => 50,
       'soft_credit_type_id' => 3
@@ -624,7 +624,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
 
     $params      = $this->_params + array('soft_credit' => array(1 => $softparams));
     $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
-    $result = $this->callAPISuccess('contribution','get', array('return'=> 'soft_credit', 'sequential' => 1));
+    $result = $this->callAPISuccess('contribution', 'get', array('return' => 'soft_credit', 'sequential' => 1));
 
     $this->assertEquals($softparams['contact_id'], $result['values'][0]['soft_credit'][1]['contact_id']);
     $this->assertEquals($softparams['amount'], $result['values'][0]['soft_credit'][1]['amount']);
@@ -642,7 +642,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       '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));
+    $result = $this->callAPISuccess('contribution', 'get', array('return' => 'soft_credit', 'sequential' => 1));
 
     $this->assertEquals($contact2['id'], $result['values'][0]['soft_credit'][1]['contact_id']);
     // Default soft credit amount = contribution.total_amount
@@ -661,7 +661,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       '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));
+    $result = $this->callAPISuccess('contribution', 'get', array('return' => 'soft_credit', 'sequential' => 1));
 
     $this->assertEquals($contact2['id'], $result['values'][0]['soft_credit'][1]['contact_id']);
     // Default soft credit amount = contribution.total_amount
@@ -710,13 +710,13 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00);
     $this->assertEquals($contribution['values'][$contribution['id']]['fee_amount'], 50.00);
     $this->assertEquals($contribution['values'][$contribution['id']]['net_amount'], 50.00);
-    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'],1 );
+    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1 );
     $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345);
     $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890);
     $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF');
     $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 1);
 
-    $lineItems = $this->callAPISuccess('line_item','get',array(
+    $lineItems = $this->callAPISuccess('line_item', 'get', array(
 
       'entity_id' => $contribution['id'],
       'entity_table' => 'civicrm_contribution',
@@ -725,7 +725,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $this->assertEquals(1, $lineItems['count']);
     $this->assertEquals($contribution['id'], $lineItems['values'][0]['entity_id']);
     $this->assertEquals($contribution['id'], $lineItems['values'][0]['contribution_id']);
-    $lineItems = $this->callAPISuccess('line_item','get',array(
+    $lineItems = $this->callAPISuccess('line_item', 'get', array(
 
         'entity_id' => $contribution['id'],
         'contribution_id' => $contribution['id'],
@@ -742,7 +742,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
    */
   public function testCreateContributionOnline() {
     CRM_Financial_BAO_PaymentProcessor::create($this->_processorParams);
-    $contributionPage = $this->callAPISuccess( 'contribution_page','create',  $this->_pageParams );
+    $contributionPage = $this->callAPISuccess( 'contribution_page', 'create', $this->_pageParams );
     $this->assertAPISuccess($contributionPage);
     $params = array(
       'contact_id' => $this->_individualId,
@@ -761,7 +761,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
     $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00);
-    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'],1 );
+    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1 );
     $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345);
     $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890);
     $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF');
@@ -796,7 +796,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   public function testCreateContributionPayLaterOnline() {
     CRM_Financial_BAO_PaymentProcessor::create($this->_processorParams);
     $this->_pageParams['is_pay_later'] = 1;
-    $contributionPage = $this->callAPISuccess( 'contribution_page','create',$this->_pageParams );
+    $contributionPage = $this->callAPISuccess( 'contribution_page', 'create', $this->_pageParams );
     $this->assertAPISuccess($contributionPage);
     $params = array(
       'contact_id' => $this->_individualId,
@@ -815,7 +815,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
     $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00);
-    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'],1 );
+    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1 );
     $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345);
     $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890);
     $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF');
@@ -846,7 +846,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
     $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00);
-    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'],1 );
+    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1 );
     $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345);
     $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890);
     $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF');
@@ -870,7 +870,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
    */
   public function testCreateUpdateContributionChangeTotal() {
     $contribution = $this->callAPISuccess('contribution', 'create', $this->_params);
-    $lineItems = $this->callAPISuccess('line_item','getvalue', array(
+    $lineItems = $this->callAPISuccess('line_item', 'getvalue', array(
 
       'entity_id' => $contribution['id'],
       'entity_table' => 'civicrm_contribution',
@@ -887,7 +887,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       'total_amount' => '125');
     $contribution = $this->callAPISuccess('contribution', 'create', $newParams);
 
-    $lineItems = $this->callAPISuccess('line_item','getvalue',array(
+    $lineItems = $this->callAPISuccess('line_item', 'getvalue', array(
 
         'entity_id' => $contribution['id'],
         'entity_table' => 'civicrm_contribution',
@@ -925,7 +925,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     );
     $contribution = $this->callAPISuccess('contribution', 'create', $newParams);
     $contribution = $contribution['values'][$contribution['id']];
-    $this->assertEquals($contribution['contribution_status_id'],'1');
+    $this->assertEquals($contribution['contribution_status_id'], '1');
     $this->_checkFinancialItem($contribution['id'], 'paylater');
     $this->_checkFinancialTrxn($contribution, 'payLater');
   }
@@ -997,7 +997,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
      'contribution_status_id' => 2,
       )
     );
-    $this->callAPIFailure('contribution', 'create', $newParams,ts('Cannot change contribution status from Completed to Pending.'));
+    $this->callAPIFailure('contribution', 'create', $newParams, ts('Cannot change contribution status from Completed to Pending.'));
 
   }
 
@@ -1111,7 +1111,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
 
     $this->assertEquals($contribution['values'][$contributionID]['contact_id'], $this->_individualId);
     $this->assertEquals($contribution['values'][$contributionID]['total_amount'], 110.00);
-        $this->assertEquals($contribution['values'][$contributionID]['financial_type_id'],$this->_financialTypeId );
+    $this->assertEquals($contribution['values'][$contributionID]['financial_type_id'], $this->_financialTypeId );
     $this->assertEquals($contribution['values'][$contributionID]['instrument_id'], $old_payment_instrument);
     $this->assertEquals($contribution['values'][$contributionID]['non_deductible_amount'], 10.00);
     $this->assertEquals($contribution['values'][$contributionID]['fee_amount'], $old_fee_amount);
@@ -1258,14 +1258,14 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
    * that person
    */
   public function testCompleteTransaction() {
-    $mut = new CiviMailUtils( $this, true );
+    $mut = new CiviMailUtils( $this, TRUE );
     $this->createLoggedInUser();
-    $params = array_merge($this->_params, array('contribution_status_id' => 2,));
-    $contribution = $this->callAPISuccess('contribution','create', $params);
+    $params = array_merge($this->_params, array('contribution_status_id' => 2));
+    $contribution = $this->callAPISuccess('contribution', 'create', $params);
     $this->callAPISuccess('contribution', 'completetransaction', array(
       'id' => $contribution['id'],
     ));
-    $contribution = $this->callAPISuccess('contribution', 'get', array('id' => $contribution['id'], 'sequential' => 1,));
+    $contribution = $this->callAPISuccess('contribution', 'get', array('id' => $contribution['id'], 'sequential' => 1));
     $this->assertEquals('Completed', $contribution['values'][0]['contribution_status']);
     $mut->checkMailLog(array(
       'Receipt - Contribution',
@@ -1281,12 +1281,12 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
    * tests.
    */
   public function testCompleteTransactionWithReceiptDateSet() {
-    $mut = new CiviMailUtils( $this, true );
+    $mut = new CiviMailUtils( $this, TRUE );
     $this->createLoggedInUser();
-    $params = array_merge($this->_params, array('contribution_status_id' => 2,'receipt_date' => 'now'));
-    $contribution = $this->callAPISuccess('contribution','create', $params);
-    $this->callAPISuccess('contribution', 'completetransaction', array('id' => $contribution['id'],));
-    $contribution = $this->callAPISuccess('contribution', 'get', array('id' => $contribution['id'], 'sequential' => 1,));
+    $params = array_merge($this->_params, array('contribution_status_id' => 2, 'receipt_date' => 'now'));
+    $contribution = $this->callAPISuccess('contribution', 'create', $params);
+    $this->callAPISuccess('contribution', 'completetransaction', array('id' => $contribution['id']));
+    $contribution = $this->callAPISuccess('contribution', 'get', array('id' => $contribution['id'], 'sequential' => 1));
     $this->assertEquals('Completed', $contribution['values'][0]['contribution_status']);
     $mut->checkMailLog(array(
       'Receipt - Contribution',
@@ -1302,7 +1302,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
    * that person
    */
   public function testCompleteTransactionWithParticipantRecord() {
-    $mut = new CiviMailUtils( $this, true );
+    $mut = new CiviMailUtils( $this, TRUE );
     $mut->clearMessages();
     $this->createLoggedInUser();
     $contributionID = $this->createPendingParticipantContribution();
@@ -1325,7 +1325,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   public function testCompleteTransactionMembershipPriceSet() {
     $this->createPriceSetWithPage('membership');
     $this->setUpPendingContribution($this->_ids['price_field_value'][0]);
-    $this->callAPISuccess('contribution', 'completetransaction', array('id' =>  $this->_ids['contribution']));
+    $this->callAPISuccess('contribution', 'completetransaction', array('id' => $this->_ids['contribution']));
     $membership = $this->callAPISuccess('membership', 'getsingle', array('id' => $this->_ids['membership']));
     $this->assertEquals(date('Y-m-d', strtotime('yesterday + 1 year')), $membership['end_date']);
     $this->cleanUpAfterPriceSets();
@@ -1337,7 +1337,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   public function testCompleteTransactionMembershipPriceSetTwoTerms() {
     $this->createPriceSetWithPage('membership');
     $this->setUpPendingContribution($this->_ids['price_field_value'][1]);
-    $this->callAPISuccess('contribution', 'completetransaction', array('id' =>  $this->_ids['contribution']));
+    $this->callAPISuccess('contribution', 'completetransaction', array('id' => $this->_ids['contribution']));
     $membership = $this->callAPISuccess('membership', 'getsingle', array('id' => $this->_ids['membership']));
     $this->assertEquals(date('Y-m-d', strtotime('yesterday + 2 years')), $membership['end_date']);
     $this->cleanUpAfterPriceSets();
@@ -1456,8 +1456,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
    * Test sending a mail via the API
    */
   public function testSendMail() {
-    $mut = new CiviMailUtils( $this, true );
-    $contribution = $this->callAPISuccess('contribution','create',$this->_params);
+    $mut = new CiviMailUtils( $this, TRUE );
+    $contribution = $this->callAPISuccess('contribution', 'create', $this->_params);
     $this->callAPISuccess('contribution', 'sendconfirmation', array(
       'id' => $contribution['id'],
       'receipt_from_email' => 'api@civicrm.org',
@@ -1478,8 +1478,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
    * Test sending a mail via the API
    */
   public function testSendMailEvent() {
-    $mut = new CiviMailUtils( $this, true );
-    $contribution = $this->callAPISuccess('contribution','create',$this->_params);
+    $mut = new CiviMailUtils( $this, TRUE );
+    $contribution = $this->callAPISuccess('contribution', 'create', $this->_params);
     $event = $this->eventCreate(array(
       'is_email_confirm' => 1,
       'confirm_from_email' => 'test@civicrm.org',
@@ -1510,17 +1510,15 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
         'Annual CiviCRM meet',
         'Event',
         'To: "Mr. Anthony Anderson II" <anthony_anderson@civicrm.org>',
-      ), array(
-
-      )
+      ), array()
     );
     $mut->stop();
   }
 
   /**
-  * This function does a GET & compares the result against the $params
-  * Use as a double check on Creates
-  */
+   * This function does a GET & compares the result against the $params
+   * Use as a double check on Creates
+   */
   public function contributionGetnCheck($params, $id, $delete = 1) {
 
     $contribution = $this->callAPISuccess('Contribution', 'Get', array(
@@ -1548,11 +1546,11 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
    * (along with an event)
    */
   public function createPendingParticipantContribution(){
-    $event = $this->eventCreate(array('is_email_confirm' => 1, 'confirm_from_email' => 'test@civicrm.org',));
+    $event = $this->eventCreate(array('is_email_confirm' => 1, 'confirm_from_email' => 'test@civicrm.org'));
     $participantID = $this->participantCreate(array('event_id' => $event['id'], 'status_id' => 6));
     $this->_ids['participant']  = $participantID;
     $params = array_merge($this->_params, array('contribution_status_id' => 2, 'financial_type_id' => 'Event Fee'));
-    $contribution = $this->callAPISuccess('contribution','create', $params);
+    $contribution = $this->callAPISuccess('contribution', 'create', $params);
     $this->callAPISuccess('participant_payment', 'create', array('contribution_id' => $contribution['id'], 'participant_id' => $participantID));
     $this->callAPISuccess('line_item', 'get', array(
       'entity_id' => $contribution['id'],
@@ -1571,16 +1569,16 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
    * @return null|string
    */
   function _getFinancialTrxnAmount($contId) {
-   $query = "SELECT
+    $query = "SELECT
      SUM( ft.total_amount ) AS total
      FROM civicrm_financial_trxn AS ft
      LEFT JOIN civicrm_entity_financial_trxn AS ceft ON ft.id = ceft.financial_trxn_id
      WHERE ceft.entity_table = 'civicrm_contribution'
      AND ceft.entity_id = {$contId}";
 
-   $result = CRM_Core_DAO::singleValueQuery($query);
-   return $result;
- }
+    $result = CRM_Core_DAO::singleValueQuery($query);
+    return $result;
 }
 
   /**
    * @param int $contId
@@ -1588,83 +1586,83 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
    * @return null|string
    */
   function _getFinancialItemAmount($contId) {
-   $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
-   $query = "SELECT
+    $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
+    $query = "SELECT
      SUM(amount)
      FROM civicrm_financial_item
      WHERE entity_table = 'civicrm_line_item'
      AND entity_id = {$lineItem}";
-   $result = CRM_Core_DAO::singleValueQuery($query);
-   return $result;
- }
+    $result = CRM_Core_DAO::singleValueQuery($query);
+    return $result;
 }
 
   /**
    * @param int $contId
    * @param $context
    */
   public function _checkFinancialItem($contId, $context) {
-   if ($context != 'paylater') {
-     $params = array (
-       'entity_id' =>   $contId,
+    if ($context != 'paylater') {
+      $params = array(
+       'entity_id' => $contId,
        'entity_table' => 'civicrm_contribution',
-     );
-     $trxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($params, TRUE));
-     $entityParams = array(
+      );
+      $trxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($params, TRUE));
+      $entityParams = array(
         'financial_trxn_id' => $trxn['financial_trxn_id'],
         'entity_table' => 'civicrm_financial_item',
-     );
-     $entityTrxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($entityParams));
-     $params = array(
+      );
+      $entityTrxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($entityParams));
+      $params = array(
         'id' => $entityTrxn['entity_id'],
-     );
-   }
-   if ($context == 'paylater') {
-     $lineItems = CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution');
-     foreach ($lineItems as $key=>$item) {
-       $params = array(
+      );
+    }
+    if ($context == 'paylater') {
+      $lineItems = CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution');
+      foreach ($lineItems as $key => $item) {
+        $params = array(
          'entity_id' => $key,
          'entity_table' => 'civicrm_line_item',
-       );
-       $compareParams = array ('status_id' => 1);
-       $this->assertDBCompareValues('CRM_Financial_DAO_FinancialItem', $params, $compareParams);
-     }
-   }
-   elseif ($context == 'refund') {
-     $compareParams = array(
+        );
+        $compareParams = array('status_id' => 1);
+        $this->assertDBCompareValues('CRM_Financial_DAO_FinancialItem', $params, $compareParams);
+      }
+    }
+    elseif ($context == 'refund') {
+      $compareParams = array(
        'status_id' => 1,
        'financial_account_id' => 1,
        'amount' => -100,
-     );
-   }
-   elseif ($context == 'cancelPending') {
-     $compareParams = array(
+      );
+    }
+    elseif ($context == 'cancelPending') {
+      $compareParams = array(
        'status_id' => 3,
        'financial_account_id' => 1,
        'amount' => -100,
-     );
-   }
-   elseif ($context == 'changeFinancial') {
-     $lineKey = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
-     $params = array(
+      );
+    }
+    elseif ($context == 'changeFinancial') {
+      $lineKey = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
+      $params = array(
        'entity_id' => $lineKey,
        'amount' => -100,
-     );
-     $compareParams = array(
+      );
+      $compareParams = array(
        'financial_account_id' => 1,
-     );
-     $this->assertDBCompareValues('CRM_Financial_DAO_FinancialItem', $params, $compareParams);
-     $params = array(
+      );
+      $this->assertDBCompareValues('CRM_Financial_DAO_FinancialItem', $params, $compareParams);
+      $params = array(
        'financial_account_id' => 3,
        'entity_id' => $lineKey,
-     );
-     $compareParams = array(
+      );
+      $compareParams = array(
        'amount' => 100,
-     );
-   }
-   if ($context != 'paylater') {
-     $this->assertDBCompareValues('CRM_Financial_DAO_FinancialItem', $params, $compareParams);
-   }
- }
+      );
+    }
+    if ($context != 'paylater') {
+      $this->assertDBCompareValues('CRM_Financial_DAO_FinancialItem', $params, $compareParams);
+    }
 }
 
   /**
    * @param $contribution
@@ -1672,191 +1670,191 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
    * @param int $instrumentId
    */
   public function _checkFinancialTrxn($contribution, $context, $instrumentId = NULL) {
-   $trxnParams = array(
-     'entity_id' =>   $contribution['id'],
+    $trxnParams = array(
+     'entity_id' => $contribution['id'],
      'entity_table' => 'civicrm_contribution',
-   );
-   $trxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($trxnParams, TRUE));
-   $params = array(
+    );
+    $trxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($trxnParams, TRUE));
+    $params = array(
      'id' => $trxn['financial_trxn_id'],
-   );
-   if ($context == 'payLater') {
-     $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Accounts Receivable Account is' "));
-     $compareParams = array(
+    );
+    if ($context == 'payLater') {
+      $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Accounts Receivable Account is' "));
+      $compareParams = array(
        'status_id' => 1,
        'from_financial_account_id' => CRM_Contribute_PseudoConstant::financialAccountType($contribution['financial_type_id'], $relationTypeId),
-     );
-   }
-   elseif ($context == 'refund') {
-     $compareParams = array(
+      );
+    }
+    elseif ($context == 'refund') {
+      $compareParams = array(
        'to_financial_account_id' => 6,
        'total_amount' => -100,
        'status_id' => 7,
-     );
-   }
-   elseif ($context == 'cancelPending') {
-     $compareParams = array(
+      );
+    }
+    elseif ($context == 'cancelPending') {
+      $compareParams = array(
        'from_financial_account_id' => 7,
        'total_amount' => -100,
        'status_id' => 3,
-     );
-   }
-   elseif ($context == 'changeFinancial' || $context == 'paymentInstrument') {
-     $entityParams = array(
-       'entity_id' =>   $contribution['id'],
+      );
+    }
+    elseif ($context == 'changeFinancial' || $context == 'paymentInstrument') {
+      $entityParams = array(
+       'entity_id' => $contribution['id'],
        'entity_table' => 'civicrm_contribution',
        'amount' => -100,
-     );
-     $trxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($entityParams));
-     $trxnParams1 = array(
+      );
+      $trxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($entityParams));
+      $trxnParams1 = array(
         'id' => $trxn['financial_trxn_id'],
-     );
-     $compareParams = array(
+      );
+      $compareParams = array(
        'total_amount' => -100,
        'status_id' => 1,
-     );
-     if ($context == 'paymentInstrument') {
-       $compareParams += array(
+      );
+      if ($context == 'paymentInstrument') {
+        $compareParams += array(
          'to_financial_account_id' => CRM_Financial_BAO_FinancialTypeAccount::getInstrumentFinancialAccount(4),
          'payment_instrument_id' => 4,
-       );
-     }
-     else {
-       $compareParams['to_financial_account_id'] = 12;
-     }
-     $this->assertDBCompareValues('CRM_Financial_DAO_FinancialTrxn', $trxnParams1, $compareParams);
-     $compareParams['total_amount'] = 100;
-     if ($context == 'paymentInstrument') {
-       $compareParams['to_financial_account_id'] = CRM_Financial_BAO_FinancialTypeAccount::getInstrumentFinancialAccount($instrumentId);
-       $compareParams['payment_instrument_id'] = $instrumentId;
-     }
-     else {
-       $compareParams['to_financial_account_id'] = 12;
-     }
-   }
-
-   $this->assertDBCompareValues('CRM_Financial_DAO_FinancialTrxn', $params, $compareParams);
- }
+        );
+      }
+      else {
+        $compareParams['to_financial_account_id'] = 12;
+      }
+      $this->assertDBCompareValues('CRM_Financial_DAO_FinancialTrxn', $trxnParams1, $compareParams);
+      $compareParams['total_amount'] = 100;
+      if ($context == 'paymentInstrument') {
+        $compareParams['to_financial_account_id'] = CRM_Financial_BAO_FinancialTypeAccount::getInstrumentFinancialAccount($instrumentId);
+        $compareParams['payment_instrument_id'] = $instrumentId;
+      }
+      else {
+        $compareParams['to_financial_account_id'] = 12;
+      }
+    }
+
+    $this->assertDBCompareValues('CRM_Financial_DAO_FinancialTrxn', $params, $compareParams);
 }
 
   /**
    * @return mixed
    */
   public function _addPaymentInstrument () {
-   $gId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'payment_instrument', 'id', 'name');
-   $optionParams = array(
+    $gId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'payment_instrument', 'id', 'name');
+    $optionParams = array(
      'option_group_id' => $gId,
      'label' => 'Test Card',
      'name' => 'Test Card',
      'value' => '6',
      'weight' => '6',
      'is_active' => 1,
-);
-   $optionValue = $this->callAPISuccess('option_value', 'create', $optionParams);
-   $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Asset Account is' "));
-   $financialParams = array(
+    );
+    $optionValue = $this->callAPISuccess('option_value', 'create', $optionParams);
+    $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Asset Account is' "));
+    $financialParams = array(
      'entity_table' => 'civicrm_option_value',
      'entity_id' => $optionValue['id'],
      'account_relationship' => $relationTypeId,
      'financial_account_id' => 7,
-   );
-   CRM_Financial_BAO_FinancialTypeAccount::add($financialParams, CRM_Core_DAO::$_nullArray);
-   $this->assertNotEmpty($optionValue['values'][$optionValue['id']]['value']);
-   return $optionValue['values'][$optionValue['id']]['value'];
- }
+    );
+    CRM_Financial_BAO_FinancialTypeAccount::add($financialParams, CRM_Core_DAO::$_nullArray);
+    $this->assertNotEmpty($optionValue['values'][$optionValue['id']]['value']);
+    return $optionValue['values'][$optionValue['id']]['value'];
 }
 
   /**
    * @param array $params
    * @param $context
    */
-  public function _checkFinancialRecords($params,$context) {
-   $entityParams = array(
+  public function _checkFinancialRecords($params, $context) {
+    $entityParams = array(
      'entity_id' => $params['id'],
      'entity_table' => 'civicrm_contribution',
-   );
+    );
     $contribution = $this->callAPISuccess('contribution', 'getsingle', array('id' => $params['id']));
     $this->assertEquals($contribution['total_amount'] - $contribution['fee_amount'], $contribution['net_amount']);
-   if ($context == 'pending') {
-     $trxn = CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($entityParams);
-     $this->assertNull($trxn, 'No Trxn to be created until IPN callback');
-     return;
-   }
-   $trxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($entityParams));
-   $trxnParams = array(
+    if ($context == 'pending') {
+      $trxn = CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($entityParams);
+      $this->assertNull($trxn, 'No Trxn to be created until IPN callback');
+      return;
+    }
+    $trxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($entityParams));
+    $trxnParams = array(
      'id' => $trxn['financial_trxn_id'],
-   );
-   if ($context != 'online' && $context != 'payLater') {
-     $compareParams = array(
+    );
+    if ($context != 'online' && $context != 'payLater') {
+      $compareParams = array(
        'to_financial_account_id' => 6,
        'total_amount' => 100,
        'status_id' => 1,
-     );
-   }
-   if ($context == 'feeAmount') {
-     $compareParams['fee_amount'] = 50;
-   }
-   elseif ($context == 'online') {
-     $compareParams = array(
+      );
+    }
+    if ($context == 'feeAmount') {
+      $compareParams['fee_amount'] = 50;
+    }
+    elseif ($context == 'online') {
+      $compareParams = array(
        'to_financial_account_id' => 12,
        'total_amount' => 100,
        'status_id' => 1,
-     );
-   }
-   elseif ($context == 'payLater') {
-     $compareParams = array(
+      );
+    }
+    elseif ($context == 'payLater') {
+      $compareParams = array(
        'to_financial_account_id' => 7,
        'total_amount' => 100,
        'status_id' => 2,
-     );
-   }
-   $this->assertDBCompareValues('CRM_Financial_DAO_FinancialTrxn',$trxnParams, $compareParams);
-   $entityParams = array(
+      );
+    }
+    $this->assertDBCompareValues('CRM_Financial_DAO_FinancialTrxn', $trxnParams, $compareParams);
+    $entityParams = array(
      'financial_trxn_id' => $trxn['financial_trxn_id'],
      'entity_table' => 'civicrm_financial_item',
-   );
-   $entityTrxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($entityParams));
-   $fitemParams = array(
+    );
+    $entityTrxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($entityParams));
+    $fitemParams = array(
      'id' => $entityTrxn['entity_id'],
-   );
-   $compareParams = array(
+    );
+    $compareParams = array(
      'amount' => 100,
      'status_id' => 1,
      'financial_account_id' => 1,
-   );
-   if ($context == 'payLater') {
-     $compareParams = array(
+    );
+    if ($context == 'payLater') {
+      $compareParams = array(
        'amount' => 100,
        'status_id' => 3,
        'financial_account_id' => 1,
-     );
-   }
-   $this->assertDBCompareValues('CRM_Financial_DAO_FinancialItem', $fitemParams, $compareParams);
-   if ($context == 'feeAmount') {
-     $maxParams = array(
+      );
+    }
+    $this->assertDBCompareValues('CRM_Financial_DAO_FinancialItem', $fitemParams, $compareParams);
+    if ($context == 'feeAmount') {
+      $maxParams = array(
        'entity_id' => $params['id'],
        'entity_table' => 'civicrm_contribution',
-     );
-     $maxTrxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($maxParams, TRUE));
-     $trxnParams = array(
+      );
+      $maxTrxn = current(CRM_Financial_BAO_FinancialItem::retrieveEntityFinancialTrxn($maxParams, TRUE));
+      $trxnParams = array(
        'id' => $maxTrxn['financial_trxn_id'],
-     );
-     $compareParams = array(
+      );
+      $compareParams = array(
        'to_financial_account_id' => 5,
        'from_financial_account_id' => 6,
        'total_amount' => 50,
        'status_id' => 1,
-     );
-     $trxnId = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($params['id'], 'DESC');
-     $this->assertDBCompareValues('CRM_Financial_DAO_FinancialTrxn', $trxnParams, $compareParams);
-     $fitemParams = array(
+      );
+      $trxnId = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($params['id'], 'DESC');
+      $this->assertDBCompareValues('CRM_Financial_DAO_FinancialTrxn', $trxnParams, $compareParams);
+      $fitemParams = array(
        'entity_id' => $trxnId['financialTrxnId'],
        'entity_table' => 'civicrm_financial_trxn',
-     );
-     $compareParams = array(
+      );
+      $compareParams = array(
        'amount' => 50,
        'status_id' => 1,
        'financial_account_id' => 5,
-     );
-     $this->assertDBCompareValues('CRM_Financial_DAO_FinancialItem', $fitemParams, $compareParams);
-   }
- }
+      );
+      $this->assertDBCompareValues('CRM_Financial_DAO_FinancialItem', $fitemParams, $compareParams);
+    }
 }
 }
index 8746e9eb4e7d7bf8870cf15ff33dd8b7d91b1ff3..8fe01544d977b152b22adee08b4020016f35c9b2 100644 (file)
@@ -32,8 +32,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_country* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Contact
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contact
  */
 class api_v3_CountryTest extends CiviUnitTestCase {
   protected $_apiversion;
@@ -64,7 +64,7 @@ class api_v3_CountryTest extends CiviUnitTestCase {
     //create one
     $create = $this->callAPISuccess('country', 'create', $this->_params);
 
-    $result = $this->callAPIAndDocument('country', 'delete', array('id' => $create['id'],), __FUNCTION__, __FILE__);
+    $result = $this->callAPIAndDocument('country', 'delete', array('id' => $create['id']), __FUNCTION__, __FILE__);
     $this->assertEquals(1, $result['count']);
     $get = $this->callAPISuccess('country', 'get', array(
       'id' => $create['id'],
@@ -92,7 +92,7 @@ class api_v3_CountryTest extends CiviUnitTestCase {
   public function testGet() {
     $country = $this->callAPISuccess('Country', 'create', $this->_params);
     $params = array(
-      'iso_code' =>  $this->_params['iso_code'],
+      'iso_code' => $this->_params['iso_code'],
     );
     $result = $this->callAPIAndDocument('Country', 'Get', $params, __FUNCTION__, __FILE__);
     $this->assertEquals($country['values'][$country['id']]['name'], $result['values'][$country['id']]['name']);
index cd6c664d275ee854b4a818bd62a353c4e29b531d..2d79dd974a3aa1784b2cb3a63d0c621384d248d8 100644 (file)
@@ -34,7 +34,7 @@ require_once 'tests/phpunit/CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_create_custom_group
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class api_v3_CustomFieldTest extends CiviUnitTestCase {
   protected $_apiversion;
@@ -147,9 +147,9 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase {
       $n++;
     }
   }
-/*
- * Can't figure out the point of this?
- */
+  /*
 * Can't figure out the point of this?
 */
   /**
    * @param array $params
    */
@@ -176,9 +176,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase {
                          'option_weight'   => array( 1, 2),
                          'option_status'   => array( 1, 1),
                          ));
-*/
-
-
+    */
 
     return $params;
   }
@@ -244,7 +242,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase {
     $this->assertTrue(is_numeric($optionGroupID) && ($optionGroupID > 0));
     $optionGroup = $this->callAPISuccess('option_group', 'getsingle', array(
       'id' => $optionGroupID));
-    $this->assertEquals($optionGroup['title'],'Country');
+    $this->assertEquals($optionGroup['title'], 'Country');
     $optionValueCount = $this->callAPISuccess('option_value', 'getcount', array(
       'option_group_id' => $optionGroupID));
     $this->assertEquals(0, $optionValueCount);
@@ -276,7 +274,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase {
       'return' => 'option_group_id',
     ));
 
-    $this->assertEquals($optionGroupID,3);
+    $this->assertEquals($optionGroupID, 3);
   }
 
 
@@ -330,7 +328,8 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase {
     $customGroup = $this->customGroupCreate(array('extends' => 'Contact', 'title' => 'select_test_group'));
 
     $option_values = array(
-      array('weight' => 1,
+      array(
+    'weight' => 1,
         'label' => 'Label1',
         'value' => 1,
         'is_active' => 1,
@@ -366,7 +365,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase {
     );
     $description  = "Demonstrate retrieving metadata with custom field options";
     $subfile = "GetFieldsOptions";
-    $fields = $this->callAPIAndDocument('contact', 'getfields', $getFieldsParams, __FUNCTION__, 'ContactTest.php', $description,$subfile,'GetFields');
+    $fields = $this->callAPIAndDocument('contact', 'getfields', $getFieldsParams, __FUNCTION__, 'ContactTest.php', $description, $subfile, 'GetFields');
     $this->assertArrayHasKey('options', $fields['values']['custom_' . $customField['id']]);
     $this->assertEquals('Label1', $fields['values']['custom_' . $customField['id']]['options'][1]);
     $getOptionsArray = array(
index d387c1964cde4cab4fd19b11cd0d629e1f2f5001..64c9c38e7dbf8b02bb61777dbf96e200948ecd33 100644 (file)
@@ -31,8 +31,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_custom_group* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_CustomGroup
+ * @package CiviCRM_APIv3
+ * @subpackage API_CustomGroup
  */
 
 class api_v3_CustomGroupTest extends CiviUnitTestCase {
@@ -231,7 +231,8 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
    * Check without title
    */
   public function testCustomGroupCreateNoTitle() {
-    $params = array('extends' => array('Contact'),
+    $params = array(
+    'extends' => array('Contact'),
       'weight' => 5,
       'collapse_display' => 1,
       'style' => 'Tab',
index 219bee6fbb4db9f7977f9ca7f52379a495a7cf11..4043b9b854634247324cbd4727f6ab77fdb752a2 100644 (file)
@@ -30,13 +30,13 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_activity_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Contact
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contact
  */
 
 class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase {
   protected $_contactID;
-  protected $_apiversion =3;
+  protected $_apiversion = 3;
   protected $CustomGroupIndividual;
   protected $individualStudent;
 
@@ -104,8 +104,8 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase {
     $this->organizationSponsor = $this->organizationCreate($params);
     //refresh php cached variables
     CRM_Core_PseudoConstant::flush();
-    CRM_Core_BAO_CustomField::getTableColumnGroup($this->IndividualField['id'], True);
-    CRM_Core_BAO_CustomField::getTableColumnGroup($this->IndiStudentField['id'], True);
+    CRM_Core_BAO_CustomField::getTableColumnGroup($this->IndividualField['id'], TRUE);
+    CRM_Core_BAO_CustomField::getTableColumnGroup($this->IndiStudentField['id'], TRUE);
   }
 
   public function tearDown() {
@@ -134,7 +134,8 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase {
     $params = array(
       'id' => $this->organization,
       'contact_type' => 'Organization',
-      "custom_{$this->IndividualField['id']}" => 'Test String',      'debug' => 1,// so that undefined_fields is returned
+      "custom_{$this->IndividualField['id']}" => 'Test String',
+    'debug' => 1, // so that undefined_fields is returned
     );
 
     $contact = $this->callAPISuccess('contact', 'create', $params);
@@ -149,7 +150,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase {
   public function testAddCustomDataEmptyToIndividual() {
     $contact = $this->callAPIFailure('contact', 'create', array(),
     'Mandatory key(s) missing from params array: contact_type'
-   );
+    );
   }
 
   /**
@@ -181,7 +182,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase {
       'contact_id' => $this->organizationSponsor,
       'contact_type' => 'Organization',
       "custom_{$this->IndiStudentField['id']}" => 'Test String',
-      'debug' => 1,// so that undefined_fields is returned
+      'debug' => 1, // so that undefined_fields is returned
     );
 
     $contact = $this->callAPISuccess('contact', 'create', $params);
@@ -197,7 +198,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $this->individualStudent,
       'contact_type' => 'Individual',
-      "custom_{$this->IndiStudentField['id']}" => 'Test String',    );
+      "custom_{$this->IndiStudentField['id']}" => 'Test String', );
 
     $result = $this->callAPISuccess('contact', 'create', $params);
 
@@ -217,7 +218,8 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $this->individualParent,
       'contact_type' => 'Individual',
-      "custom_{$this->IndiStudentField['id']}" => 'Test String',      'debug' => 1,// so that undefined_fields is returned
+      "custom_{$this->IndiStudentField['id']}" => 'Test String',
+    'debug' => 1, // so that undefined_fields is returned
     );
     $contact = $this->callAPISuccess('contact', 'create', $params);
     $this->assertTrue(is_array($contact['undefined_fields']), __LINE__);
@@ -236,7 +238,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase {
     $params = array(
       'contact_id' => $this->individual,
       'contact_type' => 'Individual',
-      "custom_" . $this->IndividualField['id'] => 'Test String',    );
+      "custom_" . $this->IndividualField['id'] => 'Test String', );
 
     $contact = $this->callAPISuccess('contact', 'create', $params);
 
@@ -261,19 +263,19 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase {
       'contact_id' => $this->individualStudent,
       'contact_type' => 'Individual',
       'contact_sub_type' => 'Student',
-      "custom_{$this->IndiStudentField['id']}" => 'Test String',    );
+      "custom_{$this->IndiStudentField['id']}" => 'Test String', );
 
     $contact = $this->callAPISuccess('contact', 'create', $params);
     $this->assertAPISuccess($contact);
     $params = array(
       'contact_id' => $this->individualStudent,
       'contact_type' => 'Individual',
-      'contact_sub_type' => 'Student',      "return.custom_{$this->IndiStudentField['id']}" => 1,
+      'contact_sub_type' => 'Student',
+    "return.custom_{$this->IndiStudentField['id']}" => 1,
     );
 
     $getContact = $this->callAPISuccess('contact', 'get', $params);
 
-
     $this->assertEquals($getContact['values'][$this->individualStudent]["custom_{$this->IndiStudentField['id']}"], 'Test String', 'In line ' . __LINE__);
   }
 }
index e7be0f817572a34f3341452b36a72d3d4766247f..df3a088cd603bba3c27aff0e41342769dcf310b6 100644 (file)
@@ -23,7 +23,7 @@
 | GNU Affero General Public License or the licensing of CiviCRM,     |
 | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
 +--------------------------------------------------------------------+
-*/
+ */
 
 require_once 'CiviTest/CiviUnitTestCase.php';
 
@@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  * Class api_v3_CustomValueTest
  */
 class api_v3_CustomValueTest extends CiviUnitTestCase {
-  protected $_apiversion =3;
+  protected $_apiversion = 3;
   protected $individual;
   protected $params;
   protected $ids;
@@ -86,7 +86,6 @@ class api_v3_CustomValueTest extends CiviUnitTestCase {
       'custom_' . $this->ids['multi2']['custom_field_id'][2] => "vegemite",
     );
 
-
     $result = $this->callAPISuccess('Contact', 'create', $params);
     $contact_id = $result['id'];
     $firstCustomField = $this->ids['multi']['custom_field_id'][0];
@@ -122,7 +121,7 @@ class api_v3_CustomValueTest extends CiviUnitTestCase {
     $this->assertEquals('', $result['values'][$thirdCustomField]['1']);
     $this->assertEquals('value 4', $result['values'][$thirdCustomField]['2']);
   }
-  
+
   public function testMultipleCustomValues() {
     $params = array(
       'first_name' => 'abc3',
@@ -140,7 +139,7 @@ class api_v3_CustomValueTest extends CiviUnitTestCase {
     $firstCustomField = $this->ids['multi']['custom_field_id'][1];
     $secondCustomField = $this->ids['single']['custom_field_id'];
     $thirdCustomField = $this->ids['multi']['custom_field_id'][0];
-    
+
     $createParams = array(
       'contact_type' => 'Individual',
       'id' => $contact_id,
@@ -157,7 +156,7 @@ class api_v3_CustomValueTest extends CiviUnitTestCase {
     $result = $this->callAPISuccess('CustomValue', 'Get', $params);
     // delete the contact
     $this->callAPISuccess('contact', 'delete', array('id' => $contact_id));
-    
+
     $this->assertEquals($contact_id, $result['values'][$secondCustomField]['entity_id']);
     $this->assertEquals('value 1', $result['values'][$secondCustomField]['latest']);
     $this->assertEquals('value 1', $result['values'][$secondCustomField][0]);
@@ -165,7 +164,7 @@ class api_v3_CustomValueTest extends CiviUnitTestCase {
     $this->assertEquals($contact_id, $result['values'][$thirdCustomField]['entity_id']);
     $this->assertEquals('multi value 1', $result['values'][$thirdCustomField][1]);
     $this->assertEquals('multi value 2', $result['values'][$thirdCustomField][2]);
-    
+
     $this->assertEquals($contact_id, $result['values'][$firstCustomField]['entity_id']);
     $this->assertEquals('second multi value 1', $result['values'][$firstCustomField][1]);
     $this->assertEquals('', $result['values'][$firstCustomField][2]);
index a1d5f6757042eb685354bb4ca30a1cdc06694819..a311f868a8b0443d51ee4f701a2494d58e5cb16e 100644 (file)
@@ -30,8 +30,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for Domain API - civicrm_domain_*
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Domain
+ * @package CiviCRM_APIv3
+ * @subpackage API_Domain
  */
 class api_v3_DomainTest extends CiviUnitTestCase {
 
@@ -79,7 +79,7 @@ class api_v3_DomainTest extends CiviUnitTestCase {
       )
     );
 
-    $this->callAPISuccess('domain','create',array(
+    $this->callAPISuccess('domain', 'create', array(
       'id' => 1,
       'contact_id' => $domContact['id'],
       )
@@ -100,7 +100,7 @@ class api_v3_DomainTest extends CiviUnitTestCase {
    */
   public function testGet() {
 
-    $params = array('sequential' => 1,);
+    $params = array('sequential' => 1);
     $result = $this->callAPIAndDocument('domain', 'get', $params, __FUNCTION__, __FILE__);
 
     $this->assertType('array', $result);
@@ -138,9 +138,9 @@ class api_v3_DomainTest extends CiviUnitTestCase {
       $this->assertArrayHasKey('domain_email', $domain);
       $this->assertArrayHasKey('domain_phone', $domain);
       $this->assertArrayHasKey('domain_address', $domain);
-      $this->assertEquals("my@email.com",$domain['domain_email']);
-      $this->assertEquals("456-456",$domain['domain_phone']['phone']);
-      $this->assertEquals("45 Penny Lane",$domain['domain_address']['street_address']);
+      $this->assertEquals("my@email.com", $domain['domain_email']);
+      $this->assertEquals("456-456", $domain['domain_phone']['phone']);
+      $this->assertEquals("45 Penny Lane", $domain['domain_address']['street_address']);
     }
   }
 
index 6a935d77710119c1e74824af0b10520fe8222d65..a5895ddb6cc9a7b29891b32479016969c9e6837b 100644 (file)
@@ -141,7 +141,7 @@ class api_v3_EmailTest extends CiviUnitTestCase {
     //create one
     $create = $this->callAPISuccess('email', 'create', $params);
 
-    $result = $this->callAPIAndDocument('email', 'delete', array('id' => $create['id'],), __FUNCTION__, __FILE__);
+    $result = $this->callAPIAndDocument('email', 'delete', array('id' => $create['id']), __FUNCTION__, __FILE__);
     $this->assertEquals(1, $result['count'], 'In line ' . __LINE__);
     $get = $this->callAPISuccess('email', 'get', array(
       'location_type_id' => $this->_locationType->id,
index 30f875f1e967cd7d64d59505eaf546de6905c193..113c2ddf04a858648d99c78b1c036eb7bdb6c069 100644 (file)
@@ -82,11 +82,11 @@ class api_v3_EventTest extends CiviUnitTestCase {
       array(
         'title' => 'Annual CiviCRM meet',
         'event_type_id' => 1,
-        'start_date' => 20081021,      ),
+        'start_date' => 20081021, ),
       array(
         'title' => 'Annual CiviCRM meet 2',
         'event_type_id' => 1,
-        'start_date' => 20101021,      ),
+        'start_date' => 20101021, ),
     );
 
     $this->events = array();
@@ -139,14 +139,14 @@ class api_v3_EventTest extends CiviUnitTestCase {
   public function testGetEventByIdSort() {
     $params = array(
       'return.sort' => 'id ASC',
-      'return.max_results' => 1,    );
+      'return.max_results' => 1, );
     $result = $this->callAPISuccess('Event', 'Get', $params);
     $this->assertEquals(1, $result['id'], ' in line ' . __LINE__);
     $params = array(
       'options' => array(
         'sort' => 'id DESC',
         'limit' => 1,
-      ),    );
+      ), );
 
     $result = $this->callAPISuccess('Event', 'Get', $params);
     $this->assertAPISuccess($result, ' in line ' . __LINE__);
@@ -155,11 +155,10 @@ class api_v3_EventTest extends CiviUnitTestCase {
       'options' => array(
         'sort' => 'id ASC',
         'limit' => 1,
-      ),    );
+      ), );
     $result = $this->callAPISuccess('Event', 'Get', $params);
     $this->assertEquals(1, $result['id'], ' in line ' . __LINE__);
 
-
   }
   /*
    * Getting the id back of an event.
@@ -184,7 +183,8 @@ class api_v3_EventTest extends CiviUnitTestCase {
     $params = array(
       'isCurrent' => 1,
     );
-    $currentEventParams = array('start_date' => date('Y-m-d', strtotime('+ 1 day')),
+    $currentEventParams = array(
+    'start_date' => date('Y-m-d', strtotime('+ 1 day')),
       'end_date' => date('Y-m-d', strtotime('+ 1 week')),
     );
     $currentEventParams = array_merge($this->_params[1], $currentEventParams);
@@ -205,17 +205,17 @@ class api_v3_EventTest extends CiviUnitTestCase {
   public function testGetPaymentProcessorId() {
     $params = $this->_params[0];
     $params['payment_processor_id'] = 1;
-    $params['sequential'] =1;
+    $params['sequential'] = 1;
     $result = $this->callAPISuccess('event', 'create', $params);
-    $this->assertEquals( 1,$result['values'][0]['payment_processor'][0], "handing of payment processor compatibility");
+    $this->assertEquals( 1, $result['values'][0]['payment_processor'][0], "handing of payment processor compatibility");
     $result = $this->callAPISuccess('event', 'get', $params);
-    $this->assertEquals($result['values'][0]['payment_processor_id'], 1,"handing get payment processor compatibility");
+    $this->assertEquals($result['values'][0]['payment_processor_id'], 1, "handing get payment processor compatibility");
   }
 
   public function testInvalidData() {
     $params = $this->_params[0];
-    $params['sequential'] =1;
-    $params['loc_block_id'] =100;
+    $params['sequential'] = 1;
+    $params['loc_block_id'] = 100;
     $result = $this->callAPIFailure('event', 'create', $params);
 
   }
@@ -226,12 +226,14 @@ class api_v3_EventTest extends CiviUnitTestCase {
   public function testGetSingleReturnIsFull() {
     $contactID = $this->individualCreate();
     $params = array(
-      'id' => $this->_eventIds[0],      'max_participants' => 1,
+      'id' => $this->_eventIds[0],
+    'max_participants' => 1,
     );
     $result = $this->callAPISuccess('Event', 'Create', $params);
 
     $getEventParams = array(
-      'id' => $this->_eventIds[0],      'return.is_full' => 1,
+      'id' => $this->_eventIds[0],
+    'return.is_full' => 1,
     );
 
     $currentEvent = $this->callAPISuccess('Event', 'getsingle', $getEventParams);
@@ -359,7 +361,8 @@ class api_v3_EventTest extends CiviUnitTestCase {
     $result = $this->callAPISuccess('event', 'create', $this->_params[1]);
 
     $params = array(
-      'id' => $result['id'], 'max_participants' => 150,
+      'id' => $result['id'],
+    'max_participants' => 150,
     );
     $this->callAPISuccess('Event', 'Create', $params);
     $updated = $this->callAPISuccess('Event', 'Get', $params, __FUNCTION__, __FILE__);
@@ -385,7 +388,7 @@ class api_v3_EventTest extends CiviUnitTestCase {
    */
   public function testDeleteWithEventId() {
     $params = array(
-      'event_id' => $this->_eventIds[0],    );
+      'event_id' => $this->_eventIds[0], );
     $result = $this->callAPISuccess('Event', 'Delete', $params);
     $this->assertAPISuccess($result, 'in line ' . __LINE__);
   }
@@ -445,7 +448,7 @@ class api_v3_EventTest extends CiviUnitTestCase {
       'event_type_id' => 1,
       'return.title' => 1,
       'return.id' => 1,
-      'return.start_date' => 1,    );
+      'return.start_date' => 1, );
     $result = $this->callAPISuccess('event', 'get', $params);
 
     $this->assertEquals($result['values'][$this->_eventIds[0]]['id'], $this->_eventIds[0], 'In line ' . __LINE__);
@@ -460,7 +463,8 @@ class api_v3_EventTest extends CiviUnitTestCase {
     $maxEvents = 5;
     $events = array();
     while ($maxEvents > 0) {
-      $params = array(        'title' => 'Test Event' . $maxEvents,
+      $params = array(
+      'title' => 'Test Event' . $maxEvents,
         'event_type_id' => 2,
         'start_date' => 20081021,
       );
@@ -468,7 +472,8 @@ class api_v3_EventTest extends CiviUnitTestCase {
       $events[$maxEvents] = $this->callAPISuccess('event', 'create', $params);
       $maxEvents--;
     }
-    $params = array(      'event_type_id' => 2,
+    $params = array(
+    'event_type_id' => 2,
       'return.id' => 1,
       'return.title' => 1,
       'return.offset' => 2,
@@ -481,7 +486,10 @@ class api_v3_EventTest extends CiviUnitTestCase {
 
   public function testEventCreationPermissions() {
     $params = array(
-      'event_type_id' => 1, 'start_date' => '2010-10-03', 'title' => 'le cake is a tie', 'check_permissions' => TRUE,    );
+      'event_type_id' => 1,
+    'start_date' => '2010-10-03',
+    'title' => 'le cake is a tie',
+    'check_permissions' => TRUE, );
     $config = &CRM_Core_Config::singleton();
     $config->userPermissionClass->permissions = array('access CiviCRM');
     $result = $this->callAPIFailure('event', 'create', $params);
index 339b1852634de6e811786246bb96221480fda266..f3faefa5b3f57c9df60c26a1db0b8f0f38ca8480 100644 (file)
@@ -31,8 +31,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_grant* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Grant
+ * @package CiviCRM_APIv3
+ * @subpackage API_Grant
  */
 
 class api_v3_GrantTest extends CiviUnitTestCase {
@@ -153,17 +153,16 @@ class api_v3_GrantTest extends CiviUnitTestCase {
     $result = $this->callAPISuccess($this->_entity, 'create', $this->params);
     $result = $this->callAPIAndDocument($this->_entity, 'delete', array('id' => $result['id']), __FUNCTION__, __FILE__);
     $this->assertAPISuccess($result, 'In line ' . __LINE__);
-    $checkDeleted = $this->callAPISuccess($this->_entity, 'get', array(
-           ));
+    $checkDeleted = $this->callAPISuccess($this->_entity, 'get', array());
     $this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__);
   }
   /*
- * This is a test to check if setting fields one at a time alters other fields
- * Issues Hit so far =
- * 1) Currency keeps getting reset to USD -  BUT this may be the only enabled currency
- *  - in which case it is valid
- * 2)
- */
 * This is a test to check if setting fields one at a time alters other fields
 * Issues Hit so far =
 * 1) Currency keeps getting reset to USD -  BUT this may be the only enabled currency
 *  - in which case it is valid
 * 2)
 */
 
   public function testCreateAutoGrant() {
     $entityName = $this->_entity;
index 1f448085170acdd521143a15a15b6464096d3792..2eff3c50df4cd31e463f0dfead9ef406f9b758de 100644 (file)
@@ -70,7 +70,8 @@ class api_v3_GroupContactTest extends CiviUnitTestCase {
     $this->_groupId2 = $this->groupCreate($group);
 
     $this->_group = array(
-      $this->_groupId1 => array('title' => 'New Test Group Created',
+      $this->_groupId1 => array(
+    'title' => 'New Test Group Created',
         'visibility' => 'Public Pages',
         'in_method' => 'API',
       ),
@@ -121,7 +122,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase {
 
   public function testCreateWithoutGroupIdParams() {
     $params = array(
-      'contact_id' => $this->_contactId,    );
+      'contact_id' => $this->_contactId, );
 
     $groups = $this->callAPIFailure('group_contact', 'create', $params);
     $this->assertEquals($groups['error_message'], 'Mandatory key(s) missing from params array: group_id');
@@ -129,7 +130,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase {
 
   public function testCreateWithoutContactIdParams() {
     $params = array(
-      'group_id' => $this->_groupId1,    );
+      'group_id' => $this->_groupId1, );
     $groups = $this->callAPIFailure('group_contact', 'create', $params);
     $this->assertEquals($groups['error_message'], 'Mandatory key(s) missing from params array: contact_id');
   }
@@ -142,7 +143,7 @@ class api_v3_GroupContactTest extends CiviUnitTestCase {
       'prefix_id' => 3,
       'suffix_id' => 3,
       'email' => 'amiteshwar.prasad@civicrm.org',
-      'contact_type' => 'Individual',    );
+      'contact_type' => 'Individual', );
 
     $this->_contactId1 = $this->individualCreate($cont);
     $params = array(
index 8c8ebfb30137a175f17d97872d8eb82324a55cb7..543fc0ce638f683f108a877e9cbef014567b34f2 100644 (file)
@@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for GroupNesting API - civicrm_group_nesting_*
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class api_v3_GroupNestingTest extends CiviUnitTestCase {
   protected $_apiversion;
@@ -106,7 +106,8 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase {
     $result = $this->callAPIAndDocument('group_nesting', 'get', $params, __FUNCTION__, __FILE__);
     // expected data loaded in setUp
     $expected = array(
-      1 => array('id' => 1,
+      1 => array(
+    'id' => 1,
         'child_group_id' => 2,
         'parent_group_id' => 1,
       ));
@@ -120,13 +121,14 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase {
    */
   public function testGetWithChildGroupId() {
     $params = array(
-      'child_group_id' => 4,    );
+      'child_group_id' => 4, );
 
     $result = $this->callAPISuccess('group_nesting', 'get', $params);
 
     // expected data loaded in setUp
     $expected = array(
-      3 => array('id' => 3,
+      3 => array(
+    'id' => 3,
         'child_group_id' => 4,
         'parent_group_id' => 1,
       ),
@@ -146,13 +148,14 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase {
    */
   public function testGetWithParentGroupId() {
     $params = array(
-      'parent_group_id' => 1,    );
+      'parent_group_id' => 1, );
 
     $result = $this->callAPISuccess('group_nesting', 'get', $params);
 
     // expected data loaded in setUp
     $expected = array(
-      1 => array('id' => 1,
+      1 => array(
+    'id' => 1,
         'child_group_id' => 2,
         'parent_group_id' => 1,
       ),
@@ -221,7 +224,7 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase {
     // groups id=1 and id=2 loaded in setUp
     $getparams = array(
       'parent_group_id' => 1,
-      'child_group_id' => 2,    );
+      'child_group_id' => 2, );
 
     $result = $this->callAPISuccess('group_nesting', 'get', $getparams);
     $params = array('id' => $result['id']);
index eb34b1a9f0e2807ca5a02bec90d990b12ba8b1ae..4f3128abf1a791bd2d5ad78acd178b38888d4c04 100644 (file)
@@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for GroupOrganization API - civicrm_group_organization_*
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
   protected $_apiversion;
@@ -59,7 +59,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
 
     $params = array(
       'organization_id' => $this->_orgID,
-      'group_id' => $this->_groupID,    );
+      'group_id' => $this->_groupID, );
     $result = $this->callAPISuccess('group_organization', 'create', $params);
     $paramsGet = array(
       'organization_id' => $result['id'],
@@ -89,7 +89,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
    * Test civicrm_group_organization_get with empty params.
    */
   public function testGroupOrganizationGetWithEmptyParams() {
-    $params = array(    );
+    $params = array();
     $result = $this->callAPISuccess('group_organization', 'get', $params);
 
     $this->assertAPISuccess($result);
@@ -109,7 +109,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
    */
   public function testGroupOrganizationGetWithInvalidKeys() {
     $params = array(
-      'invalid_key' => 1,    );
+      'invalid_key' => 1, );
     $result = $this->callAPISuccess('group_organization', 'get', $params);
 
     $this->assertAPISuccess($result);
@@ -123,7 +123,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
   public function testGroupOrganizationCreate() {
     $params = array(
       'organization_id' => $this->_orgID,
-      'group_id' => $this->_groupID,    );
+      'group_id' => $this->_groupID, );
     $result = $this->callAPIAndDocument('group_organization', 'create', $params, __FUNCTION__, __FILE__);
   }
 
@@ -133,7 +133,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
   public function testGroupOrganizationCreateTwice() {
     $params = array(
         'organization_id' => $this->_orgID,
-        'group_id' => $this->_groupID,    );
+        'group_id' => $this->_groupID, );
     $result = $this->callAPISuccess('group_organization', 'create', $params);
     $result2 = $this->callAPISuccess('group_organization', 'create', $params);
     $this->assertEquals($result['values'], $result2['values']);
@@ -142,7 +142,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
    * Check with empty params array
    */
   public function testGroupOrganizationCreateWithEmptyParams() {
-    $params = array(    );
+    $params = array();
     $result = $this->callAPIFailure('group_organization', 'create', $params);
     $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: group_id, organization_id');
   }
@@ -161,7 +161,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
    */
   public function testGroupOrganizationCreateWithInvalidKeys() {
     $params = array(
-      'invalid_key' => 1,    );
+      'invalid_key' => 1, );
     $result = $this->callAPIFailure('group_organization', 'create', $params);
     $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: group_id, organization_id');
   }
@@ -181,7 +181,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
    * Test civicrm_group_organization_remove with empty params.
    */
   public function testGroupOrganizationDeleteWithEmptyParams() {
-    $params = array(    );
+    $params = array();
     $result = $this->callAPIFailure('group_organization', 'delete', $params);
     $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: id');
   }
@@ -192,7 +192,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
   public function testGroupOrganizationDelete() {
     $paramsC = array(
       'organization_id' => $this->_orgID,
-      'group_id' => $this->_groupID,    );
+      'group_id' => $this->_groupID, );
     $result = $this->callAPISuccess('group_organization', 'create', $paramsC);
 
     $params = array(
@@ -206,7 +206,7 @@ class api_v3_GroupOrganizationTest extends CiviUnitTestCase {
    */
   public function testGroupOrganizationDeleteWithInvalidKey() {
     $paramsDelete = array(
-      'invalid_key' => 1,    );
+      'invalid_key' => 1, );
     $result = $this->callAPIFailure('group_organization', 'delete', $paramsDelete);
     $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: id');
   }
index b103823caf61719f214cf308d3feb9b96dc459d5..5e5188fc09f16ccdc6d1d0de7a2fd955ab080e6a 100644 (file)
@@ -30,7 +30,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for Group API - civicrm_group_*
  *
- *  @package CiviCRM_APIv3
+ * @package CiviCRM_APIv3
  */
 
 class api_v3_GroupTest extends CiviUnitTestCase {
index 95baf4780a11516452440376cfda0f5421a296cd..0e8152650aa6ca427777ce07e90754d16e4af78d 100644 (file)
@@ -31,8 +31,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_im_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Contact
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contact
  */
 
 class api_v3_ImTest extends CiviUnitTestCase {
index e3b22441460ba6e259e0e91559f673c1e0e05bbf..bfaecf64a09cb5e0b20bbd2cd0c5f4f3d3f4e4ee 100644 (file)
@@ -68,7 +68,7 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase {
       'created_id' => 1,
       'groups' => array('include' => array($this->_groupID)),
     );
-    $this->_mut = new CiviMailUtils( $this, true );
+    $this->_mut = new CiviMailUtils( $this, TRUE );
     $this->callAPISuccess('mail_settings', 'get', array('api.mail_settings.create' => array('domain' => 'chaos.org')));
   }
 
@@ -77,7 +77,7 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase {
    */
   public function tearDown() {
     $this->_mut->stop();
-//    $this->quickCleanup(array('civicrm_mailing', 'civicrm_mailing_job', 'civicrm_contact'));
+    //    $this->quickCleanup(array('civicrm_mailing', 'civicrm_mailing_job', 'civicrm_contact'));
     CRM_Utils_Hook::singleton()->reset();
     CRM_Mailing_BAO_MailingJob::$mailsProcessed = 0; // DGW
     parent::tearDown();
index 309a595d0b4d181f1d2c3f980ff014bda9f02431..69518bf13a396cd70af5efa09a40d235c10e6ace 100644 (file)
@@ -67,7 +67,7 @@ class api_v3_JobTest extends CiviUnitTestCase {
    */
   public function testCreateWithoutName() {
     $params = array(
-      'is_active' => 1,    );
+      'is_active' => 1, );
     $result = $this->callAPIFailure('job', 'create', $params,
       'Mandatory key(s) missing from params array: run_frequency, name, api_entity, api_action'
     );
@@ -137,7 +137,7 @@ class api_v3_JobTest extends CiviUnitTestCase {
    */
   public function testDeleteWithIncorrectData() {
     $params = array(
-      'id' => 'abcd',    );
+      'id' => 'abcd', );
     $result = $this->callAPIFailure('job', 'delete', $params);
   }
 
@@ -146,7 +146,7 @@ class api_v3_JobTest extends CiviUnitTestCase {
    */
   public function testDelete() {
     $createResult = $this->callAPISuccess('job', 'create', $this->_params);
-    $params = array('id' => $createResult['id'],);
+    $params = array('id' => $createResult['id']);
     $result = $this->callAPIAndDocument('job', 'delete', $params, __FUNCTION__, __FILE__);
     $this->assertAPIDeleted($this->_entity, $createResult['id']);
   }
@@ -154,20 +154,20 @@ class api_v3_JobTest extends CiviUnitTestCase {
   /**
 
   public function testCallUpdateGreetingMissingParams() {
-    $result = $this->callAPISuccess($this->_entity, 'update_greeting', array('gt' => 1));
-    $this->assertEquals('Mandatory key(s) missing from params array: ct', $result['error_message']);
+  $result = $this->callAPISuccess($this->_entity, 'update_greeting', array('gt' => 1));
+  $this->assertEquals('Mandatory key(s) missing from params array: ct', $result['error_message']);
   }
 
   public function testCallUpdateGreetingIncorrectParams() {
-    $result = $this->callAPISuccess($this->_entity, 'update_greeting', array('gt' => 1, 'ct' => 'djkfhdskjfhds'));
-    $this->assertEquals('ct `djkfhdskjfhds` is not valid.', $result['error_message']);
+  $result = $this->callAPISuccess($this->_entity, 'update_greeting', array('gt' => 1, 'ct' => 'djkfhdskjfhds'));
+  $this->assertEquals('ct `djkfhdskjfhds` is not valid.', $result['error_message']);
   }
-/*
- * Note that this test is about tesing the metadata / calling of the function & doesn't test the success of the called function
- */
+  /*
  * 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('gt' => 'postal_greeting', 'ct' => 'Individual'));
-   }
+  }
 
   public function testCallUpdateGreetingCommaSeparatedParamsSuccess() {
     $gt = 'postal_greeting,email_greeting,addressee';
@@ -283,7 +283,7 @@ class api_v3_JobTest extends CiviUnitTestCase {
    * @param int $id
    * @param array $params
    */
-  public function hookPreRelationship($op, $objectName, $id, &$params ) {
+  public function hookPreRelationship($op, $objectName, $id, &$params) {
     if($op == 'delete') {
       return;
     }
index 520659316ed1197fc6a2a1c65ae0aa2b7fc1a72d..4359297119923342b8cd3a224301b361a10249e9 100644 (file)
@@ -37,7 +37,7 @@ class api_v3_LineItemTest extends CiviUnitTestCase {
   protected $id = 0;
   protected $contactIds = array();
   protected $_entity = 'line_item';
-  protected $contribution_result = null;
+  protected $contribution_result = NULL;
 
   public $DBResetRequired = TRUE;
   protected $_financialTypeId = 1;
@@ -57,7 +57,7 @@ class api_v3_LineItemTest extends CiviUnitTestCase {
       'source' => 'SSF',
       'contribution_status_id' => 1,
     );
-    $contribution = $this->callAPISuccess('contribution','create', $contributionParams);
+    $contribution = $this->callAPISuccess('contribution', 'create', $contributionParams);
     $this->params = array(
       'price_field_value_id' => 1,
       'price_field_id' => 1,
@@ -95,7 +95,7 @@ class api_v3_LineItemTest extends CiviUnitTestCase {
   }
 
   public function testGetFieldsLineItem() {
-    $result = $this->callAPISuccess($this->_entity, 'getfields', array('action' => 'create',));
+    $result = $this->callAPISuccess($this->_entity, 'getfields', array('action' => 'create'));
     $this->assertEquals(1, $result['values']['entity_id']['api.required']);
   }
 
index 51d0b3ea9f0db7d5218aa335c7f8390711a848be..c3e66bb0e1340643109ad9ba7e2d8d4af085ff1f 100644 (file)
@@ -104,9 +104,9 @@ class api_v3_LocBlockTest extends CiviUnitTestCase {
     $this->assertNotNull($result['phone_id'], 'In line ' . __LINE__);
     $this->assertNotNull($result['phone_2_id'], 'In line ' . __LINE__);
     $this->assertNotNull($result['address_id'], 'In line ' . __LINE__);
-    $this->assertEquals($params['email']['email'], $result['email']['email'],  'In line ' . __LINE__);
-    $this->assertEquals($params['phone_2']['phone'], $result['phone_2']['phone'],  'In line ' . __LINE__);
-    $this->assertEquals($params['address']['street_address'], $result['address']['street_address'],  'In line ' . __LINE__);
+    $this->assertEquals($params['email']['email'], $result['email']['email'], 'In line ' . __LINE__);
+    $this->assertEquals($params['phone_2']['phone'], $result['phone_2']['phone'], 'In line ' . __LINE__);
+    $this->assertEquals($params['address']['street_address'], $result['address']['street_address'], 'In line ' . __LINE__);
     // Delete block
     $result = $this->callAPISuccess($this->_entity, 'delete', array('id' => $id));
   }
index ba22a060d90ed435ab1e9cf646c0e0a29125fcae..1d0e07cd7799141aca6971d144a2a856b52a12af 100644 (file)
@@ -67,7 +67,7 @@ class api_v3_MailingContactTest extends CiviUnitTestCase {
    * but don't copy it only any other classes
    */
   public function testMailingNullParams() {
-    $result = $this->callAPIFailure('MailingContact', 'get', null);
+    $result = $this->callAPIFailure('MailingContact', 'get', NULL);
   }
 
   public function testMailingContactGetFields() {
@@ -97,7 +97,7 @@ class api_v3_MailingContactTest extends CiviUnitTestCase {
    * belongs in the SyntaxConformance class
    */
   public function testMailingContactInvalidContactID() {
-    $params = array('contact_id' => 'This is not a number',);
+    $params = array('contact_id' => 'This is not a number');
     $result = $this->callAPIFailure('MailingContact', 'get', $params);
   }
 
@@ -163,7 +163,7 @@ class api_v3_MailingContactTest extends CiviUnitTestCase {
   /**
    * Test that the API returns only the "Bounced" mailings when instructed to do so
    */
-  public function testMailingContactBounced( ) {
+  public function testMailingContactBounced() {
     $op = new PHPUnit_Extensions_Database_Operation_Insert();
     //Create the User
     $op->execute($this->_dbconn,
index 95f1bc80764f6f50e4729722c862b240ba89f6e6..79ad0e46ec2c1b0e4dcdd13ab55c75c984286781 100644 (file)
@@ -30,7 +30,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_mailing_group_* functions
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class api_v3_MailingGroupTest extends CiviUnitTestCase {
   protected $_groupID;
index 1b86e3eddd01f061fe657eeafccd156b23c9ede0..a07977a6d5f3f0ef2e75556b2985bea8920e5753 100755 (executable)
@@ -29,7 +29,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_mailing_* functions
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class api_v3_MailingTest extends CiviUnitTestCase {
   protected $_groupID;
@@ -128,7 +128,7 @@ class api_v3_MailingTest extends CiviUnitTestCase {
 
   public function testMailerPreview() {
     // BEGIN SAMPLE DATA
-    $contactID =  $this->individualCreate();
+    $contactID = $this->individualCreate();
     $displayName = $this->callAPISuccess('contact', 'get', array('id' => $contactID));
     $displayName = $displayName['values'][$contactID]['display_name'];
     $this->assertTrue(!empty($displayName));
@@ -141,7 +141,7 @@ class api_v3_MailingTest extends CiviUnitTestCase {
     $params['options']['force_rollback'] = 1;
     // END SAMPLE DATA
 
-    $maxIDs =  array(
+    $maxIDs = array(
       'mailing' => CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_mailing'),
       'job' => CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_mailing_job'),
       'group' => CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_mailing_group'),
@@ -186,7 +186,7 @@ class api_v3_MailingTest extends CiviUnitTestCase {
     );
     // END SAMPLE DATA
 
-    $maxIDs =  array(
+    $maxIDs = array(
       'mailing' => CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_mailing'),
       'job' => CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_mailing_job'),
       'group' => CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_mailing_group'),
@@ -198,11 +198,11 @@ class api_v3_MailingTest extends CiviUnitTestCase {
 
     $preview = $create['values'][$create['id']]['api.MailingRecipients.get'];
     $previewIds = array_values(CRM_Utils_Array::collect('contact_id', $preview['values']));
-    $this->assertEquals(array((string)$contactIDs['includeme']), $previewIds);
+    $this->assertEquals(array((string) $contactIDs['includeme']), $previewIds);
     $previewEmails = array_values(CRM_Utils_Array::collect('api.email.getvalue', $preview['values']));
     $this->assertEquals(array('include.me@example.org'), $previewEmails);
     $previewNames = array_values(CRM_Utils_Array::collect('api.contact.getvalue', $preview['values']));
-    $this->assertTrue((bool)preg_match('/Includer Person/', $previewNames[0]), "Name 'Includer Person' should appear in '" . $previewNames[0] . '"');
+    $this->assertTrue((bool) preg_match('/Includer Person/', $previewNames[0]), "Name 'Includer Person' should appear in '" . $previewNames[0] . '"');
   }
 
   public function testMailerSendTest_email() {
@@ -466,6 +466,6 @@ SELECT event_queue_id, time_stamp FROM mail_{$type}_temp";
     return $createResult['id'];
   }
 
-//----------- civicrm_mailing_create ----------
+  //----------- civicrm_mailing_create ----------
 
 }
index 994ea8533c369bdd377a376d5bcf5b3279cac4fe..de24189e5b43d1b42490d2f1ebcce82fbfdf9dfd 100644 (file)
@@ -31,8 +31,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_membership_payment* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Member
+ * @package CiviCRM_APIv3
+ * @subpackage API_Member
  */
 
 class api_v3_MembershipPaymentTest extends CiviUnitTestCase {
@@ -66,7 +66,7 @@ class api_v3_MembershipPaymentTest extends CiviUnitTestCase {
       'thankyou_date' => '20080522',
     );
 
-    $this->_contribution = $this->callAPISuccess('contribution','create', $params);
+    $this->_contribution = $this->callAPISuccess('contribution', 'create', $params);
   }
 
   ///////////////// civicrm_membership_payment_create methods
index 560dda978ff00a5655abcfbbb35351b2cbfe1dd2..dd90b287ec110684966a16addfcdf656645e3d15 100644 (file)
@@ -37,7 +37,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase {
   protected $_membershipTypeID;
   protected $_membershipStatusID;
 
-  protected $_apiversion =3;
+  protected $_apiversion = 3;
 
   public function setUp() {
     parent::setUp();
@@ -115,14 +115,14 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase {
 
   public function testUpdate() {
     $params = array(
-        'name' => 'test membership status',    );
+        'name' => 'test membership status', );
     $result = $this->callAPISuccess('membership_status', 'create', $params);
     $id = $result['id'];
     $result = $this->callAPISuccess('membership_status', 'get', $params);
     $this->assertEquals('test membership status', $result['values'][$id]['name']);
     $newParams = array(
       'id' => $id,
-      'name' => 'renamed',    );
+      'name' => 'renamed', );
     $result = $this->callAPISuccess('membership_status', 'create', $newParams);
     $result = $this->callAPISuccess('membership_status', 'get', array('id' => $id));
     $this->assertEquals('renamed', $result['values'][$id]['name']);
index c04df37f0d6204ff49c48a8eae5633817e8b08f6..6818ef3aec63bb29b86571a2946ecdc5653966be 100644 (file)
@@ -28,8 +28,8 @@
 /**
  *  Test APIv3 civicrm_membership functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Member
+ * @package CiviCRM_APIv3
+ * @subpackage API_Member
  */
 
 
@@ -57,7 +57,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
     $this->_apiversion = 3;
     $this->_contactID = $this->individualCreate();
     $this->_membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $this->_contactID));
-    $this->_membershipTypeID2 = $this->membershipTypeCreate(array('period_type' => 'fixed','fixed_period_start_day' => '301', 'fixed_period_rollover_day' => '1111'));
+    $this->_membershipTypeID2 = $this->membershipTypeCreate(array('period_type' => 'fixed', 'fixed_period_start_day' => '301', 'fixed_period_rollover_day' => '1111'));
     $this->_membershipStatusID = $this->membershipStatusCreate('test status');
 
     CRM_Member_PseudoConstant::membershipType(NULL, TRUE);
@@ -131,7 +131,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
     $this->_membershipID = $this->contactMembershipCreate($this->_params);
     $params = array();
     $this->callAPISuccess('membership', 'get', $params);
-    $this->callAPISuccess('Membership', 'Delete', array('id' => $this->_membershipID,));
+    $this->callAPISuccess('Membership', 'Delete', array('id' => $this->_membershipID));
   }
 
   /**
@@ -353,8 +353,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
     $this->assertEquals($membership['values'][$this->_membershipID]['status_id'], $this->_membershipStatusID);
     $this->assertEquals($membership['values'][$this->_membershipID]['contact_id'], $this->_contactID);
 
-
-    $this->callAPISuccess('Membership', 'Delete', array('id' => $this->_membershipID,));
+    $this->callAPISuccess('Membership', 'Delete', array('id' => $this->_membershipID));
   }
 
   /**
@@ -564,7 +563,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
   public function testMembershipGetWithReturn() {
     $this->contactMembershipCreate($this->_params);
     $result = $this->callAPISuccess('membership', 'get', array('return' => 'end_date'));
-    foreach ($result['values']  as $membership) {
+    foreach ($result['values'] as $membership) {
       $this->assertEquals(array('id', 'end_date'), array_keys($membership));
     }
   }
@@ -781,7 +780,8 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
       'id' => $membershipID,
       'source' => 'changed',
       'contact_id' => $this->_contactID,
-      'status_id' => $this->_membershipStatusID,      'membership_type_id' => $this->_membershipTypeID,
+      'status_id' => $this->_membershipStatusID,
+    'membership_type_id' => $this->_membershipTypeID,
       'skipStatusCal' => 1,
     );
     $result = $this->callAPISuccess('membership', 'create', $params);
@@ -829,7 +829,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
     if ($objectName == 'Membership' && $op == 'edit') {
       $existingMembership = $this->callAPISuccessGetSingle('membership', array('id' => $params['id']));
       unset($params['id'], $params['membership_id']);
-      $params['join_date'] = $params['membership_start_date'] = $params['start_date']= date('Ymd000000', strtotime($existingMembership['start_date']));
+      $params['join_date'] = $params['membership_start_date'] = $params['start_date'] = date('Ymd000000', strtotime($existingMembership['start_date']));
       $params = array_merge($existingMembership, $params);
       $params['id'] = NULL;
     }
@@ -849,7 +849,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
       'end_date' => '2008-12-21',
       'source' => 'Payment',
       'is_override' => 1,
-      'status_id' => $this->_membershipStatusID,    );
+      'status_id' => $this->_membershipStatusID, );
 
     $this->callAPIFailure('membership', 'create', $params);
 
@@ -998,7 +998,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
   /**
    * Test that if datesdate are not set they not over-ridden if id is passed in
    */
-   public function testMembershipDatesNotOverridden() {
+  public function testMembershipDatesNotOverridden() {
     $result = $this->callAPISuccess($this->_entity, 'create', $this->_params);
     unset($this->_params['end_date'], $this->_params['start_date']);
     $this->_params['id'] = $result['id'];
@@ -1008,5 +1008,5 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
     $this->assertEquals('2009-01-21', $result['start_date']);
     $this->assertEquals('2009-12-21', $result['end_date']);
 
-   }
+  }
 }
index d963dafb8c67ff360a497abe4472a2719dab3a5a..103a673b86ed338b716831b9e412361ade2e7c13 100644 (file)
@@ -111,7 +111,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
       'duration_unit' => 'month',
       'duration_interval' => '10',
       'period_type' => 'rolling',
-      'visibility' => 'public',    );
+      'visibility' => 'public', );
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
     $this->assertEquals($membershiptype['error_message'],
       'Mandatory key(s) missing from params array: financial_type_id'
@@ -127,7 +127,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
       'domain_id' => '1',
       'minimum_fee' => '200',
       'duration_interval' => '10',
-      'visibility' => 'public',    );
+      'visibility' => 'public', );
 
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
     $this->assertEquals($membershiptype['error_message'],
@@ -144,7 +144,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
       'minimum_fee' => '200',
       'duration_unit' => 'month',
       'period_type' => 'rolling',
-      'visibility' => 'public',    );
+      'visibility' => 'public', );
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
     $this->assertEquals($membershiptype['error_message'],
       'Mandatory key(s) missing from params array: financial_type_id, duration_interval'
@@ -159,7 +159,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
       'minimum_fee' => '200',
       'duration_interval' => '10',
       'period_type' => 'rolling',
-      'visibility' => 'public',    );
+      'visibility' => 'public', );
 
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
     $this->assertEquals($membershiptype['error_message'],
@@ -177,7 +177,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
       'duration_unit' => 'month',
       'duration_interval' => '10',
       'period_type' => 'rolling',
-      'visibility' => 'public',    );
+      'visibility' => 'public', );
 
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
     $this->assertEquals($membershiptype['error_message'], 'Mandatory key(s) missing from params array: name');
@@ -221,7 +221,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
       'duration_unit' => 'month',
       'duration_interval' => '10',
       'period_type' => 'rolling',
-      'visibility' => 'public',    );
+      'visibility' => 'public', );
 
     $membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
     $this->assertEquals($membershiptype['error_message'], 'Mandatory key(s) missing from params array: domain_id');
@@ -232,7 +232,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
     $newMembOrgParams = array(
       'organization_name' => 'New membership organisation',
       'contact_type' => 'Organization',
-      'visibility' => 1,    );
+      'visibility' => 1, );
 
     // create a new contact to update this membership type to
     $newMembOrgID = $this->organizationCreate($newMembOrgParams);
@@ -244,7 +244,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase {
       'duration_unit' => 'month',
       'duration_interval' => '10',
       'period_type' => 'fixed',
-      'domain_id' => 1,    );
+      'domain_id' => 1, );
 
     $this->callAPISuccess('membership_type', 'update', $params);
 
index 007575a6f138ebf5dabc5134663773fdbc0877e4..0371baee23e6723c6ef025b79b78fea4aaee2fa8 100644 (file)
@@ -30,7 +30,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for Template API - civicrm_msg_template*
  *
- *  @package CiviCRM_APIv3
+ * @package CiviCRM_APIv3
  */
 class api_v3_MessageTemplateTest extends CiviUnitTestCase {
   /**
@@ -56,7 +56,7 @@ class api_v3_MessageTemplateTest extends CiviUnitTestCase {
     );
   }
 
-   /**
+  /**
    * Test create function succeeds
    */
   public function testCreate() {
@@ -76,9 +76,9 @@ class api_v3_MessageTemplateTest extends CiviUnitTestCase {
     $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__);
   }
 
-/**
- * Check the delete function succeeds
- */
+  /**
  * Check the delete function succeeds
  */
   public function testDelete() {
     $entity = $this->createTestEntity();
     $result = $this->callAPIAndDocument('MessageTemplate', 'delete', array('id' => $entity['id']), __FUNCTION__, __FILE__);
index 1845c46459ba0bde67a61a3e55a21068a2a65832..54943ac3f735e6aa46f3fc8ef3656b2ef04a36fb 100644 (file)
@@ -54,7 +54,7 @@ class api_v3_NoteTest extends CiviUnitTestCase {
       'note' => 'Hello!!! m testing Note',
       'contact_id' => $this->_contactID,
       'modified_date' => '2011-01-31',
-      'subject' => 'Test Note',    );
+      'subject' => 'Test Note', );
     $this->_note = $this->noteCreate($this->_contactID);
     $this->_noteID = $this->_note['id'];
   }
@@ -136,7 +136,7 @@ class api_v3_NoteTest extends CiviUnitTestCase {
 
     $this->assertArrayHasKey('id', $result);
     $note = array(
-      'id' => $result['id'],    );
+      'id' => $result['id'], );
     $this->noteDelete($note);
   }
 
@@ -148,7 +148,7 @@ class api_v3_NoteTest extends CiviUnitTestCase {
       'contact_id' => $this->_contactID,
       'modified_date' => '2011-01-31',
       'subject' => "With a '",
-      'sequential' => 1,    );
+      'sequential' => 1, );
     $result = $this->callAPISuccess('Note', 'Create', $params);
     $this->assertAPISuccess($result, 'in line ' . __LINE__);
     $this->assertEquals($result['values'][0]['note'], "Hello!!! ' testing Note", 'in line ' . __LINE__);
@@ -157,7 +157,7 @@ class api_v3_NoteTest extends CiviUnitTestCase {
 
     //CleanUP
     $note = array(
-      'id' => $result['id'],    );
+      'id' => $result['id'], );
     $this->noteDelete($note);
   }
 
@@ -170,7 +170,7 @@ class api_v3_NoteTest extends CiviUnitTestCase {
     $this->assertAPISuccess($apiResult);
     $this->assertEquals(date('Y-m-d'), date('Y-m-d', strtotime($apiResult['values'][$apiResult['id']]['modified_date'])));
     $this->noteDelete(array(
-      'id' => $apiResult['id'],      ));
+      'id' => $apiResult['id'], ));
   }
 
 
@@ -192,7 +192,7 @@ class api_v3_NoteTest extends CiviUnitTestCase {
   public function testUpdateWithoutContactId() {
     $params = array(
       'entity_id' => $this->_contactID,
-      'entity_table' => 'civicrm_contact',    );
+      'entity_table' => 'civicrm_contact', );
     $note = $this->callAPIFailure('note', 'create', $params,
       'Mandatory key(s) missing from params array: note'
     );
@@ -206,7 +206,7 @@ class api_v3_NoteTest extends CiviUnitTestCase {
       'id' => $this->_noteID,
       'contact_id' => $this->_contactID,
       'note' => 'Note1',
-      'subject' => 'Hello World',    );
+      'subject' => 'Hello World', );
 
     //Update Note
     $this->callAPISuccess('note', 'create', $params);
@@ -237,8 +237,7 @@ class api_v3_NoteTest extends CiviUnitTestCase {
     $params = array(
       'id' => 0,
     );
-    $deleteNote = $this->callAPIFailure('note', 'delete', $params
-      , 'Mandatory key(s) missing from params array: id');
+    $deleteNote = $this->callAPIFailure('note', 'delete', $params, 'Mandatory key(s) missing from params array: id');
   }
 
   /**
index f3c06ead33c33d19e92d1d468c81f6a489fad6ac..743815ff09a50bd59453329e91a890b311e7018d 100644 (file)
@@ -94,7 +94,8 @@ class api_v3_OptionGroupTest extends CiviUnitTestCase {
    */
 
   public function testGetOptionCreateFailOnDuplicate() {
-    $params = array(      'sequential' => 1,
+    $params = array(
+    'sequential' => 1,
       'name' => 'civicrm_dup entry',
       'is_reserved' => 1,
       'is_active' => 1,
@@ -114,7 +115,8 @@ class api_v3_OptionGroupTest extends CiviUnitTestCase {
                'options' => array('limit' => 5000),
       )
     );
-    $params = array(      'sequential' => 1,
+    $params = array(
+    'sequential' => 1,
       'name' => 'civicrm_rolback_test',
       'is_reserved' => 1,
       'is_active' => 1,
index 0a3c6e41d9d0d48dda56a8248f66815295b6e365..78e968504f12a59cdaa36bf1650b81822563f6b4 100644 (file)
@@ -74,7 +74,7 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
 
     $result = $this->callAPISuccess('option_value', 'get', array(
       'option_group_id' => 1,
-       'value' => '1',      ));
+       'value' => '1', ));
     $result2 = $this->callAPISuccess('option_value', 'get', array(
       'option_group_id' => 1,
         'value' => '1',
@@ -90,13 +90,15 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
     $description = "demonstrates use of Sort param (available in many api functions). Also, getsingle";
     $subfile     = 'SortOption';
     $result      = $this->callAPISuccess('option_value', 'getsingle', array(
-      'option_group_id' => 1,        'options' => array(
+      'option_group_id' => 1,
+    'options' => array(
           'sort' => 'label ASC',
           'limit' => 1,
         ),
       ));
     $params = array(
-      'option_group_id' => 1,      'options' => array(
+      'option_group_id' => 1,
+    'options' => array(
         'sort' => 'label DESC',
         'limit' => 1,
       ),
@@ -110,12 +112,13 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
    */
   public function testGetValueOptionPagination() {
     $pageSize = 10;
-    $page1 = $this->callAPISuccess('option_value', 'get', array('options' => array('limit' => $pageSize),      ));
+    $page1 = $this->callAPISuccess('option_value', 'get', array('options' => array('limit' => $pageSize) ));
     $page2 = $this->callAPISuccess('option_value', 'get', array(
-      'options' => array('limit' => $pageSize,
+      'options' => array(
+    'limit' => $pageSize,
           // if you use it for pagination, option.offset=pageSize*pageNumber
           'offset' => $pageSize - 1,
-        ),      ));
+        ), ));
     $this->assertEquals($pageSize, $page1['count'], "Check only 10 retrieved in the 1st page " . __LINE__);
     $this->assertEquals($pageSize, $page2['count'], "Check only 10 retrieved in the 2nd page " . __LINE__);
 
@@ -172,12 +175,14 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
   public function testCreateOptionSpecifyComponentID() {
     $result = $this->callAPISuccess('option_group', 'get', array(
       'name' => 'from_email_address',
-      'sequential' => 1,      'api.option_value.create' => array('component_id' => 2, 'name' => 'my@y.com'),
+      'sequential' => 1,
+    'api.option_value.create' => array('component_id' => 2, 'name' => 'my@y.com'),
     ));
     $this->assertAPISuccess($result);
     $optionValueId = $result['values'][0]['api.option_value.create']['id'];
     $component_id = $this->callAPISuccess('option_value', 'getvalue', array(
-      'id' => $optionValueId,      'return' => 'component_id',
+      'id' => $optionValueId,
+    'return' => 'component_id',
     ));
     $this->assertEquals(2, $component_id);
   }
@@ -188,7 +193,8 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
   public function testCreateOptionSpecifyComponent() {
     $result = $this->callAPISuccess('option_group', 'get', array(
       'name' => 'from_email_address',
-      'sequential' => 1,      'api.option_value.create' => array(
+      'sequential' => 1,
+    'api.option_value.create' => array(
         'component_id' => 'CiviContribute',
         'name' => 'my@y.com'
        ),
@@ -197,7 +203,8 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
     $this->assertAPISuccess($result);
     $optionValueId = $result['values'][0]['api.option_value.create']['id'];
     $component_id = $this->callAPISuccess('option_value', 'getvalue', array(
-      'id' => $optionValueId,      'return' => 'component_id',
+      'id' => $optionValueId,
+    'return' => 'component_id',
     ));
     $this->assertEquals(2, $component_id);
   }
@@ -208,7 +215,8 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
   public function testCreateOptionSpecifyComponentString() {
     $result = $this->callAPISuccess('option_group', 'get', array(
       'name' => 'from_email_address',
-      'sequential' => 1,      'api.option_value.create' => array(
+      'sequential' => 1,
+    'api.option_value.create' => array(
         'component_id' => 'CiviContribute',
         'name' => 'my@y.com'),
 
@@ -216,7 +224,8 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
     $this->assertAPISuccess($result);
     $optionValueId = $result['values'][0]['api.option_value.create']['id'];
     $component_id = $this->callAPISuccess('option_value', 'getvalue', array(
-      'id' => $optionValueId,      'return' => 'component_id',
+      'id' => $optionValueId,
+    'return' => 'component_id',
     ));
     $this->assertEquals(2, $component_id);
   }
@@ -228,21 +237,22 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
     $optionGroup = $this->callAPISuccess(
       'option_group', 'get', array(
       'name' => 'gender',
-      'sequential' => 1,    ));
+      'sequential' => 1, ));
     $this->assertAPISuccess($optionGroup);
     $params = array(
       'option_group_id' => $optionGroup['id'],
-      'label' => 'my@y.com',      'weight' => 3,
+      'label' => 'my@y.com',
+    'weight' => 3,
     );
-    $optionValue = $this->callAPISuccess('option_value', 'create',  $params);
+    $optionValue = $this->callAPISuccess('option_value', 'create', $params);
     $this->assertAPISuccess($optionValue);
     $params['weight'] = 4;
-    $optionValue2 = $this->callAPISuccess('option_value', 'create',  $params );
+    $optionValue2 = $this->callAPISuccess('option_value', 'create', $params );
     $this->assertAPISuccess($optionValue2);
     $options = $this->callAPISuccess('option_value', 'get', array('option_group_id' => $optionGroup['id']));
     $this->assertNotEquals($options['values'][$optionValue['id']]['value'], $options['values'][$optionValue2['id']]['value']);
 
-  //cleanup
+    //cleanup
     $this->callAPISuccess('option_value', 'delete', array('id' => $optionValue['id']));
     $this->callAPISuccess('option_value', 'delete', array('id' => $optionValue2['id']));
   }
@@ -253,10 +263,10 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
   public function testCreateOptionNoName() {
     $optionGroup = $this->callAPISuccess('option_group', 'get', array(
       'name' => 'gender',
-      'sequential' => 1,    ));
+      'sequential' => 1, ));
 
     $params = array('option_group_id' => $optionGroup['id'], 'label' => 'my@y.com');
-    $optionValue = $this->callAPISuccess('option_value', 'create',  $params);
+    $optionValue = $this->callAPISuccess('option_value', 'create', $params);
     $this->assertAPISuccess($optionValue);
     $this->getAndCheck($params, $optionValue['id'], 'option_value');
   }
@@ -266,7 +276,8 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
    * and deleted
    */
   public function testCRM11876CreateOptionPseudoConstantUpdated() {
-    $optionGroupID = $this->callAPISuccess('option_group', 'getvalue', array(      'name' => 'payment_instrument',
+    $optionGroupID = $this->callAPISuccess('option_group', 'getvalue', array(
+    'name' => 'payment_instrument',
       'return' => 'id',
     ));
     $newOption = (string) time();
@@ -297,9 +308,10 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
       array('option_group_id' => $og['id'], 'label' => 'test option value')
     );
     // update option value without 'option_group_id'
-    $res =     $this->callAPISuccess('option_value', 'create', array('id' => $ov['id'], 'is_active' => 0));
+    $res = $this->callAPISuccess('option_value', 'create', array('id' => $ov['id'], 'is_active' => 0));
     $val = $this->callAPISuccess('option_value', 'getvalue', array(
-      'id' => $ov['id'], 'return' => 'is_active',
+      'id' => $ov['id'],
+    'return' => 'is_active',
     ));
     $this->assertEquals($val, 0, "update with no group id is not proper" . __LINE__);
   }
@@ -318,7 +330,8 @@ class api_v3_OptionValueTest extends CiviUnitTestCase {
     // update option value without 'option_group_id'
     $this->callAPISuccess('option_value', 'create', array('id' => $ov['id'], 'option_group_id' => $og['id'], 'is_active' => 0));
     $val = $this->callAPISuccess('option_value', 'getvalue', array(
-      'id' => $ov['id'], 'return' => 'is_active',
+      'id' => $ov['id'],
+    'return' => 'is_active',
     ));
     $this->assertEquals($val, 0, "update with group id is not proper " . __LINE__);
   }
index af860c0ffd0d3fbc7122661a76f8d208f4c6a07f..b81b3511f4fe873fa96240943c66d283f6bf5873 100644 (file)
@@ -31,8 +31,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_participant_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Event
+ * @package CiviCRM_APIv3
+ * @subpackage API_Event
  */
 
 class api_v3_ParticipantPaymentTest extends CiviUnitTestCase {
@@ -87,7 +87,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase {
   public function testPaymentCreateMissingContributionId() {
     //Without Payment EntityID
     $params = array(
-      'participant_id' => $this->_participantID,    );
+      'participant_id' => $this->_participantID, );
 
     $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params);
   }
@@ -138,7 +138,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase {
   public function testPaymentUpdateMissingParticipantId() {
     //WithoutParticipantId
     $params = array(
-      'contribution_id' => '3',    );
+      'contribution_id' => '3', );
 
     $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params);
   }
@@ -148,7 +148,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase {
    */
   public function testPaymentUpdateMissingContributionId() {
     $params = array(
-      'participant_id' => $this->_participantID,    );
+      'participant_id' => $this->_participantID, );
     $participantPayment = $this->callAPIFailure('participant_payment', 'create', $params);
   }
 
@@ -164,7 +164,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase {
     $params = array(
       'id' => $this->_participantPaymentID,
       'participant_id' => $this->_participantID,
-      'contribution_id' => $contributionID,    );
+      'contribution_id' => $contributionID, );
 
     // Update Payment
     $participantPayment = $this->callAPISuccess('participant_payment', 'create', $params);
@@ -197,7 +197,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase {
     $params = array(
       'id' => $this->_participantPaymentID,
       'participant_id' => $this->_participantID,
-      'contribution_id' => $contributionID,    );
+      'contribution_id' => $contributionID, );
 
     // Update Payment
     $participantPayment = $this->callAPISuccess('participant_payment', 'create', $params);
@@ -232,7 +232,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase {
     $params = array(
       'id' => $this->_participantPaymentID,
       'participant_id' => $this->_participantID,
-      'contribution_id' => $contributionID,    );
+      'contribution_id' => $contributionID, );
 
     // Update Payment
     $participantPayment = $this->callAPISuccess('participant_payment', 'create', $params);
@@ -270,7 +270,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase {
    */
   public function testPaymentDeleteWithWrongID() {
     $params = array(
-      'id' => 0,    );
+      'id' => 0, );
     $deletePayment = $this->callAPIFailure('participant_payment', 'delete', $params);
     $this->assertEquals($deletePayment['error_message'], 'Error while deleting participantPayment');
   }
@@ -342,6 +342,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase {
           'status_id' => 1,
         );
         break;
+
       case 'payLater':
         $compareParams = array(
           'to_financial_account_id' => 7,
index 0299011f211447ba9d65f9e242c117576f1db281..a756e3646a53cb603fe5464266941e6b19b53143 100644 (file)
@@ -76,8 +76,7 @@ class api_v3_ParticipantStatusTypeTest extends CiviUnitTestCase {
     $entity = $this->callAPISuccess('participant_status_type', 'get', array());
     $result = $this->callAPIAndDocument('participant_status_type', 'delete', array('id' => $ParticipantStatusType['id']), __FUNCTION__, __FILE__);
     $getCheck = $this->callAPISuccess('ParticipantStatusType', 'GET', array('id' => $ParticipantStatusType['id']));
-    $checkDeleted = $this->callAPISuccess('ParticipantStatusType', 'Get', array(
-           ));
+    $checkDeleted = $this->callAPISuccess('ParticipantStatusType', 'Get', array());
     $this->assertEquals($entity['count'] - 1, $checkDeleted['count'], 'In line ' . __LINE__);
   }
 }
index eb68967238185e3427a135946337df4c224679a7..60d1bad52a70a11e3af9ea829ffc566f85aa94e4 100644 (file)
@@ -145,7 +145,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
     $this->assertEquals($result['values'][$this->_participantID]['event_id'], $this->_eventID, "in line " . __LINE__);
     $this->assertEquals($result['values'][$this->_participantID]['participant_register_date'], '2007-02-19 00:00:00', "in line " . __LINE__);
     $this->assertEquals($result['values'][$this->_participantID]['participant_source'], 'Wimbeldon', "in line " . __LINE__);
-      $params = array(
+    $params = array(
       'id' => $this->_participantID,
       'return' => 'id,participant_register_date,event_id',
 
@@ -178,7 +178,6 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
     $event = $this->eventCreate(NULL);
     $this->callAPISuccess('participant', 'create', array('event_id' => $event['id'], 'contact_id' => $this->_contactID));
 
-
     $description = "use nested get to get an event";
     $subfile     = "NestedEventGet";
     $params      = array(
@@ -197,7 +196,8 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
    */
   public function testGetWithReturnProperties() {
     $params = array(
-      'contact_id' => $this->_contactID,      'return.status_id' => 1,
+      'contact_id' => $this->_contactID,
+    'return.status_id' => 1,
       'return.participant_status_id' => 1,
       'options' => array('limit' => 1)
     );
@@ -210,7 +210,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
    */
   public function testGetContactIdOnly() {
     $params = array(
-      'contact_id' => $this->_contactID,    );
+      'contact_id' => $this->_contactID, );
     $participant = $this->callAPISuccess('participant', 'get', $params);
 
     $this->assertEquals($this->_participantID, $participant['id'],
@@ -237,7 +237,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
   public function testGetMultiMatchReturnFirst() {
     $params = array(
       'event_id' => $this->_eventID,
-      'rowCount' => 1,    );
+      'rowCount' => 1, );
 
     $participant = $this->callAPISuccess('participant', 'get', $params);
     $this->assertNotNull($participant['id']);
@@ -580,7 +580,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
       'role_id' => 3,
       'register_date' => '2006-01-21',
       'source' => 'US Open',
-      'event_level' => 'Donation',    );
+      'event_level' => 'Donation', );
     $participant = $this->callAPIFailure('participant', 'create', $params);
     $this->assertEquals($participant['error_message'], 'Mandatory key(s) missing from params array: event_id');
     // Cleanup created participant records.
@@ -597,7 +597,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
       'role_id' => 3,
       'register_date' => '2006-01-21',
       'source' => 'US Open',
-      'event_level' => 'Donation',    );
+      'event_level' => 'Donation', );
     $participant = $this->callAPIFailure('Participant', 'update', $params);
   }
 
@@ -616,7 +616,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
       'role_id' => 3,
       'register_date' => '2006-01-21',
       'source' => 'US Open',
-      'event_level' => 'Donation',    );
+      'event_level' => 'Donation', );
     $participant = $this->callAPIFailure('participant', 'create', $params);
     $result = $this->participantDelete($participantId);
   }
@@ -644,7 +644,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
    */
   public function testParticipantDelete() {
     $params = array(
-      'id' => $this->_participantID,    );
+      'id' => $this->_participantID, );
     $participant = $this->callAPISuccess('participant', 'delete', $params);
     $this->assertAPISuccess($participant);
     $this->assertDBState('CRM_Event_DAO_Participant', $this->_participantID, NULL, TRUE);
@@ -657,7 +657,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
    */
   public function testParticipantDeleteMissingID() {
     $params = array(
-      'event_id' => $this->_eventID,    );
+      'event_id' => $this->_eventID, );
     $participant = $this->callAPIFailure('participant', 'delete', $params);
     $this->assertNotNull($participant['error_message']);
   }
@@ -673,7 +673,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
     $params = array('contact_id' => $this->_contactID2, 'api.participant.delete' => 1);
     $participants = $this->callAPIAndDocument('Participant', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile, 'Get');
     $check = $this->callAPISuccess('participant', 'getcount', array());
-    $this->assertEquals(1, $check,"only one participant should be left. line " . __LINE__);
+    $this->assertEquals(1, $check, "only one participant should be left. line " . __LINE__);
   }
 
   /**
index 114e5d56ed69d7e8f967ec78ba1f69241a8a4f2c..e66bf7f873c57be0278931618d3c1dc797a9377e 100644 (file)
@@ -42,13 +42,13 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase {
     $this->_apiversion = 3;
   }
 
-//  function tearDown() {
-//
-//    $tablesToTruncate = array(
-//      'civicrm_payment_processor_type',
-//    );
-//    $this->quickCleanup($tablesToTruncate);
-//  }
+  //  function tearDown() {
+  //
+  //    $tablesToTruncate = array(
+  //      'civicrm_payment_processor_type',
+  //    );
+  //    $this->quickCleanup($tablesToTruncate);
+  //  }
 
   ///////////////// civicrm_payment_processor_type_add methods
 
@@ -57,7 +57,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase {
    */
   public function testPaymentProcessorTypeCreateWithoutName() {
     $payProcParams = array(
-      'is_active' => 1,    );
+      'is_active' => 1, );
     $result = $this->callAPIFailure('payment_processor_type', 'create', $payProcParams);
     $this->assertEquals($result['error_message'],
       'Mandatory key(s) missing from params array: name, title, class_name, billing_mode'
@@ -68,7 +68,8 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase {
    * Create payment processor type
    */
   public function testPaymentProcessorTypeCreate() {
-    $params = array(      'sequential' => 1,
+    $params = array(
+    'sequential' => 1,
       'name' => 'API_Test_PP',
       'title' => 'API Test Payment Processor',
       'class_name' => 'CRM_Core_Payment_APITest',
@@ -177,7 +178,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase {
       'title' => 'API Test Payment Processor 2',
       'class_name' => 'CRM_Core_Payment_APITest 2',
       'billing_mode' => 2,
-      'is_recur' => 0,    );
+      'is_recur' => 0, );
 
     $result = $this->callAPISuccess('payment_processor_type', 'create', $params);
     $this->assertNotNull($result['id']);
@@ -191,7 +192,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase {
    * Check with empty array
    */
   public function testPaymentProcessorTypesGetEmptyParams() {
-    $results = $this->callAPISuccess('payment_processor_type', 'get', array(    ));
+    $results = $this->callAPISuccess('payment_processor_type', 'get', array());
     $baselineCount = $results['count'];
 
     $firstRelTypeParams = array(
@@ -199,7 +200,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase {
       'title' => 'API Test Payment Processor',
       'class_name' => 'CRM_Core_Payment_APITest',
       'billing_mode' => 1,
-      'is_recur' => 0,    );
+      'is_recur' => 0, );
 
     $first = $this->callAPISuccess('PaymentProcessorType', 'Create', $firstRelTypeParams);
 
@@ -208,9 +209,9 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase {
       'title' => 'API Test Payment Processor 2',
       'class_name' => 'CRM_Core_Payment_APITest 2',
       'billing_mode' => 2,
-      'is_recur' => 0,    );
+      'is_recur' => 0, );
     $second = $this->callAPISuccess('PaymentProcessorType', 'Create', $secondRelTypeParams);
-    $result = $this->callAPISuccess('payment_processor_type', 'get', array(    ));
+    $result = $this->callAPISuccess('payment_processor_type', 'get', array());
 
     $this->assertEquals($baselineCount + 2, $result['count']);
     $this->assertAPISuccess($result);
@@ -225,7 +226,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase {
       'title' => 'API Test Payment Processor 11',
       'class_name' => 'CRM_Core_Payment_APITest_11',
       'billing_mode' => 1,
-      'is_recur' => 0,    );
+      'is_recur' => 0, );
 
     $first = $this->callAPISuccess('PaymentProcessorType', 'Create', $firstRelTypeParams);
 
@@ -234,11 +235,11 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase {
       'title' => 'API Test Payment Processor 12',
       'class_name' => 'CRM_Core_Payment_APITest_12',
       'billing_mode' => 2,
-      'is_recur' => 0,    );
+      'is_recur' => 0, );
     $second = $this->callAPISuccess('PaymentProcessorType', 'Create', $secondRelTypeParams);
 
     $params = array(
-      'name' => 'API_Test_PP_12',    );
+      'name' => 'API_Test_PP_12', );
     $result = $this->callAPISuccess('payment_processor_type', 'get', $params);
 
     $this->assertAPISuccess($result);
index e48b18f7c61b6913fb2efe97f942307f65e2ad2d..01141df86ba1dd802146cfa35d4e0f3a1b9432b8 100644 (file)
@@ -32,8 +32,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_phone* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Contact
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contact
  */
 class api_v3_PhoneTest extends CiviUnitTestCase {
   protected $_apiversion;
@@ -73,7 +73,7 @@ class api_v3_PhoneTest extends CiviUnitTestCase {
     //create one
     $create = $this->callAPISuccess('phone', 'create', $this->_params);
 
-    $result = $this->callAPIAndDocument('phone', 'delete', array('id' => $create['id'],), __FUNCTION__, __FILE__);
+    $result = $this->callAPIAndDocument('phone', 'delete', array('id' => $create['id']), __FUNCTION__, __FILE__);
     $this->assertEquals(1, $result['count'], 'In line ' . __LINE__);
     $get = $this->callAPISuccess('phone', 'get', array(
       'id' => $create['id'],
@@ -104,7 +104,7 @@ class api_v3_PhoneTest extends CiviUnitTestCase {
   public function testGet() {
     $phone = $this->callAPISuccess('phone', 'create', $this->_params);
     $params = array(
-      'contact_id' =>  $this->_params['contact_id'],
+      'contact_id' => $this->_params['contact_id'],
       'phone' => $phone['values'][$phone['id']]['phone'],
     );
     $result = $this->callAPIAndDocument('Phone', 'Get', $params, __FUNCTION__, __FILE__);
index 1cfbd7492885b5884ba0f99eb82080b1cf36ea30..836237e789df095a0d64329be3e5d44738958724 100644 (file)
@@ -30,7 +30,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for Pledge API - civicrm_pledge_*
  *
- *  @package CiviCRM_APIv3
+ * @package CiviCRM_APIv3
  */
 
 class api_v3_PledgePaymentTest extends CiviUnitTestCase {
@@ -145,7 +145,6 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase {
     $contribution = $this->callAPISuccess('contribution', 'create', $contributionParams);
     $params['contribution_id'] = $contribution['id'];
 
-
     $resultCont2 = $this->callAPISuccess('pledge_payment', 'create', $params);
     //make sure original is untouched & has not been updated
     $this->assertGreaterThan($result['id'], $resultCont2['id'], " in line " . __LINE__);
@@ -251,7 +250,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase {
     );
 
     $result = $this->callAPIAndDocument('pledge_payment', 'update', $updateparams, __FUNCTION__, __FILE__);
-    $this->getAndCheck(array_merge($params,$updateparams), $result['id'], $this->_entity);
+    $this->getAndCheck(array_merge($params, $updateparams), $result['id'], $this->_entity);
   }
 
   public function testDeletePledgePayment() {
index 2f7c073cddb0a090c303f74373ecbb785a489698..f67f9e0e21b3fd963e4e9fd01be17d2910b0e6fb 100644 (file)
@@ -30,7 +30,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  * Test class for Pledge API - civicrm_pledge_*
  *
- *  @package CiviCRM_APIv3
+ * @package CiviCRM_APIv3
  */
 class api_v3_PledgeTest extends CiviUnitTestCase {
 
@@ -43,7 +43,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
   protected $_params;
   protected $_entity;
   protected $scheduled_date;
-  public $DBResetRequired = True;
+  public $DBResetRequired = TRUE;
 
   public function setUp() {
     $this->_apiversion = 3;
@@ -91,7 +91,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
 
     $result = $this->callAPISuccess($this->_entity, 'create', $params);
     $this->assertAPISuccess($result, " testCreateWithCustom ");
-    $this->assertAPISuccess($result,  ' in line ' . __LINE__);
+    $this->assertAPISuccess($result, ' in line ' . __LINE__);
     $getparams = array('id' => $result['id'], 'return.custom_' . $ids['custom_field_id'] => 1);
     $check = $this->callAPISuccess($this->_entity, 'get', $getparams);
     $this->callAPISuccess('pledge', 'delete', array('id' => $check['id']));
@@ -111,7 +111,6 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
 
   public function testGetPledge() {
 
-
     $this->_pledge = $this->callAPISuccess('pledge', 'create', $this->_params);
     $params = array(
       'pledge_id' => $this->_pledge['id'],
@@ -129,7 +128,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
     $this->assertEquals($pledge['pledge_next_pay_amount'], 20.00, 'in line' . __LINE__);
 
     $params2 = array(
-      'pledge_id' => $this->_pledge['id'],    );
+      'pledge_id' => $this->_pledge['id'], );
     $pledge = $this->callAPISuccess('pledge', 'delete', $params2);
   }
   /**
@@ -139,7 +138,8 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
 
     $this->_pledge = $this->callAPISuccess('pledge', 'create', $this->_params);
     $params = array(
-      'pledge_id' => $this->_pledge['id'],      'return.pledge_financial_type' => 1,
+      'pledge_id' => $this->_pledge['id'],
+    'return.pledge_financial_type' => 1,
     );
     $result = $this->callAPISuccess('pledge', 'get', $params);
     $pledge = $result['values'][$this->_pledge['id']];
@@ -149,12 +149,13 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
   /**
    * Test  'return.pledge_contribution_type' => 1 works
    * This is for legacy compatibility
-  */
+   */
   public function testGetPledgewithReturnLegacy() {
 
     $this->_pledge = $this->callAPISuccess('pledge', 'create', $this->_params);
     $params = array(
-      'pledge_id' => $this->_pledge['id'],      'return.pledge_financial_type' => 1,
+      'pledge_id' => $this->_pledge['id'],
+    'return.pledge_financial_type' => 1,
     );
     $result = $this->callAPISuccess('pledge', 'get', $params);
     $pledge = $result['values'][$this->_pledge['id']];
@@ -212,15 +213,18 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
       'create_date' => 'first saturday of march last year',
     );
     $pledge2 = $this->callAPISuccess('pledge', 'create', array_merge($this->_params, $overdueParams));
-    $params = array(      'pledge_is_test' => 0,
+    $params = array(
+    'pledge_is_test' => 0,
       'rowCount' => 1,
     );
     $result = $this->callAPISuccess('pledge', 'get', $params);
 
-    $resultSortedAsc = $this->callAPISuccess('pledge', 'get', array(      'rowCount' => 1,
+    $resultSortedAsc = $this->callAPISuccess('pledge', 'get', array(
+    'rowCount' => 1,
       'sort' => 'start_date ASC',
     ));
-    $resultSortedDesc = $this->callAPISuccess('pledge', 'get', array(      'rowCount' => 1,
+    $resultSortedDesc = $this->callAPISuccess('pledge', 'get', array(
+    'rowCount' => 1,
       'sort' => 'start_date DESC',
     ));
 
@@ -322,9 +326,9 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
   }
 
   /*
- * test that using original_installment_amount rather than pledge_original_installment_amount works
- * Pledge field behaviour is a bit random & so pledge has come to try to handle both unique & non -unique fields
- */
 * test that using original_installment_amount rather than pledge_original_installment_amount works
 * Pledge field behaviour is a bit random & so pledge has come to try to handle both unique & non -unique fields
 */
   public function testCreatePledgeWithNonUnique() {
     $params = $this->_params;
     $params['original_installment_amount'] = $params['pledge_original_installment_amount'];
@@ -344,7 +348,6 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
 
   public function testCreateCancelPledge() {
 
-
     $result = $this->callAPISuccess('pledge', 'create', $this->_params);
     $this->assertEquals(2, $result['values'][0]['status_id'], "in line " . __LINE__);
     $cancelparams = array('sequential' => 1, 'id' => $result['id'], 'pledge_status_id' => 3);
@@ -377,7 +380,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
     $pledgeID = $this->pledgeCreate($this->_individualId);
     $old_params = array(
       'id' => $pledgeID,
-      'sequential' => 1,    );
+      'sequential' => 1, );
     $original = $this->callAPISuccess('pledge', 'get', $old_params);
     //Make sure it came back
     $this->assertEquals($original['values'][0]['pledge_id'], $pledgeID, 'In line ' . __LINE__);
@@ -387,7 +390,6 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
     $old_frequency_interval = $original['values'][0]['pledge_frequency_interval'];
     $old_status_id = $original['values'][0]['pledge_status'];
 
-
     //check against values in CiviUnitTestCase::createPledge()
     $this->assertEquals($old_contact_id, $this->_individualId, 'In line ' . __LINE__);
     $this->assertEquals($old_frequency_unit, 'year', 'In line ' . __LINE__);
@@ -400,7 +402,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
       'amount' => 100,
       'financial_type_id' => 1,
       'start_date' => date('Ymd'),
-      'installments' => 10,    );
+      'installments' => 10, );
 
     $pledge = $this->callAPISuccess('pledge', 'create', $params);
     $new_params = array(
@@ -422,7 +424,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
     $pledgeID = $this->pledgeCreate($this->_individualId);
     $old_params = array(
       'id' => $pledgeID,
-      'sequential' => 1,    );
+      'sequential' => 1, );
     $original = $this->callAPISuccess('pledge', 'get', $old_params);
     //Make sure it came back
     $this->assertEquals($original['values'][0]['pledge_id'], $pledgeID, 'In line ' . __LINE__);
@@ -432,7 +434,6 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
     $old_frequency_interval = $original['values'][0]['pledge_frequency_interval'];
     $old_status_id = $original['values'][0]['pledge_status'];
 
-
     //check against values in CiviUnitTestCase::createPledge()
     $this->assertEquals($old_contact_id, $this->_individualId, 'In line ' . __LINE__);
     $this->assertEquals($old_frequency_unit, 'year', 'In line ' . __LINE__);
index eb7487600d50ab63323ffe5030fa562959e794ba..f0f4956259023de33a2c3b87cc85c66454dfd662 100644 (file)
@@ -55,10 +55,11 @@ class api_v3_PriceFieldTest extends CiviUnitTestCase {
       'is_reserved' => 1,
     );
 
-    $price_set = $this->callAPISuccess('price_set', 'create',$priceSetparams);
+    $price_set = $this->callAPISuccess('price_set', 'create', $priceSetparams);
     $this->priceSetID = $price_set['id'];
 
-    $this->_params = array(      'price_set_id' => $this->priceSetID,
+    $this->_params = array(
+    'price_set_id' => $this->priceSetID,
       'name' => 'grassvariety',
       'label' => 'Grass Variety',
       'html_type' => 'Text',
@@ -74,7 +75,7 @@ class api_v3_PriceFieldTest extends CiviUnitTestCase {
     );
     $this->quickCleanup($tablesToTruncate);
 
-    $delete = $this->callAPISuccess('PriceSet','delete', array(
+    $delete = $this->callAPISuccess('PriceSet', 'delete', array(
            'id' => $this->priceSetID,
     ));
 
@@ -97,16 +98,16 @@ class api_v3_PriceFieldTest extends CiviUnitTestCase {
     );
     $getResult = $this->callAPIAndDocument($this->_entity, 'get', $getParams, __FUNCTION__, __FILE__);
     $this->assertEquals(1, $getResult['count'], 'In line ' . __LINE__);
-    $this->callAPISuccess('price_field','delete', array('id' => $createResult['id']));
+    $this->callAPISuccess('price_field', 'delete', array('id' => $createResult['id']));
   }
 
   public function testDeletePriceField() {
-    $startCount = $this->callAPISuccess($this->_entity, 'getcount', array(      ));
+    $startCount = $this->callAPISuccess($this->_entity, 'getcount', array());
     $createResult = $this->callAPISuccess($this->_entity, 'create', $this->_params);
     $deleteParams = array('id' => $createResult['id']);
     $deleteResult = $this->callAPIAndDocument($this->_entity, 'delete', $deleteParams, __FUNCTION__, __FILE__);
     $this->assertAPISuccess($deleteResult, 'In line ' . __LINE__);
-    $endCount = $this->callAPISuccess($this->_entity, 'getcount', array(      ));
+    $endCount = $this->callAPISuccess($this->_entity, 'getcount', array());
     $this->assertEquals($startCount, $endCount, 'In line ' . __LINE__);
   }
 
index f1073d0341b9522a1b74f117aa43b22c4a2da859..c427acad43ea4029b569673a689c9a946bfddf3d 100644 (file)
@@ -56,7 +56,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
       'is_reserved' => 1,
     );
 
-    $price_set = $this->callAPISuccess('price_set', 'create',$priceSetparams);
+    $price_set = $this->callAPISuccess('price_set', 'create', $priceSetparams);
     $this->priceSetID = $price_set['id'];
 
     $priceFieldparams = array(
@@ -67,7 +67,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
       'is_enter_qty' => 1,
       'is_active' => 1,
     );
-    $priceField = $this->callAPISuccess('price_field','create', $priceFieldparams);
+    $priceField = $this->callAPISuccess('price_field', 'create', $priceFieldparams);
     $this->priceFieldID = $priceField['id'];
     $this->_params = array(
       'price_field_id' => $this->priceFieldID,
@@ -87,7 +87,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
       'is_quick_config' => 1,
       'is_reserved' => 1,
     );
-    $price_set1 = $this->callAPISuccess('price_set', 'create',$priceSetparams1);
+    $price_set1 = $this->callAPISuccess('price_set', 'create', $priceSetparams1);
     $this->priceSetID1 = $price_set1['id'];
     $priceFieldparams1 = array(
       'price_set_id' => $this->priceSetID1,
@@ -97,7 +97,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
       'is_enter_qty' => 1,
       'is_active' => 1,
     );
-    $priceField1 = $this->callAPISuccess('price_field','create', $priceFieldparams1);
+    $priceField1 = $this->callAPISuccess('price_field', 'create', $priceFieldparams1);
     $this->priceFieldID1 = $priceField1['id'];
   }
 
@@ -108,16 +108,16 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
     );
     $this->quickCleanup($tablesToTruncate);
     $this->membershipTypeDelete(array('id' => $this->_membershipTypeID));
-    $this->callAPISuccess('PriceField','delete', array(
+    $this->callAPISuccess('PriceField', 'delete', array(
         'id' => $this->priceFieldID1,
     ));
-    $this->callAPISuccess('PriceSet','delete', array(
+    $this->callAPISuccess('PriceSet', 'delete', array(
       'id' => $this->priceSetID1,
     ));
-    $this->callAPISuccess('PriceField','delete', array(
+    $this->callAPISuccess('PriceField', 'delete', array(
         'id' => $this->priceFieldID,
     ));
-    $delete = $this->callAPISuccess('PriceSet','delete', array(
+    $delete = $this->callAPISuccess('PriceSet', 'delete', array(
       'id' => $this->priceSetID,
     ));
 
@@ -141,7 +141,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
     );
     $getResult = $this->callAPIAndDocument($this->_entity, 'get', $getParams, __FUNCTION__, __FILE__);
     $this->assertEquals(1, $getResult['count'], 'In line ' . __LINE__);
-    $this->callAPISuccess('price_field_value','delete', array('id' => $createResult['id']));
+    $this->callAPISuccess('price_field_value', 'delete', array('id' => $createResult['id']));
   }
 
   public function testDeletePriceFieldValue() {
@@ -162,7 +162,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
   public function testCreatePriceFieldValuewithMultipleTerms() {
     $params = array(
       'price_field_id' => $this->priceFieldID1,
-      'membership_type_id' =>  $this->_membershipTypeID,
+      'membership_type_id' => $this->_membershipTypeID,
       'name' => 'memType1',
       'label' => 'memType1',
       'amount' => 90,
@@ -178,7 +178,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
   public function testGetPriceFieldValuewithMultipleTerms() {
     $params1 = array(
       'price_field_id' => $this->priceFieldID1,
-      'membership_type_id' =>  $this->_membershipTypeID,
+      'membership_type_id' => $this->_membershipTypeID,
       'name' => 'memType1',
       'label' => 'memType1',
       'amount' => 90,
@@ -188,7 +188,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
      );
     $params2 = array(
       'price_field_id' => $this->priceFieldID1,
-      'membership_type_id' =>  $this->_membershipTypeID,
+      'membership_type_id' => $this->_membershipTypeID,
       'name' => 'memType2',
       'label' => 'memType2',
       'amount' => 120,
@@ -198,9 +198,9 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase {
      );
     $result1 = $this->callAPISuccess($this->_entity, 'create', $params1);
     $result2 = $this->callAPISuccess($this->_entity, 'create', $params2);
-    $result = $this->callAPISuccess($this->_entity, 'get', array('price_field_id' =>$this->priceFieldID1 ));
+    $result = $this->callAPISuccess($this->_entity, 'get', array('price_field_id' => $this->priceFieldID1 ));
     $this->assertEquals(2, $result['count'], 'In line ' . __LINE__);
-    $this->callAPISuccess($this->_entity,'delete', array('id' => $result1['id']));
-    $this->callAPISuccess($this->_entity,'delete', array('id' => $result2['id']));
+    $this->callAPISuccess($this->_entity, 'delete', array('id' => $result1['id']));
+    $this->callAPISuccess($this->_entity, 'delete', array('id' => $result2['id']));
   }
 }
index e23c14f069939eb0c39058c41af8131e2065063f..84f9a4797bf0109d4554b7ecef03d4d5516b67cf 100644 (file)
@@ -42,7 +42,7 @@ class api_v3_PriceSetTest extends CiviUnitTestCase {
   public function setUp() {
     parent::setUp();
     $this->_params = array(
-#     [domain_id] =>
+    #     [domain_id] =>
       'name' => 'default_goat_priceset',
       'title' => 'Goat accessories',
       'is_active' => 1,
@@ -78,7 +78,7 @@ class api_v3_PriceSetTest extends CiviUnitTestCase {
       'title' => 'Some Price Set',
       'is_active' => 1,
       'financial_type_id' => 1,
-      'extends' => array(1,2),
+      'extends' => array(1, 2),
     );
     $createResult = $this->callAPIAndDocument($this->_entity, 'create', $createParams, __FUNCTION__, __FILE__);
 
@@ -149,7 +149,7 @@ class api_v3_PriceSetTest extends CiviUnitTestCase {
   }
 
   public static function setUpBeforeClass() {
-      // put stuff here that should happen before all tests in this unit
+    // put stuff here that should happen before all tests in this unit
   }
 
   public static function tearDownAfterClass(){
index 1c4bd281fa9dbb06410e66b3eddf009cadbe9fca..1d8fef5839c0751d48bbe6cf310d47c5394115f9 100644 (file)
@@ -44,9 +44,9 @@ class api_v3_ProductTest extends CiviUnitTestCase {
     );
   }
 
-//  function tearDown() {
-//    $this->quickCleanup(array('civicrm_product'), TRUE);
-//  }
+  //  function tearDown() {
+  //    $this->quickCleanup(array('civicrm_product'), TRUE);
+  //  }
 
   public function testGetFields() {
     $fields = $this->callAPISuccess($this->_entity, 'getfields', array('action' => 'create'));
index 130968c76da5e7e64cb282033cd96a7ffed01cf0..c1d0d51e9ce659ee4dffe75cb3c251bd305ced31 100644 (file)
@@ -34,7 +34,7 @@ require_once 'tests/phpunit/CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_profile_* functions
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class api_v3_ProfileTest extends CiviUnitTestCase {
   protected $_apiversion;
@@ -173,8 +173,8 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
   public function testProfileGetMultipleHasBillingLocation() {
     $individual = $this->_createIndividualContact();
     $contactId  = key($individual);
-    $this->callAPISuccess('address', 'create', array('contact_id' => $contactId , 'street_address' => '25 Big Street', 'city' => 'big city', 'location_type_id' => 5));
-    $this->callAPISuccess('email', 'create', array('contact_id' => $contactId , 'email' => 'big@once.com', 'location_type_id' => 2, 'is_billing' => 1));
+    $this->callAPISuccess('address', 'create', array('contact_id' => $contactId, 'street_address' => '25 Big Street', 'city' => 'big city', 'location_type_id' => 5));
+    $this->callAPISuccess('email', 'create', array('contact_id' => $contactId, 'email' => 'big@once.com', 'location_type_id' => 2, 'is_billing' => 1));
 
     $expected = current($individual);
 
@@ -439,7 +439,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
     }
     unset($params['email-primary']);
     $params['email-Primary'] = 'my@mail.com';
-    $this->callAPISuccess('profile', 'submit',  $params);
+    $this->callAPISuccess('profile', 'submit', $params);
     $profileDetails = $this->callAPISuccess('profile', 'get', $getParams);
     $this->assertEquals('my@mail.com', $profileDetails['values']['email-Primary']);
   }
@@ -458,7 +458,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
     $this->assertEquals(array_keys($membershipTypes['values']), array_keys($getoptions['values']));
     $this->assertEquals(array_keys($membershipTypes['values']), array_keys($profileFields['values']['membership_type_id']['options']));
 
-}
+  }
 
   /**
    * Test that the fields are returned in the right order despite the faffing around that goes on
@@ -827,7 +827,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
     // via the api
 
     $ufGroupParams = array(
-      'group_type' => 'Individual,Contact',// really we should remove this & test the ufField create sets it
+      'group_type' => 'Individual,Contact', // really we should remove this & test the ufField create sets it
       'name' => 'test_individual_contact_profile',
       'title' => 'Flat Coffee',
       'api.uf_field.create' => array(
index 2a8eeaf2019e82b9c6fda8afcd7987cb1a14d839..fb7a8c6a53b6e51104ab510b53f5536b26877a03 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 require_once 'CiviTest/CiviUnitTestCase.php';
 
@@ -177,7 +177,8 @@ class api_v3_RelationshipTest extends CiviUnitTestCase {
       'contact_id_a' => $this->_cId_a,
       'contact_id_b' => $this->_cId_b,
       'relationship_type_id' => $this->_relTypeID,
-      'start_date' => '2008-12-20', 'end_date' => NULL,
+      'start_date' => '2008-12-20',
+    'end_date' => NULL,
       'is_active' => 1,
     );
     $relationship = $this->callAPISuccess('relationship', 'create', $params);
@@ -430,7 +431,6 @@ class api_v3_RelationshipTest extends CiviUnitTestCase {
       'is_active' => 1,
     );
 
-
     $result = $this->callAPISuccess('CustomField', 'create', $params);
 
     $customField = NULL;
@@ -677,7 +677,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase {
   }
 
   public function testGetIsCurrent() {
-    $rel2Params =array(
+    $rel2Params = array(
       'contact_id_a' => $this->_cId_a,
       'contact_id_b' => $this->_cId_b2,
       'relationship_type_id' => $this->_relTypeID,
@@ -698,17 +698,17 @@ class api_v3_RelationshipTest extends CiviUnitTestCase {
     $this->AssertEquals($rel1['id'], $result['id']);
 
     // now try not started
-    $rel2Params['is_active'] =1;
-    $rel2Params['start_date'] ='tomorrow';
+    $rel2Params['is_active'] = 1;
+    $rel2Params['start_date'] = 'tomorrow';
     $rel2 = $this->callAPISuccess('relationship', 'create', $rel2Params);
     $result = $this->callAPISuccess('relationship', 'get', $getParams);
     $this->assertEquals($result['count'], 1);
     $this->AssertEquals($rel1['id'], $result['id']);
 
     // now try finished
-    $rel2Params['is_active'] =1;
-    $rel2Params['start_date'] ='last week';
-    $rel2Params['end_date'] ='yesterday';
+    $rel2Params['is_active'] = 1;
+    $rel2Params['start_date'] = 'last week';
+    $rel2Params['end_date'] = 'yesterday';
     $rel2 = $this->callAPISuccess('relationship', 'create', $rel2Params);
   }
   /*
@@ -749,11 +749,11 @@ class api_v3_RelationshipTest extends CiviUnitTestCase {
 
     $rel1 = $this->callAPISuccess('relationship', 'create', $this->_params);
     $rel2 = $this->callAPISuccess('relationship', 'create', array_merge($this->_params,
-      array('relationship_type_id' => $relationType2,)));
+      array('relationship_type_id' => $relationType2)));
     $rel3 = $this->callAPISuccess('relationship', 'create', array_merge($this->_params,
-        array('relationship_type_id' => $relationType3,)));
+        array('relationship_type_id' => $relationType3)));
     $rel4 = $this->callAPISuccess('relationship', 'create', array_merge($this->_params,
-        array('relationship_type_id' => $relationType4,)));
+        array('relationship_type_id' => $relationType4)));
 
     $getParams = array(
       'relationship_type_id' => array('IN' => array($relationType2, $relationType3))
@@ -791,7 +791,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase {
     );
     $result = $this->callAPIAndDocument('relationship', 'get', $getParams, __FUNCTION__, __FILE__, $description, $subfile);
     $this->assertEquals($result['count'], 1);
-    $this->AssertEquals(array($rel1['id'],), array_keys($result['values']));
+    $this->AssertEquals(array($rel1['id']), array_keys($result['values']));
 
   }
   /**
@@ -895,7 +895,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase {
    * an incorrect one
    */
   public function testGetRelationshipByTypeDAO() {
-    $this->ids['relationship'] = $this->callAPISuccess($this->_entity, 'create', array('format.only_id' => TRUE,)  + $this->_params);
+    $this->ids['relationship'] = $this->callAPISuccess($this->_entity, 'create', array('format.only_id' => TRUE) + $this->_params);
     $result = $this->callAPISuccess($this->_entity, 'getcount', array(
       'contact_id_a' => $this->_cId_a,),
     1);
@@ -1047,7 +1047,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase {
    * an incorrect one
    */
   public function testGetRelationshipByMembershipTypeReciprocal() {
-      $created = $this->callAPISuccess($this->_entity, 'create', $this->_params);
+    $created = $this->callAPISuccess($this->_entity, 'create', $this->_params);
     $org3 = $this->organizationCreate();
 
     $relType2 = 5; // lets just assume built in ones aren't being messed with!
index d0b15dbc6b7b9e7c56bf046e4f5ca5b7fcb851e6..da1daf94c45de5874d15a5dbfc2ab99b10432342 100644 (file)
@@ -178,7 +178,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase {
     $id = $this->_relationshipTypeCreate();
     // create sample relationship type.
     $params = array(
-      'id' =>  $id,
+      'id' => $id,
     );
     $result = $this->callAPIAndDocument('relationship_type', 'delete', $params, __FUNCTION__, __FILE__);
     $this->assertAPIDeleted('relationship_type', $id);
index fc739265ca58c79a2d351bb26e1c5e7c08e51ad8..b661d685a1885bf1ff1394b9cc7d02757401d44b 100644 (file)
@@ -31,8 +31,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_report_instance_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Report
+ * @package CiviCRM_APIv3
+ * @subpackage API_Report
  */
 
 class api_v3_ReportTemplateTest extends CiviUnitTestCase {
@@ -63,7 +63,8 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase {
       WHERE name = "CRM_Report_Form_Examplez"');
 
     // change component to null
-    $result = $this->callAPISuccess('ReportTemplate', 'create', array(      'id' => $entityId,
+    $result = $this->callAPISuccess('ReportTemplate', 'create', array(
+    'id' => $entityId,
       'component' => '',
     ));
     $this->assertAPISuccess($result);
@@ -76,7 +77,8 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase {
       AND component_id IS NULL');
 
     // deactivate
-    $result = $this->callAPISuccess('ReportTemplate', 'create', array(      'id' => $entityId,
+    $result = $this->callAPISuccess('ReportTemplate', 'create', array(
+    'id' => $entityId,
       'is_active' => 0,
     ));
     $this->assertAPISuccess($result);
@@ -88,7 +90,8 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase {
       WHERE name = "CRM_Report_Form_Examplez"');
 
     // activate
-    $result = $this->callAPISuccess('ReportTemplate', 'create', array(      'id' => $entityId,
+    $result = $this->callAPISuccess('ReportTemplate', 'create', array(
+    'id' => $entityId,
       'is_active' => 1,
     ));
     $this->assertAPISuccess($result);
@@ -139,7 +142,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase {
     if(stristr($reportID, 'has existing issues')) {
       $this->markTestIncomplete($reportID);
     }
-     $result = $this->callAPISuccess('report_template', 'getrows', array(
+    $result = $this->callAPISuccess('report_template', 'getrows', array(
        'report_id' => $reportID,
     ));
   }
@@ -151,7 +154,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase {
     if(stristr($reportID, 'has existing issues')) {
       $this->markTestIncomplete($reportID);
     }
-    if(in_array($reportID , array('contribute/softcredit', 'contribute/bookkeeping'))) {
+    if(in_array($reportID, array('contribute/softcredit', 'contribute/bookkeeping'))) {
       $this->markTestIncomplete($reportID . " has non enotices when calling statistics fn");
     }
     $description = "Get Statistics from a report (note there isn't much data to get in the test DB :-(";
@@ -166,7 +169,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase {
    */
   public static function getReportTemplates() {
     $reportsToSkip = array(
-        'activity' =>  'does not respect function signature on from clause',
+        'activity' => 'does not respect function signature on from clause',
         'walklist' => 'Notice: Undefined index: type in CRM_Report_Form_Walklist_Walklist line 155.
                        (suspect the select function should be removed in favour of the parent (state province field)
                       also, type should be added to state province & others? & potentially getAddressColumns fn should be
@@ -196,8 +199,6 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase {
       }
     }
 
-
-
     return $reportTemplates;
   }
 }
index 8e4d31b0922f7b887f8bd3ef22bc9c65b96885d1..d276964fb88c5802bae7ca918eb4395142903c4e 100644 (file)
@@ -31,8 +31,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_setting_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Core
+ * @package CiviCRM_APIv3
+ * @subpackage API_Core
  */
 
 /**
@@ -53,21 +53,21 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $params = array(
       'name' => 'Default Domain Name',
     );
-    $result = $this->callAPISuccess( 'domain','get',$params);
+    $result = $this->callAPISuccess( 'domain', 'get', $params);
     if(empty($result['id'])){
-      $result = $this->callAPISuccess( 'domain','create',$params );
+      $result = $this->callAPISuccess( 'domain', 'create', $params );
     }
 
     $params['name'] = 'Second Domain';
-    $result = $this->callAPISuccess( 'domain','get',$params);
+    $result = $this->callAPISuccess( 'domain', 'get', $params);
     if(empty($result['id'])){
-      $result = $this->callAPISuccess( 'domain','create',$params );
+      $result = $this->callAPISuccess( 'domain', 'create', $params );
     }
     $this->_domainID2 = $result['id'];
     $params['name'] = 'A-team domain';
-    $result = $this->callAPISuccess( 'domain','get',$params);
+    $result = $this->callAPISuccess( 'domain', 'get', $params);
     if(empty($result['id'])){
-      $result = $this->callAPISuccess( 'domain','create',$params );
+      $result = $this->callAPISuccess( 'domain', 'create', $params );
     }
     $this->_domainID3 = $result['id'];
     $this->_currentDomain = CRM_Core_Config::domainID();
@@ -77,7 +77,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
   public function tearDown() {
     CRM_Utils_Hook::singleton()->reset();
     parent::tearDown();
-    $this->callAPISuccess('system','flush', array());
+    $this->callAPISuccess('system', 'flush', array());
     $this->quickCleanup(array('civicrm_domain'));
   }
 
@@ -101,7 +101,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $description = 'Demonstrate return from getfields';
     $result = $this->callAPISuccess('setting', 'getfields', array());
     $this->assertArrayHasKey('customCSSURL', $result['values']);
-    $this->callAPISuccess('system','flush', array());
+    $this->callAPISuccess('system', 'flush', array());
   }
 
   /**
@@ -109,8 +109,8 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetFieldsCaching() {
     $settingsMetadata = array();
-    CRM_Core_BAO_Cache::setItem($settingsMetadata,'CiviCRM setting Specs', 'settingsMetadata__');
-    CRM_Core_BAO_Cache::setItem($settingsMetadata,'CiviCRM setting Spec', 'All');
+    CRM_Core_BAO_Cache::setItem($settingsMetadata, 'CiviCRM setting Specs', 'settingsMetadata__');
+    CRM_Core_BAO_Cache::setItem($settingsMetadata, 'CiviCRM setting Spec', 'All');
     $result = $this->callAPISuccess('setting', 'getfields', array());
     $this->assertArrayNotHasKey('customCSSURL', $result['values']);
     $this->quickCleanup(array('civicrm_cache'));
@@ -120,7 +120,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $params = array('name' => 'advanced_search_options');
     $result = $this->callAPISuccess('setting', 'getfields', $params);
     $this->assertArrayNotHasKey('customCSSURL', $result['values']);
-    $this->assertArrayHasKey('advanced_search_options',$result['values']);
+    $this->assertArrayHasKey('advanced_search_options', $result['values']);
   }
 
   /**
@@ -130,7 +130,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $params = array('filters' => array('group' => 'multisite'));
     $result = $this->callAPISuccess('setting', 'getfields', $params);
     $this->assertArrayNotHasKey('customCSSURL', $result['values']);
-    $this->assertArrayHasKey('domain_group_id',$result['values']);
+    $this->assertArrayHasKey('domain_group_id', $result['values']);
   }
 
   /**
@@ -140,7 +140,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $params = array('filters' => array('prefetch' => 1));
     $result = $this->callAPISuccess('setting', 'getfields', $params);
     $this->assertArrayNotHasKey('disable_mandatory_tokens_check', $result['values']);
-    $this->assertArrayHasKey('monetaryDecimalPoint',$result['values']);
+    $this->assertArrayHasKey('monetaryDecimalPoint', $result['values']);
   }
 
   /**
@@ -220,7 +220,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     );
     $result = $this->callAPIAndDocument('setting', 'create', $params, __FUNCTION__, __FILE__);
 
-    $params = array('uniq_email_per_site' => 1,);
+    $params = array('uniq_email_per_site' => 1);
     $description = "shows setting a variable for a current domain";
     $result = $this->callAPIAndDocument('setting', 'create', $params, __FUNCTION__, __FILE__, $description, 'CreateSettingCurrentDomain');
     $this->assertArrayHasKey(CRM_Core_Config::domainID(), $result['values']);
@@ -263,18 +263,19 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     );
     $result = $this->callAPIFailure('setting', 'create', $params);
 
-    $params = array('track_civimail_replies' => '0',);
+    $params = array('track_civimail_replies' => '0');
     $result = $this->callAPISuccess('setting', 'create', $params);
-    $getResult = $this->callAPISuccess('setting','get',$params);
+    $getResult = $this->callAPISuccess('setting', 'get', $params);
     $this->assertEquals(0, $getResult['values'][$this->_currentDomain]['track_civimail_replies']);
 
-    $getResult = $this->callAPISuccess('setting','get',$params);
+    $getResult = $this->callAPISuccess('setting', 'get', $params);
     $this->assertEquals(0, $getResult['values'][$this->_currentDomain]['track_civimail_replies']);
-    $params = array(       'domain_id' => $this->_domainID2,
+    $params = array(
+    'domain_id' => $this->_domainID2,
       'track_civimail_replies' => '1',
     );
     $result = $this->callAPISuccess('setting', 'create', $params);
-    $getResult = $this->callAPISuccess('setting','get',$params);
+    $getResult = $this->callAPISuccess('setting', 'get', $params);
     $this->assertEquals(1, $getResult['values'][$this->_domainID2]['track_civimail_replies']);
 
     $params = array(
@@ -282,7 +283,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
       'track_civimail_replies' => 'TRUE',
     );
     $result = $this->callAPISuccess('setting', 'create', $params);
-    $getResult = $this->callAPISuccess('setting','get',$params);
+    $getResult = $this->callAPISuccess('setting', 'get', $params);
 
     $this->assertEquals(1, $getResult['values'][$this->_domainID2]['track_civimail_replies'], "check TRUE is converted to 1");
   }
@@ -297,7 +298,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
       'domain_id' => 'all',
       'uniq_email_per_site' => 1,
     );
-    $result = $this->callAPIAndDocument('setting', 'create', $params, __FUNCTION__, __FILE__,$description, 'CreateAllDomains');
+    $result = $this->callAPIAndDocument('setting', 'create', $params, __FUNCTION__, __FILE__, $description, 'CreateAllDomains');
 
     $this->assertEquals(1, $result['values'][2]['uniq_email_per_site']);
     $this->assertEquals(1, $result['values'][1]['uniq_email_per_site']);
@@ -310,27 +311,27 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     );
     // we'll check it with a 'get'
     $description = "shows getting a variable for all domains";
-    $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__,$description, 'GetAllDomains', 'Get');
+    $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__, $description, 'GetAllDomains', 'Get');
 
     $this->assertEquals(1, $result['values'][2]['uniq_email_per_site']);
     $this->assertEquals(1, $result['values'][1]['uniq_email_per_site']);
     $this->assertEquals(1, $result['values'][3]['uniq_email_per_site']);
 
     $params = array(
-      'domain_id' => array(1,3),
+      'domain_id' => array(1, 3),
       'uniq_email_per_site' => 0,
     );
     $description = "shows setting a variable for specified domains";
-    $result = $this->callAPIAndDocument('setting', 'create', $params, __FUNCTION__, __FILE__,$description, 'CreateSpecifiedDomains');
+    $result = $this->callAPIAndDocument('setting', 'create', $params, __FUNCTION__, __FILE__, $description, 'CreateSpecifiedDomains');
 
     $this->assertEquals(0, $result['values'][3]['uniq_email_per_site']);
     $this->assertEquals(0, $result['values'][1]['uniq_email_per_site']);
     $params = array(
-      'domain_id' => array(1,2),
+      'domain_id' => array(1, 2),
       'return' => array('uniq_email_per_site'),
     );
     $description = "shows getting a variable for specified domains";
-    $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__,$description, 'GetSpecifiedDomains', 'Get');
+    $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__, $description, 'GetSpecifiedDomains', 'Get');
     $this->assertEquals(1, $result['values'][2]['uniq_email_per_site']);
     $this->assertEquals(0, $result['values'][1]['uniq_email_per_site']);
 
@@ -343,13 +344,13 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     );
     $description = "shows get setting a variable for a given domain - if no domain is set current is assumed";
 
-    $result =  $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__);
+    $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__);
 
     $params = array(
       'return' => 'uniq_email_per_site',
     );
     $description = "shows getting a variable for a current domain";
-    $result =  $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__, $description, 'GetSettingCurrentDomain');
+    $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__, $description, 'GetSettingCurrentDomain');
     $this->assertArrayHasKey(CRM_Core_Config::domainID(), $result['values']);
   }
 
@@ -396,7 +397,8 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetConfigSetting() {
     $settings = $this->callAPISuccess('setting', 'get', array(
-        'name' => 'defaultCurrency',      'sequential' => 1,)
+        'name' => 'defaultCurrency',
+    'sequential' => 1,)
     );
     $this->assertEquals('USD', $settings['values'][0]['defaultCurrency']);
   }
@@ -406,13 +408,16 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    */
   public function testGetSetConfigSettingMultipleDomains() {
     $settings = $this->callAPISuccess('setting', 'create', array(
-        'defaultCurrency' => 'USD',      'domain_id' => $this->_currentDomain)
+        'defaultCurrency' => 'USD',
+    'domain_id' => $this->_currentDomain)
     );
     $settings = $this->callAPISuccess('setting', 'create', array(
-        'defaultCurrency' => 'CAD',      'domain_id' => $this->_domainID2)
+        'defaultCurrency' => 'CAD',
+    'domain_id' => $this->_domainID2)
     );
     $settings = $this->callAPISuccess('setting', 'get', array(
-        'return' => 'defaultCurrency',      'domain_id' => 'all',
+        'return' => 'defaultCurrency',
+    'domain_id' => 'all',
       )
     );
     $this->assertEquals('USD', $settings['values'][$this->_currentDomain]['defaultCurrency']);
@@ -425,7 +430,8 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    * Use getValue against a config setting
    */
   public function testGetValueConfigSetting() {
-    $params = array(      'name' => 'monetaryThousandSeparator',
+    $params = array(
+    'name' => 'monetaryThousandSeparator',
       'group' => 'Localization Setting',
     );
     $result = $this->callAPISuccess('setting', 'getvalue', $params);
@@ -433,7 +439,8 @@ class api_v3_SettingTest extends CiviUnitTestCase {
   }
 
   public function testGetValue() {
-    $params = array(      'name' => 'petition_contacts',
+    $params = array(
+    'name' => 'petition_contacts',
       'group' => 'Campaign Preferences'
     );
     $description = "Demonstrates getvalue action - intended for runtime use as better caching than get";
@@ -448,9 +455,9 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $params = array(
       'name' => 'address_format',
     );
-    $result = $this->callAPIAndDocument('setting', 'getdefaults', $params, __FUNCTION__, __FILE__,$description,'GetDefaults','getdefaults');
+    $result = $this->callAPIAndDocument('setting', 'getdefaults', $params, __FUNCTION__, __FILE__, $description, 'GetDefaults', 'getdefaults');
     $this->assertEquals("{contact.address_name}\n{contact.street_address}\n{contact.supplemental_address_1}\n{contact.supplemental_address_2}\n{contact.city}{, }{contact.state_province}{ }{contact.postal_code}\n{contact.country}", $result['values'][CRM_Core_Config::domainID()]['address_format']);
-    $params = array('name' => 'mailing_format',);
+    $params = array('name' => 'mailing_format');
     $result = $this->callAPISuccess('setting', 'getdefaults', $params);
     $this->assertEquals("{contact.addressee}\n{contact.street_address}\n{contact.supplemental_address_1}\n{contact.supplemental_address_2}\n{contact.city}{, }{contact.state_province}{ }{contact.postal_code}\n{contact.country}", $result['values'][CRM_Core_Config::domainID()]['mailing_format']);
     $this->assertArrayHasKey(CRM_Core_Config::domainID(), $result['values']);
@@ -460,22 +467,25 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    * Function tests reverting a specific parameter
    */
   public function testRevert() {
-    $params = array(      'address_format' => 'xyz',
+    $params = array(
+    'address_format' => 'xyz',
       'mailing_format' => 'bcs',
     );
     $result = $this->callAPISuccess('setting', 'create', $params);
     $this->assertAPISuccess($result, "in line " . __LINE__);
-    $revertParams = array(      'name' => 'address_format'
+    $revertParams = array(
+    'name' => 'address_format'
     );
     $result = $this->callAPISuccess('setting', 'get', $params);
     //make sure it's set
     $this->assertEquals('xyz', $result['values'][CRM_Core_Config::domainID()]['address_format']);
     $description = "Demonstrates reverting a parameter to default value";
-    $result = $this->callAPIAndDocument('setting', 'revert', $revertParams, __FUNCTION__, __FILE__,$description,'','revert');
+    $result = $this->callAPIAndDocument('setting', 'revert', $revertParams, __FUNCTION__, __FILE__, $description, '', 'revert');
     //make sure it's reverted
     $result = $this->callAPISuccess('setting', 'get', $params);
     $this->assertEquals("{contact.address_name}\n{contact.street_address}\n{contact.supplemental_address_1}\n{contact.supplemental_address_2}\n{contact.city}{, }{contact.state_province}{ }{contact.postal_code}\n{contact.country}", $result['values'][CRM_Core_Config::domainID()]['address_format']);
-    $params = array(      'return' => array('mailing_format'),
+    $params = array(
+    'return' => array('mailing_format'),
     );
     $result = $this->callAPISuccess('setting', 'get', $params);
     //make sure it's unchanged
@@ -486,11 +496,12 @@ class api_v3_SettingTest extends CiviUnitTestCase {
    * Tests reverting ALL parameters (specific domain)
    */
   public function testRevertAll() {
-    $params = array(        'address_format' => 'xyz',
+    $params = array(
+    'address_format' => 'xyz',
       'mailing_format' => 'bcs',
     );
     $result = $this->callAPISuccess('setting', 'create', $params);
-    $revertParams = array(    );
+    $revertParams = array();
     $result = $this->callAPISuccess('setting', 'get', $params);
     //make sure it's set
     $this->assertEquals('xyz', $result['values'][CRM_Core_Config::domainID()]['address_format']);
@@ -513,16 +524,18 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $params = array(      'domain_id' => 'all',
     );
     $result = $this->callAPISuccess('setting', 'get', $params);
-    $params = array(        'address_format' => 'xyz',
+    $params = array(
+    'address_format' => 'xyz',
       'mailing_format' => 'bcs',
       'domain_id' => $this->_domainID2,
     );
     $result = $this->callAPISuccess('setting', 'create', $params);
-    $params = array(      'domain_id' => $dom['id'],
+    $params = array(
+    'domain_id' => $dom['id'],
     );
     $result = $this->callAPISuccess('setting', 'get', $params);
     $this->assertAPISuccess($result, "in line " . __LINE__);
-    $this->assertArrayNotHasKey('tag_unconfirmed', $result['values'][$dom['id']],'setting for domain 3 should not be set. Debug this IF domain test is passing');
+    $this->assertArrayNotHasKey('tag_unconfirmed', $result['values'][$dom['id']], 'setting for domain 3 should not be set. Debug this IF domain test is passing');
     $result = $this->callAPISuccess('setting', 'fill', $params);
     $this->assertAPISuccess($result, "in line " . __LINE__);
     $result = $this->callAPISuccess('setting', 'get', $params);
index ddd1ac481500ed367bd7c80602002ae47b22b65c..128e02fa497682c39d464874e13cc8f36eb08451 100644 (file)
@@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  * Class api_v3_SurveyRespondantTest
  */
 class api_v3_SurveyRespondantTest extends CiviUnitTestCase {
-  protected $_apiversion =3;
+  protected $_apiversion = 3;
   protected $params;
 
 
@@ -47,8 +47,8 @@ class api_v3_SurveyRespondantTest extends CiviUnitTestCase {
     );
     $survey = $this->callAPISuccess('survey', 'create', $surveyParams);
     $surveyID = $survey['id'];
-    $this->params = array (
-      'sequential' =>'1',
+    $this->params = array(
+      'sequential' => '1',
       'survey_id' => $surveyID
     );
   }
@@ -57,7 +57,7 @@ class api_v3_SurveyRespondantTest extends CiviUnitTestCase {
    * Test survey respondent get.
    */
   public function testGetSurveyRespondants() {
-    $result = $this->callAPIAndDocument("SurveyRespondant","get", $this->params, __FUNCTION__, __FILE__);
+    $result = $this->callAPIAndDocument("SurveyRespondant", "get", $this->params, __FUNCTION__, __FILE__);
   }
 
 }
index 5cca43e1eecc0508538fc59828fd4f19b77c34d7..1ad88c415fb50104b455451cac599fb7d02459bc 100644 (file)
@@ -88,14 +88,13 @@ class api_v3_SurveyTest extends CiviUnitTestCase {
     $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__);
   }
 
-/**
- * Check the delete function succeeds
- */
+  /**
  * Check the delete function succeeds
  */
   public function testDeleteSurvey() {
     $entity = $this->createTestEntity();
     $result = $this->callAPIAndDocument('survey', 'delete', array('id' => $entity['id']), __FUNCTION__, __FILE__);
-    $checkDeleted = $this->callAPISuccess($this->entity, 'get', array(
-      ));
+    $checkDeleted = $this->callAPISuccess($this->entity, 'get', array());
     $this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__);
   }
 
index 8ce24368e419d30ee2cc49c6309fb45aa1f90b67..851118bd932387a09332402979f1611dcd8f32b0 100644 (file)
@@ -79,7 +79,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     $this->toBeImplemented['get'] = array('Profile', 'CustomValue', 'Constant', 'CustomSearch', 'Extension', 'ReportTemplate', 'System', 'Setting');
     $this->toBeImplemented['create'] = array('SurveyRespondant', 'OptionGroup', 'MailingRecipients', 'UFMatch', 'LocationType', 'CustomSearch', 'Extension', 'ReportTemplate', 'System');
     $this->toBeImplemented['delete'] = array('MembershipPayment', 'OptionGroup', 'SurveyRespondant', 'UFJoin', 'UFMatch', 'Extension', 'LocationType', 'System');
-    $this->onlyIDNonZeroCount['get'] = array('ActivityType', 'Entity', 'Domain','Setting');
+    $this->onlyIDNonZeroCount['get'] = array('ActivityType', 'Entity', 'Domain', 'Setting');
     $this->deprecatedAPI = array('Location', 'ActivityType', 'SurveyRespondant');
     $this->deletableTestObjects = array();
   }
@@ -185,10 +185,10 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     foreach ($entities as $entityName => $entity ) {
       if(!in_array($entityName, $invalidEntities)
         && !in_array($entityName, $entitiesToFix)) {
-          if(!empty(self::$componentMap[$entityName]) && empty($enabledComponents[self::$componentMap[$entityName]])) {
-             CRM_Core_BAO_ConfigSetting::enableComponent(self::$componentMap[$entityName]);
-          }
-          $customDataEntities[] = array($entityName);
+        if(!empty(self::$componentMap[$entityName]) && empty($enabledComponents[self::$componentMap[$entityName]])) {
+          CRM_Core_BAO_ConfigSetting::enableComponent(self::$componentMap[$entityName]);
+        }
+        $customDataEntities[] = array($entityName);
       }
     }
     return $customDataEntities;
@@ -267,7 +267,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
   public static function toBeSkipped_getfields($sequential = FALSE) {
     $entitiesWithMetadataNotYetFixed = array('ReportTemplate', 'CustomSearch');
     if ($sequential === TRUE) {
-      return $entitiesWithMetadataNotYetFixed ;
+      return $entitiesWithMetadataNotYetFixed;
     }
     $entities = array();
     foreach ($entitiesWithMetadataNotYetFixed as $e) {
@@ -275,13 +275,13 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     }
     return $entities;
   }
-/**
- * Generate list of entities to test for get by id functions
- * @param bool $sequential
- * @return array Entities to be skipped
- */
+  /**
  * Generate list of entities to test for get by id functions
  * @param bool $sequential
  * @return array Entities to be skipped
  */
   public static function toBeSkipped_automock($sequential = FALSE) {
-    $entitiesWithoutGet = array('MailingContact', 'EntityTag', 'Participant', 'ParticipantPayment', 'Setting', 'SurveyRespondant', 'MailingRecipients',  'CustomSearch', 'Extension', 'ReportTemplate', 'System');
+    $entitiesWithoutGet = array('MailingContact', 'EntityTag', 'Participant', 'ParticipantPayment', 'Setting', 'SurveyRespondant', 'MailingRecipients', 'CustomSearch', 'Extension', 'ReportTemplate', 'System');
     if ($sequential === TRUE) {
       return $entitiesWithoutGet;
     }
@@ -294,8 +294,8 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
 
 
   /**
-  * At this stage exclude the ones that don't pass & add them as we can troubleshoot them
-  */
+   * At this stage exclude the ones that don't pass & add them as we can troubleshoot them
+   */
   public static function toBeSkipped_updatesingle($sequential = FALSE) {
     $entitiesWithout = array(
       'Attachment', // pseudo-entity; testUpdateSingleValueAlter doesn't introspect properly on it. Multiple magic fields
@@ -371,7 +371,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
    */
   public static function toBeSkipped_getlimit() {
     $entitiesWithout = array(
-      'Case',//case api has non-std mandatory fields one of (case_id, contact_id, activity_id, contact_id)
+      'Case', //case api has non-std mandatory fields one of (case_id, contact_id, activity_id, contact_id)
       'EntityTag', // non-standard api - has inappropriate mandatory fields & doesn't implement limit
       'Event', // failed 'check that a 5 limit returns 5' - probably is_template field is wrong or something, or could be limit doesn't work right
       'Extension', // can't handle creating 25
@@ -386,7 +386,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
    */
   public static function toBeSkipped_getSqlOperators() {
     $entitiesWithout = array(
-      'Case',//case api has non-std mandatory fields one of (case_id, contact_id, activity_id, contact_id)
+      'Case', //case api has non-std mandatory fields one of (case_id, contact_id, activity_id, contact_id)
       'Contact', // on the todo list!
       'EntityTag', // non-standard api - has inappropriate mandatory fields & doesn't implement limit
       'Extension', // can't handle creating 25
@@ -418,10 +418,9 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
       'Address' => array(
         'cant_update' => array(
           'state_province_id', //issues with country id - need to ensure same country
-          'master_id',//creates relationship
+          'master_id', //creates relationship
         ),
-        'cant_return' => array(
-        )
+        'cant_return' => array()
       ),
       'Batch' => array(
         'cant_update' => array(
@@ -481,10 +480,8 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
         'cant_update' => array(
           'billing_mode',
         ),
-        'break_return' => array(
-        ),
-        'cant_return' => array(
-        ),
+        'break_return' => array(),
+        'cant_return' => array(),
       ),
       'PriceFieldValue' => array(
         'cant_update' => array(
@@ -502,13 +499,13 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
 
   /**
    * @dataProvider toBeSkipped_get
-   entities that don't need a get action
+  entities that don't need a get action
    */
   public function testNotImplemented_get($Entity) {
     $result = civicrm_api($Entity, 'Get', array('version' => 3));
     $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__);
     // $this->assertContains("API ($Entity, Get) does not exist", $result['error_message']);
-    $this->assertRegExp('/API (.*) does not exist/',  $result['error_message']);
+    $this->assertRegExp('/API (.*) does not exist/', $result['error_message']);
   }
 
   /**
@@ -861,7 +858,6 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
       return;
     }
 
-
     $this->assertArrayHasKey('version', $result);
     $this->assertEquals(3, $result['version']);
     if (!in_array($Entity, $this->onlyIDNonZeroCount['get'])) {
@@ -873,7 +869,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
 
   /**
    * @dataProvider toBeSkipped_create
-   entities that don't need a create action
+  entities that don't need a create action
    */
   public function testNotImplemented_create($Entity) {
     $result = civicrm_api($Entity, 'Create', array('version' => 3));
@@ -955,14 +951,14 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     $fields = $fields['values'];
     $return = array_keys($fieldsGet['values']);
     $valuesNotToReturn = $this->getKnownUnworkablesUpdateSingle($entityName, 'break_return');
-      // these can't be requested as return values
+    // these can't be requested as return values
     $entityValuesThatDoNotWork = array_merge(
         $this->getKnownUnworkablesUpdateSingle($entityName, 'cant_update'),
         $this->getKnownUnworkablesUpdateSingle($entityName, 'cant_return'),
         $valuesNotToReturn
       );
 
-    $return = array_diff($return,$valuesNotToReturn);
+    $return = array_diff($return, $valuesNotToReturn);
     $baoObj = new CRM_Core_DAO();
     $baoObj->createTestObject($baoString, array('currency' => 'USD'), 2, 0);
 
@@ -987,7 +983,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
         $fieldName = $specs['uniquename'];
       }
       if ($field == 'currency' || $field == 'id' || $field == strtolower($entityName) . '_id'
-      || in_array($field,$entityValuesThatDoNotWork)) {
+      || in_array($field, $entityValuesThatDoNotWork)) {
         //@todo id & entity_id are correct but we should fix currency & frequency_day
         continue;
       }
@@ -997,6 +993,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
         case CRM_Utils_Type::T_TIMESTAMP:
           $entity[$fieldName] = '2012-05-20';
           break;
+
         //case CRM_Utils_Type::T_DATETIME:
 
         case 12:
@@ -1009,7 +1006,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
         case CRM_Utils_Type::T_TEXT:
         case CRM_Utils_Type::T_LONGTEXT:
         case CRM_Utils_Type::T_EMAIL:
-          $entity[$fieldName] = substr('New String',0, CRM_Utils_Array::Value('maxlength',$specs,100));
+          $entity[$fieldName] = substr('New String', 0, CRM_Utils_Array::Value('maxlength', $specs, 100));
           break;
 
         case CRM_Utils_Type::T_INT:
@@ -1027,7 +1024,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
                 $resetFKTo = array($fieldName => $entity[$fieldName]);
               }
               $entity[$fieldName] = (string) empty($entity2[$field]) ? CRM_Utils_Array::value($uniqueName, $entity2) : $entity2[$field];
-             //todo - there isn't always something set here - & our checking on unset values is limited
+              //todo - there isn't always something set here - & our checking on unset values is limited
               if (empty($entity[$field])) {
                 unset($entity[$field]);
               }
@@ -1105,7 +1102,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
 
   /**
    * @dataProvider toBeSkipped_delete
-   entities that don't need a delete action
+  entities that don't need a delete action
    */
   public function testNotImplemented_delete($Entity) {
     $nonExistantID = 151416349;
@@ -1188,7 +1185,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     $this->callAPISuccess($entityName, 'delete', array('id' => $baoObj2->id));
     //make sure 1 less exists now
     $result = $this->callAPISuccess($entityName, 'getcount', array(),
-      ($createcount + $startCount) -1
+      ($createcount + $startCount) - 1
     );
 
     //make sure id #1 exists
@@ -1212,7 +1209,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     if (in_array($entity, $entities)) {
       $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, $entity . 'Test.php');
     }
-    $actions =  $this->callAPISuccess($entity, 'getactions', array());
+    $actions = $this->callAPISuccess($entity, 'getactions', array());
     foreach ($actions['values'] as $action) {
       if (substr($action, -7) == '_create'  || substr($action, -4) == '_get' || substr($action, -7) == '_delete') {
         //getactions can't distinguish between contribution_page.create & contribution_page.create
@@ -1261,7 +1258,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     $baos = array();
     $i = 0;
     while($i < $count) {
-    // create entities
+      // create entities
       $baoObj = CRM_Core_DAO::createTestObject($baoString, array('currency' => 'USD'));
       $this->assertTrue(is_integer($baoObj->id), 'check first id');
       $this->deletableTestObjects[$baoString][] = $baoObj->id;
@@ -1328,8 +1325,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     // Verify that chaining handles decoding
     $chainResult = $this->callAPISuccess('Event', 'Get', array(
       'id' => $eventId,
-      'api.event.get' => array(
-      ),
+      'api.event.get' => array(),
     ));
     $this->assertEquals('CiviCRM <> TheRest', $chainResult['values'][$eventId]['title']);
     $this->assertEquals('TheRest <> CiviCRM', $chainResult['values'][$eventId]['description']);
@@ -1353,7 +1349,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     ));
     //$this->assertTrue((bool)$setValueDescriptionResult['is_error']); // not supported by setValue
     $this->assertEquals('setValueDescription: TheRest <> CiviCRM', $setValueDescriptionResult['values']['description']);
-}
+  }
 
   /**
    * Verify that write operations (create/update) use partial HTML-encoding
index 777204175b301df974abd7c4483333c5fafce916..58fd439b835a1e3f1efb78d0498502f35425d798 100644 (file)
@@ -31,12 +31,12 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_tag_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Core
+ * @package CiviCRM_APIv3
+ * @subpackage API_Core
  */
 
 class api_v3_TagTest extends CiviUnitTestCase {
-  protected $_apiversion =3;
+  protected $_apiversion = 3;
   /**
    * @ids array of values to be cleaned up in the tear down
    */
@@ -102,7 +102,7 @@ class api_v3_TagTest extends CiviUnitTestCase {
    * Test civicrm_tag_create with empty params.
    */
   public function testCreateEmptyParams() {
-    $result = $this->callAPIFailure('tag', 'create', array(),'Mandatory key(s) missing from params array: name');
+    $result = $this->callAPIFailure('tag', 'create', array(), 'Mandatory key(s) missing from params array: name');
   }
 
   /**
index 5e282b402f0b2c516eba2f52cda8030eb83998d7..78df4ce0897eee87e5e1cc711d5f41b6a55e7765 100644 (file)
@@ -67,7 +67,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase {
       'pay_later_text' => 'I will pay later',
       'pay_later_receipt' => "I will pay later",
       'is_monetary' => TRUE,
-      'is_billing_required' => True
+      'is_billing_required' => TRUE
     );
 
     $this->_priceSetParams = array(
@@ -81,7 +81,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase {
       'is_quick_config' => 0,
       'is_reserved' => 0
     );
-     // Financial Account with 20% tax rate
+    // Financial Account with 20% tax rate
     $financialAccountSetparams = array(
       #[domain_id] =>
       'name' => 'vat full taxrate account'.substr(sha1(rand()), 0, 7),
@@ -103,7 +103,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase {
       'is_reserved' => 0,
       'is_active' => 1,
     );
-    $priceField = $this->callAPISuccess('financial_type','create', $financialType);
+    $priceField = $this->callAPISuccess('financial_type', 'create', $financialType);
     $this->financialtypeID = $priceField['id'];
     $financialRelationParams = array(
       'entity_table' => 'civicrm_financial_type',
@@ -133,7 +133,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase {
     );
 
     $halfFinancialType = CRM_Financial_BAO_FinancialType::add($halfFinancialtypeHalftax);
-    $this->halfFinancialTypeId = $halfFinancialType->id ;
+    $this->halfFinancialTypeId = $halfFinancialType->id;
     $financialRelationHalftax = array(
       'entity_table' => 'civicrm_financial_type',
       'entity_id' => $this->halfFinancialTypeId,
@@ -144,7 +144,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase {
     $halfFinancialRelation = CRM_Financial_BAO_FinancialTypeAccount::add($financialRelationHalftax);
 
     // Enable component contribute setting
-    $contributeSetting = array (
+    $contributeSetting = array(
       'invoicing' => 1,
       'invoice_prefix' => 'INV_',
       'credit_notes_prefix' => 'CN_',
@@ -259,7 +259,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase {
     $this->_ids['contributionId'] = $contribution['id'];
     $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__);
-    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'],$this->financialtypeID, 'In line ' . __LINE__ );
+    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__ );
     $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF', 'In line ' . __LINE__);
@@ -300,9 +300,9 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase {
 
     $description = "Create Contribution with Nested Line Items";
     $subfile = "CreateWithNestedLineItems";
-    $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__,__FILE__, $description, $subfile);
+    $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
 
-    $lineItems = $this->callAPISuccess('line_item','get',array(
+    $lineItems = $this->callAPISuccess('line_item', 'get', array(
       'entity_id' => $contribution['id'],
       'contribution_id' => $contribution['id'],
       'entity_table' => 'civicrm_contribution',
@@ -328,7 +328,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase {
     $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__);
-    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'],$this->financialtypeID, 'In line ' . __LINE__ );
+    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__ );
     $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF', 'In line ' . __LINE__);
@@ -353,7 +353,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase {
     $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__);
-    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'],$this->financialtypeID, 'In line ' . __LINE__ );
+    $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__ );
     $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__);
     $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF', 'In line ' . __LINE__);
@@ -377,7 +377,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase {
       'contribution_status_id' => 1,
     );
     $contribution = $this->callAPISuccess('contribution', 'create', $this->contributionParams);
-    $lineItems = $this->callAPISuccess('line_item','getvalue', array(
+    $lineItems = $this->callAPISuccess('line_item', 'getvalue', array(
       'entity_id' => $contribution['id'],
       'entity_table' => 'civicrm_contribution',
       'sequential' => 1,
@@ -393,7 +393,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase {
     );
     $contribution = $this->callAPISuccess('contribution', 'update', $newParams);
 
-    $lineItems = $this->callAPISuccess('line_item','getvalue',array(
+    $lineItems = $this->callAPISuccess('line_item', 'getvalue', array(
       'entity_id' => $contribution['id'],
       'entity_table' => 'civicrm_contribution',
       'sequential' => 1,
index cfa2d3e6b9639d9d66829f12b9f6501fa9bb903e..515f63b690d5bf2a2d7444bdf507722720112fdf 100644 (file)
@@ -31,7 +31,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  * Test class for UFGroup API - civicrm_uf_*
  * @todo Split UFGroup and UFJoin tests
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class api_v3_UFGroupTest extends CiviUnitTestCase {
   // ids from the uf_group_test.xml fixture
@@ -39,7 +39,7 @@ class api_v3_UFGroupTest extends CiviUnitTestCase {
   protected $_ufFieldId;
   protected $_contactId;
   protected $_groupId;
-  protected $_apiversion =3;
+  protected $_apiversion = 3;
   protected $params;
 
   protected function setUp() {
@@ -50,7 +50,7 @@ class api_v3_UFGroupTest extends CiviUnitTestCase {
     $ufGroup = $this->callAPISuccess('uf_group', 'create', array(
       'group_type' => 'Contact',
       'help_pre'   => 'Profile to Test API',
-      'title' =>'Test Profile',
+      'title' => 'Test Profile',
     ));
     $this->_ufGroupId = $ufGroup['id'];
     $ufMatch = $this->callAPISuccess('uf_match', 'create', array(
@@ -160,7 +160,7 @@ class api_v3_UFGroupTest extends CiviUnitTestCase {
       'name' => 'test_group',
       'notify' => 'admin@example.org',
       'post_URL' => 'http://example.org/post',
-      'title' => 'Test Group',    );
+      'title' => 'Test Group', );
     $result = $this->callAPISuccess('uf_group', 'create', $params);
     $params['created_date'] = date('YmdHis', strtotime($params['created_date']));
     foreach ($params as $key => $value) {
index fc020f86e38121fd65295bd11f7e819fe7216fa4..39ba60a7d3fe63b00af780bc08231f2644b936e6 100644 (file)
@@ -34,7 +34,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  * Test class for UFGroup API - civicrm_uf_*
  * @todo Split UFGroup and UFJoin tests
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class api_v3_UFJoinTest extends CiviUnitTestCase {
   // ids from the uf_group_test.xml fixture
@@ -86,12 +86,12 @@ class api_v3_UFJoinTest extends CiviUnitTestCase {
       'entity_id' => 1,
       'weight' => 1,
       'uf_group_id' => $this->_ufGroupId,
-      'is_active' => 1,    );
+      'is_active' => 1, );
     $ufJoin = $this->callAPISuccess('uf_join', 'create', $params);
 
     $searchParams = array(
       'entity_table' => 'civicrm_contribution_page',
-      'entity_id' => 1,    );
+      'entity_id' => 1, );
     $result = $this->callAPISuccess('uf_join', 'get', $searchParams);
 
     foreach ($result['values'] as $key => $value) {
@@ -118,7 +118,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase {
       'entity_table' => 'civicrm_contribution_page',
       'entity_id' => 1,
       'weight' => 1,
-      'is_active' => 1,    );
+      'is_active' => 1, );
     $result = $this->callAPIFailure('uf_join', 'create', $params);
     $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: uf_group_id', 'In line ' . __LINE__);
   }
@@ -133,7 +133,8 @@ class api_v3_UFJoinTest extends CiviUnitTestCase {
       'entity_id' => 1,
       'weight' => 1,
       'uf_group_id' => $this->_ufGroupId,
-      'is_active' => 1,      'sequential' => 1,
+      'is_active' => 1,
+    'sequential' => 1,
     );
     $ufJoin = $this->callAPIAndDocument('uf_join', 'create', $params, __FUNCTION__, __FILE__);
     $this->assertEquals($ufJoin['values'][0]['module'], $params['module'], 'In line ' . __LINE__);
@@ -147,7 +148,8 @@ class api_v3_UFJoinTest extends CiviUnitTestCase {
       'entity_id' => 1,
       'weight' => 1,
       'uf_group_id' => $this->_ufGroupId,
-      'is_active' => 0,      'sequential' => 1,
+      'is_active' => 0,
+    'sequential' => 1,
     );
     $ufJoinUpdated = $this->callAPISuccess('uf_join', 'create', $params);
     $this->assertEquals($ufJoinUpdated['values'][0]['module'], $params['module'], 'In line ' . __LINE__);
@@ -189,12 +191,13 @@ class api_v3_UFJoinTest extends CiviUnitTestCase {
       'entity_id' => 1,
       'weight' => 1,
       'uf_group_id' => $this->_ufGroupId,
-      'is_active' => 1,    );
+      'is_active' => 1, );
 
     $ufJoin = $this->callAPISuccess('uf_join', 'create', $params);
     $searchParams = array(
       'entity_table' => 'civicrm_contribution_page',
-      'entity_id' => 1,      'sequential' => 1,
+      'entity_id' => 1,
+    'sequential' => 1,
     );
 
     $result = $this->callAPIAndDocument('uf_join', 'get', $searchParams, __FUNCTION__, __FILE__);
index 3b1020fb39f20479eb9c0bdd1a2a70dd30a66d11..2c0952caeef0f9af7a45b83a4844a45b58c59f3e 100644 (file)
@@ -34,7 +34,7 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  * Test class for UFGroup API - civicrm_uf_*
  * @todo Split UFGroup and UFJoin tests
  *
- *  @package   CiviCRM
+ * @package   CiviCRM
  */
 class api_v3_UFMatchTest extends CiviUnitTestCase {
   // ids from the uf_group_test.xml fixture
@@ -135,11 +135,14 @@ class api_v3_UFMatchTest extends CiviUnitTestCase {
 
   public function testDelete() {
     $result = $this->callAPISuccess('uf_match', 'create', $this->_params);
-    $this->assertEquals(1, $this->callAPISuccess('uf_match', 'getcount', array(      'id' => $result['id'],
+    $this->assertEquals(1, $this->callAPISuccess('uf_match', 'getcount', array(
+    'id' => $result['id'],
       )));
-    $this->callAPISuccess('uf_match', 'delete', array(      'id' => $result['id'],
+    $this->callAPISuccess('uf_match', 'delete', array(
+    'id' => $result['id'],
     ));
-    $this->assertEquals(0, $this->callAPISuccess('uf_match', 'getcount', array('id' => $result['id'],
+    $this->assertEquals(0, $this->callAPISuccess('uf_match', 'getcount', array(
+    'id' => $result['id'],
       )));
   }
 }
index beb4f01635031b5b5df4f7a1314605b7b89149ef..4276ed4d3e99c5202fd336a32d96df8878b775c3 100644 (file)
@@ -253,7 +253,9 @@ class api_v3_UtilsTest extends CiviUnitTestCase {
 
     $params = array(
       'registration_start_date' => 20080601,
-      'registration_end_date' => '2008-10-15', 'start_date' => '2010-12-20', 'end_date' => '',
+      'registration_end_date' => '2008-10-15',
+    'start_date' => '2010-12-20',
+    'end_date' => '',
     );
     $fields = civicrm_api3('Event', 'getfields', array('action' => 'create'));
     _civicrm_api3_validate_fields('event', 'create', $params, $fields['values']);
index f13023a1eabf1311e55ad7705d638c3566d7144d..9c96449dd608c9fccc2c11465aa2ade8537ec9c8 100644 (file)
@@ -31,8 +31,8 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 /**
  *  Test APIv3 civicrm_website_* functions
  *
- *  @package CiviCRM_APIv3
- *  @subpackage API_Contact
+ * @package CiviCRM_APIv3
+ * @subpackage API_Contact
  */
 
 class api_v3_WebsiteTest extends CiviUnitTestCase {
@@ -90,7 +90,8 @@ class api_v3_WebsiteTest extends CiviUnitTestCase {
    */
   public function testGetMetadata() {
     $result = $this->callAPIAndDocument($this->_entity, 'get', array(
-      'options' => array('metadata' => array('fields')
+      'options' => array(
+    'metadata' => array('fields')
     )), __FUNCTION__, __FILE__, 'Demonostrates returning field metadata', 'GetWithMetadata');
     $this->assertEquals('Website', $result['metadata']['fields']['url']['title']);
   }
index 866582f9881baeeb766887122759261be9459742..3f1edd1c5d43db0e96e6e00cd2110a5202584f94 100644 (file)
@@ -9,7 +9,7 @@ return array(
     'is_domain' => 1,
     'is_contact' => 0,
     'description' => 'Test Key',
-    'title' =>  'Test Key',
+    'title' => 'Test Key',
     'help_text' => '',
     'html_type' => 'Text',
     'quick_form_type' => 'Element',