From 4cbe18b880934fc136c432057b8612cefd988522 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 24 May 2014 13:00:55 +1200 Subject: [PATCH] add missing comments - tests directory --- .../main.php | 23 ++- .../main.php | 3 + tests/phpunit/CRM/Batch/Form/EntryTest.php | 3 + .../CRM/Contact/BAO/QueryTestDataProvider.php | 9 ++ .../Contact/Form/Search/Custom/GroupTest.php | 7 + .../Search/Custom/GroupTestDataProvider.php | 9 ++ .../Contribute/BAO/ContributionPageTest.php | 7 + .../CRM/Contribute/BAO/ContributionTest.php | 7 + .../CRM/Core/BAO/ActionScheduleTest.php | 3 + tests/phpunit/CRM/Core/BAO/AddressTest.php | 3 + .../phpunit/CRM/Core/BAO/CustomGroupTest.php | 7 + .../phpunit/CRM/Core/BAO/CustomValueTest.php | 7 + tests/phpunit/CRM/Core/BAO/LocationTest.php | 7 + tests/phpunit/CRM/Core/BAO/PhoneTest.php | 7 + .../CRM/Core/CommunityMessagesTest.php | 3 + tests/phpunit/CRM/Core/Config/MailerTest.php | 3 + tests/phpunit/CRM/Core/DAOTest.php | 6 + tests/phpunit/CRM/Core/ErrorTest.php | 6 + tests/phpunit/CRM/Core/FieldOptionsTest.php | 3 + .../CRM/Core/Payment/AuthorizeNetTest.php | 6 + .../phpunit/CRM/Core/Payment/BaseIPNTest.php | 6 + .../CRM/Core/Payment/PayPalProIPNTest.php | 7 + tests/phpunit/CRM/Core/PaymentTest.php | 3 + tests/phpunit/CRM/Core/PseudoConstantTest.php | 3 + tests/phpunit/CRM/Core/ResourcesTest.php | 3 + tests/phpunit/CRM/Core/TransactionTest.php | 6 +- .../CRM/Event/BAO/AdditionalPaymentTest.php | 14 ++ .../phpunit/CRM/Event/BAO/ParticipantTest.php | 7 + .../CRM/Extension/Container/BasicTest.php | 7 + .../Extension/Container/CollectionTest.php | 6 + .../CRM/Extension/Container/StaticTest.php | 3 + .../CRM/Extension/Manager/ModuleTest.php | 18 +++ tests/phpunit/CRM/Extension/ManagerTest.php | 17 ++ tests/phpunit/CRM/Extension/MapperTest.php | 7 + .../CRM/Financial/BAO/FinancialItemTest.php | 3 + .../BAO/PaymentProcessorTypeTest.php | 6 + .../CRM/Mailing/BAO/QueryTestDataProvider.php | 9 ++ tests/phpunit/CRM/Mailing/BAO/SpoolTest.php | 4 + .../CRM/Member/BAO/MembershipLogTest.php | 3 + .../phpunit/CRM/Member/BAO/MembershipTest.php | 6 + tests/phpunit/CRM/PCP/BAO/PCPTest.php | 3 + tests/phpunit/CRM/Queue/Queue/SqlTest.php | 3 + tests/phpunit/CRM/Queue/QueueTest.php | 3 + tests/phpunit/CRM/Queue/RunnerTest.php | 27 ++++ .../CRM/Report/Form/Contribute/DetailTest.php | 3 + .../phpunit/CRM/Report/Form/TestCaseTest.php | 6 + .../phpunit/CRM/Utils/API/MatchOptionTest.php | 3 + tests/phpunit/CRM/Utils/HtmlToTextTest.php | 3 + tests/phpunit/CRM/Utils/JSTest.php | 3 + tests/phpunit/CRM/Utils/NumberTest.php | 5 +- tests/phpunit/CRM/Utils/RuleTest.php | 6 + tests/phpunit/CRM/Utils/SQL/SelectTest.php | 7 +- tests/phpunit/CRM/Utils/StringTest.php | 3 + tests/phpunit/CRM/Utils/ZipTest.php | 11 ++ tests/phpunit/Civi/API/RequestTest.php | 8 +- tests/phpunit/CiviTest/AuthorizeNet.php | 5 + tests/phpunit/CiviTest/CiviDBAssert.php | 5 + tests/phpunit/CiviTest/CiviMailUtils.php | 11 ++ tests/phpunit/CiviTest/CiviReportTestCase.php | 17 ++ .../phpunit/CiviTest/CiviSeleniumTestCase.php | 152 ++++++++++++++++++ tests/phpunit/CiviTest/CiviUnitTestCase.php | 134 ++++++++++++++- tests/phpunit/HelloTest.php | 8 + tests/phpunit/WebTest/Activity/IcalTest.php | 7 + .../WebTest/Activity/StandaloneAddTest.php | 4 + .../WebTest/Admin/MoveCustomDataTest.php | 47 ++++++ .../phpunit/WebTest/Campaign/ActivityTest.php | 4 + .../phpunit/WebTest/Campaign/MailingTest.php | 5 + .../WebTest/Campaign/MembershipTest.php | 4 + .../Campaign/OfflineContributionTest.php | 8 + .../Campaign/OfflineEventRegistrationTest.php | 4 + .../Campaign/OnlineContributionTest.php | 4 + .../Campaign/OnlineEventRegistrationTest.php | 36 +++++ tests/phpunit/WebTest/Campaign/PledgeTest.php | 4 + .../WebTest/Case/ActivityToCaseTest.php | 11 ++ tests/phpunit/WebTest/Case/AddCaseTest.php | 20 +++ .../WebTest/Case/CaseCustomFieldsTest.php | 20 +++ .../WebTest/Contact/AdvanceSearchPaneTest.php | 12 ++ .../AdvanceSearchPrivacyOptionsTest.php | 22 +++ .../WebTest/Contact/AdvancedSearchTest.php | 30 ++++ .../AdvancedSearchedRelatedContactTest.php | 20 +++ .../Contact/CreateCmsUserFromContactTest.php | 8 + .../DeceasedContactsAdvancedSearchTest.php | 7 + .../phpunit/WebTest/Contact/GroupAddTest.php | 8 + .../WebTest/Contact/MergeContactsTest.php | 5 + .../WebTest/Contact/ProfileChecksumTest.php | 6 + .../WebTest/Contact/SearchBuilderTest.php | 24 +++ .../Contact/SearchbyDateFilterTest.php | 12 ++ .../WebTest/Contact/TagSetSearchTest.php | 3 + .../WebTest/Contribute/AddBatchesTest.php | 13 ++ .../WebTest/Contribute/AddPricesetTest.php | 19 +++ .../Contribute/ConfirmOptionalTest.php | 3 + .../Contribute/OfflineContributionTest.php | 9 ++ .../Contribute/OnBehalfOfOrganization.php | 25 +++ .../Contribute/OnlineContributionTest.php | 4 + .../WebTest/Contribute/StandaloneAddTest.php | 11 +- .../UpdateBatchPendingContributionTest.php | 3 + .../Contribute/UpdateContributionTest.php | 42 ++++- .../UpdatePendingContributionTest.php | 10 ++ .../Contribute/VerifySSLContributionTest.php | 3 + tests/phpunit/WebTest/Event/AddEventTest.php | 64 +++++++- .../WebTest/Event/AddParticipationTest.php | 5 + .../phpunit/WebTest/Event/AddPricesetTest.php | 32 +++- .../WebTest/Event/AdditionalPaymentTest.php | 4 + .../WebTest/Event/ChangeParticipantStatus.php | 3 + .../WebTest/Event/EventListingTest.php | 5 + .../WebTest/Event/EventWaitListTest.php | 14 ++ .../MultipleEventRegistrationbyCartTest.php | 41 +++++ .../WebTest/Event/MultiprofileEventTest.php | 63 ++++++++ tests/phpunit/WebTest/Event/PCPAddTest.php | 57 +++++++ .../WebTest/Event/ParticipantCountTest.php | 20 +++ .../WebTest/Event/ParticipantSearchTest.php | 3 + .../WebTest/Event/PricesetMaxCountTest.php | 16 ++ .../phpunit/WebTest/Event/TellAFriendTest.php | 16 ++ tests/phpunit/WebTest/Export/ContactTest.php | 18 +++ .../Financial/FinancialBatchExport.php | 17 ++ .../WebTest/Generic/CheckDashboardTest.php | 9 ++ tests/phpunit/WebTest/Import/ActivityTest.php | 3 + .../WebTest/Import/AddressImportTest.php | 15 ++ .../WebTest/Import/AddressParsingTest.php | 6 + .../WebTest/Import/ContactCustomDataTest.php | 14 ++ .../WebTest/Import/ContactSubtypeTest.php | 12 ++ tests/phpunit/WebTest/Import/ContactTest.php | 9 ++ .../WebTest/Import/ContributionTest.php | 9 ++ .../phpunit/WebTest/Import/CustomDataTest.php | 16 ++ .../phpunit/WebTest/Import/DateFormatTest.php | 18 +++ .../WebTest/Import/DuplicateMatchingTest.php | 20 +++ tests/phpunit/WebTest/Import/GroupTest.php | 3 + .../Import/ImportCiviSeleniumTestCase.php | 46 ++++++ .../WebTest/Import/MatchExternalIdTest.php | 21 +++ tests/phpunit/WebTest/Import/MemberTest.php | 9 ++ .../Import/MultipleRelationshipTest.php | 3 + .../WebTest/Import/ParticipantTest.php | 14 ++ .../WebTest/Import/SavedMappingTest.php | 3 + tests/phpunit/WebTest/Import/TagTest.php | 3 + .../Mailing/AddMessageTemplateTest.php | 4 + tests/phpunit/WebTest/Mailing/MailingTest.php | 9 ++ tests/phpunit/WebTest/Mailing/SpoolTest.php | 4 + .../Member/BatchUpdateViaProfileTest.php | 10 ++ .../Member/DefaultMembershipPricesetTest.php | 32 ++++ .../OfflineMembershipAddPricesetTest.php | 33 ++++ .../OnlineAutoRenewMembershipGCTest.php | 3 + .../Member/OnlineAutoRenewMembershipTest.php | 3 + .../OnlineMembershipAddPricesetTest.php | 34 ++++ .../Member/OnlineMembershipCreateTest.php | 9 ++ .../Member/SeperateMembershipPaymentTest.php | 5 + .../Member/UpdateMembershipScriptTest.php | 3 + .../WebTest/Profile/BatchUpdateTest.php | 10 ++ .../Profile/MultiRecordProfileAddTest.php | 22 +++ .../WebTest/Profile/ProfileAddTest.php | 13 +- .../Profile/ProfileGroupSubscriptionTest.php | 3 + .../phpunit/WebTest/Release/InstallScript.php | 3 + .../WebTest/Release/ReleaseTestCase.php | 3 + .../phpunit/WebTest/Release/UpgradeScript.php | 3 + .../WebTest/Report/LoggingReportTest.php | 7 + .../Report/RolePermissionReportTest.php | 8 + tests/phpunit/WebTest/Utils/RestTest.php | 5 + tests/phpunit/api/v3/APIStandardsTest.php | 9 ++ tests/phpunit/api/v3/APIWrapperTest.php | 7 + tests/phpunit/api/v3/ActivityTypeTest.php | 3 + tests/phpunit/api/v3/AddressTest.php | 4 + tests/phpunit/api/v3/CRM11793Test.php | 5 +- tests/phpunit/api/v3/ContactTypeTest.php | 4 + tests/phpunit/api/v3/ContributionTest.php | 36 ++++- tests/phpunit/api/v3/CustomFieldTest.php | 25 +++ tests/phpunit/api/v3/CustomGroupTest.php | 3 + .../api/v3/CustomValueContactTypeTest.php | 3 + tests/phpunit/api/v3/DashboardTest.php | 4 + tests/phpunit/api/v3/EntityTagTest.php | 4 + tests/phpunit/api/v3/EventTest.php | 3 + tests/phpunit/api/v3/GroupContactTest.php | 3 + .../phpunit/api/v3/GroupOrganizationTest.php | 3 + tests/phpunit/api/v3/GroupTest.php | 3 + tests/phpunit/api/v3/JobTest.php | 10 ++ tests/phpunit/api/v3/MailingContactTest.php | 6 +- tests/phpunit/api/v3/MailingGroupTest.php | 3 + tests/phpunit/api/v3/MailingTest.php | 3 + tests/phpunit/api/v3/MembershipStatusTest.php | 3 + tests/phpunit/api/v3/MembershipTest.php | 3 + tests/phpunit/api/v3/MembershipTypeTest.php | 3 + tests/phpunit/api/v3/NoteTest.php | 6 + .../phpunit/api/v3/ParticipantPaymentTest.php | 7 + tests/phpunit/api/v3/ParticipantTest.php | 7 + tests/phpunit/api/v3/PaymentProcessorTest.php | 3 + .../api/v3/PaymentProcessorTypeTest.php | 3 + tests/phpunit/api/v3/ProductTest.php | 4 + tests/phpunit/api/v3/ProfileTest.php | 15 ++ tests/phpunit/api/v3/RelationshipTest.php | 10 ++ tests/phpunit/api/v3/RelationshipTypeTest.php | 3 + tests/phpunit/api/v3/SettingTest.php | 6 + .../phpunit/api/v3/SyntaxConformanceTest.php | 41 +++++ 190 files changed, 2224 insertions(+), 38 deletions(-) diff --git a/tests/extensions/test.extension.manager.paymenttest/main.php b/tests/extensions/test.extension.manager.paymenttest/main.php index 14fc98ccbe..eb22a9975e 100644 --- a/tests/extensions/test.extension.manager.paymenttest/main.php +++ b/tests/extensions/test.extension.manager.paymenttest/main.php @@ -2,6 +2,18 @@ class test_extension_manager_paymenttest extends CRM_Core_Payment { static private $_singleton = NULL; + /** + * singleton function used to manage this object + * + * @param string $mode the mode of operation: live or test + * @param array $paymentProcessor the details of the payment processor being invoked + * @param object $paymentForm reference to the form object if available + * @param boolean $force should we force a reload of this payment object + * + * @return object + * @static + * + */ static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { @@ -28,9 +40,18 @@ class test_extension_manager_paymenttest extends CRM_Core_Payment { self::$counts['enable'] = 1 + (int) self::$counts['enable']; } + /** + * This function collects all the information from a web/api form and invokes + * the relevant payment processor specific functions to perform the transaction + * + * @param array $params assoc array of input parameters for this transaction + * + * @return array the result in an nice formatted array (or an error object) + * @abstract + */ function doDirectPayment(&$params) { } function checkConfig() { } -} \ No newline at end of file +} diff --git a/tests/extensions/test.extension.manager.reporttest/main.php b/tests/extensions/test.extension.manager.reporttest/main.php index 7bf15631de..34d81f0ee9 100644 --- a/tests/extensions/test.extension.manager.reporttest/main.php +++ b/tests/extensions/test.extension.manager.reporttest/main.php @@ -37,6 +37,9 @@ class test_extension_manager_reporttest extends CRM_Core_Report { } } + /** + * @return string + */ protected function whoWhomWhenSql() { return " SELECT who.id who_id, who.display_name who_name, whom.id whom_id, whom.display_name whom_name, l.is_deleted diff --git a/tests/phpunit/CRM/Batch/Form/EntryTest.php b/tests/phpunit/CRM/Batch/Form/EntryTest.php index 074d904145..c15f19d6cd 100644 --- a/tests/phpunit/CRM/Batch/Form/EntryTest.php +++ b/tests/phpunit/CRM/Batch/Form/EntryTest.php @@ -177,6 +177,9 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { /* * data provider for test process membership */ + /** + * @return array + */ function getMembershipData() { /* diff --git a/tests/phpunit/CRM/Contact/BAO/QueryTestDataProvider.php b/tests/phpunit/CRM/Contact/BAO/QueryTestDataProvider.php index 1a8e0c772e..ef9ecbca1c 100644 --- a/tests/phpunit/CRM/Contact/BAO/QueryTestDataProvider.php +++ b/tests/phpunit/CRM/Contact/BAO/QueryTestDataProvider.php @@ -123,6 +123,9 @@ class CRM_Contact_BAO_QueryTestDataProvider implements Iterator { $this->i = 0; } + /** + * @return array + */ public function current() { $count = count($this->dataset[$this->i]['id']); $ids = $this->dataset[$this->i]['id']; @@ -137,6 +140,9 @@ class CRM_Contact_BAO_QueryTestDataProvider implements Iterator { return array($this->dataset[$this->i]['fv'], $count, $ids, $full); } + /** + * @return int + */ public function key() { return $this->i; } @@ -145,6 +151,9 @@ class CRM_Contact_BAO_QueryTestDataProvider implements Iterator { $this->i++; } + /** + * @return bool + */ public function valid() { return isset($this->dataset[$this->i]); } diff --git a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php index 29f7a0ef68..1af3b27206 100644 --- a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php +++ b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php @@ -64,6 +64,10 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { 'civicrm_option_value', 'civicrm_option_group', ); + + /** + * @return array + */ function get_info() { return array( 'name' => 'Contact Custom Search Group', @@ -72,6 +76,9 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { ); } + /** + * @return CRM_Contact_Form_Search_Custom_GroupTestDataProvider + */ public function dataProvider() { return new CRM_Contact_Form_Search_Custom_GroupTestDataProvider; } diff --git a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTestDataProvider.php b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTestDataProvider.php index aded5286d3..15d77bf305 100644 --- a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTestDataProvider.php +++ b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTestDataProvider.php @@ -193,6 +193,9 @@ class CRM_Contact_Form_Search_Custom_GroupTestDataProvider implements Iterator { $this->i = 0; } + /** + * @return array + */ public function current() { $count = count($this->dataset[$this->i]['id']); $ids = $this->dataset[$this->i]['id']; @@ -207,6 +210,9 @@ class CRM_Contact_Form_Search_Custom_GroupTestDataProvider implements Iterator { return array($this->dataset[$this->i]['fv'], $count, $ids, $full); } + /** + * @return int + */ public function key() { return $this->i; } @@ -215,6 +221,9 @@ class CRM_Contact_Form_Search_Custom_GroupTestDataProvider implements Iterator { $this->i++; } + /** + * @return bool + */ public function valid() { return isset($this->dataset[$this->i]); } diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php index cd9f293d42..4ca46625e9 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionPageTest.php @@ -31,7 +31,14 @@ require_once 'CiviTest/Contact.php'; require_once 'CiviTest/ContributionPage.php'; require_once 'CiviTest/Custom.php'; require_once 'CiviTest/PaypalPro.php'; + +/** + * Class CRM_Contribute_BAO_ContributionPageTest + */ class CRM_Contribute_BAO_ContributionPageTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Contribution BAOs', diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php index a426db5bc9..b0bf9264d1 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php @@ -29,7 +29,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; require_once 'CiviTest/Contact.php'; require_once 'CiviTest/Custom.php'; + +/** + * Class CRM_Contribute_BAO_ContributionTest + */ class CRM_Contribute_BAO_ContributionTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Contribution BAOs', diff --git a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php index e484a7dd7f..4c494add34 100644 --- a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php +++ b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php @@ -33,6 +33,9 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { */ var $mut; + /** + * @return array + */ function get_info() { return array( 'name' => 'Action-Schedule BAO', diff --git a/tests/phpunit/CRM/Core/BAO/AddressTest.php b/tests/phpunit/CRM/Core/BAO/AddressTest.php index 5a1ec95052..b6e233603e 100644 --- a/tests/phpunit/CRM/Core/BAO/AddressTest.php +++ b/tests/phpunit/CRM/Core/BAO/AddressTest.php @@ -29,6 +29,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; require_once 'CiviTest/Contact.php'; class CRM_Core_BAO_AddressTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Address BAOs', diff --git a/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php b/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php index f6a4582086..6f2461902e 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php @@ -30,7 +30,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; require_once 'CiviTest/Contact.php'; require_once 'CiviTest/Custom.php'; + +/** + * Class CRM_Core_BAO_CustomGroupTest + */ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'CustomGroup BAOs', diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTest.php index e5f7f14157..643acd95ba 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTest.php @@ -35,7 +35,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; require_once 'CiviTest/Custom.php'; + +/** + * Class CRM_Core_BAO_CustomValueTest + */ class CRM_Core_BAO_CustomValueTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'CustomValue BAOs', diff --git a/tests/phpunit/CRM/Core/BAO/LocationTest.php b/tests/phpunit/CRM/Core/BAO/LocationTest.php index 8005010271..3c0b3983e9 100644 --- a/tests/phpunit/CRM/Core/BAO/LocationTest.php +++ b/tests/phpunit/CRM/Core/BAO/LocationTest.php @@ -36,7 +36,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; require_once 'CiviTest/Contact.php'; require_once 'CiviTest/Event.php'; + +/** + * Class CRM_Core_BAO_LocationTest + */ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Location BAOs', diff --git a/tests/phpunit/CRM/Core/BAO/PhoneTest.php b/tests/phpunit/CRM/Core/BAO/PhoneTest.php index e9545f13c0..4161f0627d 100644 --- a/tests/phpunit/CRM/Core/BAO/PhoneTest.php +++ b/tests/phpunit/CRM/Core/BAO/PhoneTest.php @@ -30,7 +30,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; require_once 'CiviTest/Contact.php'; require_once 'CiviTest/Custom.php'; require_once 'CiviTest/Event.php'; + +/** + * Class CRM_Core_BAO_PhoneTest + */ class CRM_Core_BAO_PhoneTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Phone BAOs', diff --git a/tests/phpunit/CRM/Core/CommunityMessagesTest.php b/tests/phpunit/CRM/Core/CommunityMessagesTest.php index e25a27c093..53cc94004c 100644 --- a/tests/phpunit/CRM/Core/CommunityMessagesTest.php +++ b/tests/phpunit/CRM/Core/CommunityMessagesTest.php @@ -39,6 +39,9 @@ class CRM_Core_CommunityMessagesTest extends CiviUnitTestCase { */ protected static $webResponses = NULL; + /** + * @return array + */ public static function initWebResponses() { if (self::$webResponses === NULL) { self::$webResponses = array( diff --git a/tests/phpunit/CRM/Core/Config/MailerTest.php b/tests/phpunit/CRM/Core/Config/MailerTest.php index 2fc75e95ba..91426f8085 100644 --- a/tests/phpunit/CRM/Core/Config/MailerTest.php +++ b/tests/phpunit/CRM/Core/Config/MailerTest.php @@ -35,6 +35,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; +/** + * Class CRM_Core_Config_MailerTest + */ class CRM_Core_Config_MailerTest extends CiviUnitTestCase { /** diff --git a/tests/phpunit/CRM/Core/DAOTest.php b/tests/phpunit/CRM/Core/DAOTest.php index b564829365..c14ebede5b 100644 --- a/tests/phpunit/CRM/Core/DAOTest.php +++ b/tests/phpunit/CRM/Core/DAOTest.php @@ -69,6 +69,9 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { $this->assertEquals($contact->id, $refDao->contact_id); } + /** + * @return array + */ function composeQueryExamples() { $cases = array(); // $cases[] = array('Input-SQL', 'Input-Params', 'Expected-SQL'); @@ -160,6 +163,9 @@ class CRM_Core_DAOTest extends CiviUnitTestCase { $this->assertFalse(($expectSql == $actualSql)); } + /** + * @return array + */ function sqlNameDataProvider() { return array( array('this is a long string', 30, FALSE, 'this is a long string'), diff --git a/tests/phpunit/CRM/Core/ErrorTest.php b/tests/phpunit/CRM/Core/ErrorTest.php index 52bdd74d32..580196fa7e 100644 --- a/tests/phpunit/CRM/Core/ErrorTest.php +++ b/tests/phpunit/CRM/Core/ErrorTest.php @@ -31,6 +31,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Tests for linking to resource files */ class CRM_Core_ErrorTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Errors', @@ -89,6 +92,9 @@ class CRM_Core_ErrorTest extends CiviUnitTestCase { $this->assertLogRegexp('/static-1.*static-2.*obj-1.*static-3.*obj-2.*static-4.*obj-3.*static-5/s'); } + /** + * @param $pattern + */ function assertLogRegexp($pattern) { $config = CRM_Core_Config::singleton(); $logFiles = glob($config->configAndLogDir.'/CiviCRM*log*/'); diff --git a/tests/phpunit/CRM/Core/FieldOptionsTest.php b/tests/phpunit/CRM/Core/FieldOptionsTest.php index d801b3b83c..5d082d5567 100644 --- a/tests/phpunit/CRM/Core/FieldOptionsTest.php +++ b/tests/phpunit/CRM/Core/FieldOptionsTest.php @@ -31,6 +31,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Tests for field options */ class CRM_Core_FieldOptionsTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'FieldOptions', diff --git a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php index 07cf30a864..27f88eb4fa 100644 --- a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php +++ b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php @@ -29,7 +29,13 @@ require_once 'CiviTest/CiviUnitTestCase.php'; require_once 'CiviTest/AuthorizeNet.php'; +/** + * Class CRM_Core_Payment_AuthorizeNetTest + */ class CRM_Core_Payment_AuthorizeNetTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Authorize.net processing', diff --git a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php index 33da3c3fca..de5fbbd9ad 100644 --- a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php @@ -47,6 +47,9 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { protected $objects; public $DBResetRequired = FALSE; + /** + * @return array + */ function get_info() { return array( 'name' => 'BaseIPN test', @@ -444,6 +447,9 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /* * Prepare for contribution Test - involving only contribution objects */ + /** + * @param bool $contributionPage + */ function _setUpContributionObjects($contributionPage = FALSE) { diff --git a/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php b/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php index 918636b84f..6508946a21 100644 --- a/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php @@ -35,6 +35,9 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { protected $_contributionPageID; protected $_paymentProcessorID; + /** + * @return array + */ function get_info() { return array( 'name' => 'PaypalPro IPN processing', @@ -334,6 +337,10 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { 'residence_country' => 'US' ); } + + /** + * @return array + */ function getPaypalProRecurSubsequentTransaction() { return array_merge($this->getPaypalProRecurTransaction(), array('txn_id' => 'secondone')); ; diff --git a/tests/phpunit/CRM/Core/PaymentTest.php b/tests/phpunit/CRM/Core/PaymentTest.php index 24756c66f7..55481d9b5d 100644 --- a/tests/phpunit/CRM/Core/PaymentTest.php +++ b/tests/phpunit/CRM/Core/PaymentTest.php @@ -29,6 +29,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; class CRM_Core_PaymentTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Payment Test', diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index ce2f71e62c..fd72fb4f5d 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -31,6 +31,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Tests for pseudoconstant retrieval */ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'PseudoConstant', diff --git a/tests/phpunit/CRM/Core/ResourcesTest.php b/tests/phpunit/CRM/Core/ResourcesTest.php index 5c8aa6c4b4..d95dbc79dc 100644 --- a/tests/phpunit/CRM/Core/ResourcesTest.php +++ b/tests/phpunit/CRM/Core/ResourcesTest.php @@ -31,6 +31,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Tests for linking to resource files */ class CRM_Core_ResourcesTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Resources', diff --git a/tests/phpunit/CRM/Core/TransactionTest.php b/tests/phpunit/CRM/Core/TransactionTest.php index ebcc1d4de7..716946b33a 100644 --- a/tests/phpunit/CRM/Core/TransactionTest.php +++ b/tests/phpunit/CRM/Core/TransactionTest.php @@ -178,6 +178,10 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { $test->assertContactsExist($cids, FALSE); } + /** + * @param $cids + * @param bool $exist + */ public function assertContactsExist($cids, $exist = TRUE) { foreach ($cids as $cid) { $this->assertTrue(is_numeric($cid)); @@ -186,4 +190,4 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { )); } } -} \ No newline at end of file +} diff --git a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php index 5d42b6fa28..30f72fffdb 100644 --- a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php +++ b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php @@ -31,7 +31,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; require_once 'CiviTest/Contact.php'; require_once 'CiviTest/Event.php'; require_once 'CiviTest/Participant.php'; + +/** + * Class CRM_Event_BAO_AdditionalPaymentTest + */ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Additional Payment BAOs test', @@ -64,6 +71,13 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { } // helper function to record participant with paid contribution + /** + * @param $feeTotal + * @param $actualPaidAmt + * + * @return array + * @throws Exception + */ function _addParticipantWithPayment($feeTotal, $actualPaidAmt) { // creating price set, price field $paramsSet['title'] = 'Price Set'; diff --git a/tests/phpunit/CRM/Event/BAO/ParticipantTest.php b/tests/phpunit/CRM/Event/BAO/ParticipantTest.php index 3ed849ea88..4d37a6630c 100644 --- a/tests/phpunit/CRM/Event/BAO/ParticipantTest.php +++ b/tests/phpunit/CRM/Event/BAO/ParticipantTest.php @@ -31,7 +31,14 @@ require_once 'CiviTest/CiviUnitTestCase.php'; require_once 'CiviTest/Contact.php'; require_once 'CiviTest/Event.php'; require_once 'CiviTest/Participant.php'; + +/** + * Class CRM_Event_BAO_ParticipantTest + */ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Participant BAOs', diff --git a/tests/phpunit/CRM/Extension/Container/BasicTest.php b/tests/phpunit/CRM/Extension/Container/BasicTest.php index ed3c25427e..ed50f94c6b 100644 --- a/tests/phpunit/CRM/Extension/Container/BasicTest.php +++ b/tests/phpunit/CRM/Extension/Container/BasicTest.php @@ -85,6 +85,13 @@ class CRM_Extension_Container_BasicTest extends CiviUnitTestCase { $this->assertEquals('/foo/bar', $cacheData['test.foo.bar']); } + /** + * @param CRM_Utils_Cache_Interface $cache + * @param null $cacheKey + * @param string $appendPathGarbage + * + * @return array + */ function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL, $appendPathGarbage = '') { $basedir = rtrim($this->createTempDir('ext-'), '/'); mkdir("$basedir/foo"); diff --git a/tests/phpunit/CRM/Extension/Container/CollectionTest.php b/tests/phpunit/CRM/Extension/Container/CollectionTest.php index 56006e2320..a5fbd74dd4 100644 --- a/tests/phpunit/CRM/Extension/Container/CollectionTest.php +++ b/tests/phpunit/CRM/Extension/Container/CollectionTest.php @@ -93,6 +93,12 @@ class CRM_Extension_Container_CollectionTest extends CiviUnitTestCase { $this->assertEquals('b', $cacheData['test.whiz']); // 'test.whiz' was defined in the 'b' container } + /** + * @param CRM_Utils_Cache_Interface $cache + * @param null $cacheKey + * + * @return CRM_Extension_Container_Collection + */ function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL) { $containers = array(); $containers['a'] = new CRM_Extension_Container_Static(array( diff --git a/tests/phpunit/CRM/Extension/Container/StaticTest.php b/tests/phpunit/CRM/Extension/Container/StaticTest.php index 26a2eac567..b46278eb87 100644 --- a/tests/phpunit/CRM/Extension/Container/StaticTest.php +++ b/tests/phpunit/CRM/Extension/Container/StaticTest.php @@ -47,6 +47,9 @@ class CRM_Extension_Container_StaticTest extends CiviUnitTestCase { $this->assertEquals('http://foobar', $c->getResUrl('test.foo.bar')); } + /** + * @return CRM_Extension_Container_Static + */ function _createContainer() { return new CRM_Extension_Container_Static(array( 'test.foo' => array( diff --git a/tests/phpunit/CRM/Extension/Manager/ModuleTest.php b/tests/phpunit/CRM/Extension/Manager/ModuleTest.php index 902b0b97e2..bb69fcb913 100644 --- a/tests/phpunit/CRM/Extension/Manager/ModuleTest.php +++ b/tests/phpunit/CRM/Extension/Manager/ModuleTest.php @@ -228,6 +228,10 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { } } + /** + * @param $expectedIsActive + * @param $prefix + */ function assertModuleActiveByName($expectedIsActive, $prefix) { $activeModules = CRM_Core_PseudoConstant::getModuleExtensions(TRUE); // FIXME foreach ($activeModules as $activeModule) { @@ -239,6 +243,10 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { $this->assertEquals($expectedIsActive, FALSE); } + /** + * @param $expectedIsActive + * @param $key + */ function assertModuleActiveByKey($expectedIsActive, $key) { foreach (CRM_Core_Module::getAll() as $module) { if ($module->name == $key) { @@ -249,6 +257,12 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { $this->assertEquals($expectedIsActive, FALSE); } + /** + * @param $key + * @param $type + * @param $file + * @param string $template + */ function _createExtension($key, $type, $file, $template = self::MODULE_TEMPLATE) { $basedir = $this->basedir; mkdir("$basedir/$key"); @@ -258,6 +272,10 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { $this->system->getManager()->refresh(); } + /** + * @param $module + * @param $name + */ public static function incHookCount($module, $name) { global $_test_extension_manager_moduletest_counts; $_test_extension_manager_moduletest_counts[$module][$name] = 1 + (int) $_test_extension_manager_moduletest_counts[$module][$name]; diff --git a/tests/phpunit/CRM/Extension/ManagerTest.php b/tests/phpunit/CRM/Extension/ManagerTest.php index ef6388e8ab..460dcb4864 100644 --- a/tests/phpunit/CRM/Extension/ManagerTest.php +++ b/tests/phpunit/CRM/Extension/ManagerTest.php @@ -391,12 +391,23 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { $this->assertDBQuery('newextension', 'SELECT file FROM civicrm_extension WHERE full_name ="test.whiz.bang"'); } + /** + * @param $typeManagers + * + * @return CRM_Extension_Manager + */ function _createManager($typeManagers) { //list ($basedir, $c) = $this->_createContainer(); $mapper = new CRM_Extension_Mapper($this->container); return new CRM_Extension_Manager($this->container, $this->container, $this->mapper, $typeManagers); } + /** + * @param CRM_Utils_Cache_Interface $cache + * @param null $cacheKey + * + * @return array + */ function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL) { $basedir = $this->createTempDir('ext-'); mkdir("$basedir/weird"); @@ -410,6 +421,12 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { return array($basedir, $c); } + /** + * @param $key + * @param $file + * + * @return string + */ function _createDownload($key, $file) { $basedir = $this->createTempDir('ext-dl-'); file_put_contents("$basedir/info.xml", "$file"); diff --git a/tests/phpunit/CRM/Extension/MapperTest.php b/tests/phpunit/CRM/Extension/MapperTest.php index a033ac6621..4cca70080c 100644 --- a/tests/phpunit/CRM/Extension/MapperTest.php +++ b/tests/phpunit/CRM/Extension/MapperTest.php @@ -70,6 +70,13 @@ class CRM_Extension_MapperTest extends CiviUnitTestCase { $this->assertEquals(rtrim($config->resourceBase, '/'), $this->mapperWithSlash->keyToUrl('civicrm')); } + /** + * @param CRM_Utils_Cache_Interface $cache + * @param null $cacheKey + * @param string $appendPathGarbage + * + * @return array + */ function _createContainer(CRM_Utils_Cache_Interface $cache = NULL, $cacheKey = NULL, $appendPathGarbage = '') { /* $container = new CRM_Extension_Container_Static(array( diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php index f0e31b51d8..2fdb326f9f 100755 --- a/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php @@ -30,6 +30,9 @@ require_once 'CRM/Financial/BAO/FinancialAccount.php'; class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'FinancialItem BAOs', diff --git a/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php b/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php index 9a7f98f65f..0ae2257926 100755 --- a/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php +++ b/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTypeTest.php @@ -29,8 +29,14 @@ require_once 'CRM/Financial/DAO/FinancialAccount.php'; require_once 'CRM/Financial/BAO/FinancialAccount.php'; require_once 'CRM/Financial/BAO/FinancialTypeAccount.php'; +/** + * Class CRM_Financial_BAO_PaymentProcessorTypeTest + */ class CRM_Financial_BAO_PaymentProcessorTypeTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'PaymentProcessorType BAOs', diff --git a/tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php b/tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php index 7ce0f7cddb..d526102901 100644 --- a/tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php +++ b/tests/phpunit/CRM/Mailing/BAO/QueryTestDataProvider.php @@ -91,6 +91,9 @@ class CRM_Mailing_BAO_QueryTestDataProvider implements Iterator { $this->i = 0; } + /** + * @return array + */ public function current() { $count = count($this->dataset[$this->i]['id']); $ids = $this->dataset[$this->i]['id']; @@ -105,6 +108,9 @@ class CRM_Mailing_BAO_QueryTestDataProvider implements Iterator { return array($this->dataset[$this->i]['fv'], $count, $ids, $full); } + /** + * @return int + */ public function key() { return $this->i; } @@ -113,6 +119,9 @@ class CRM_Mailing_BAO_QueryTestDataProvider implements Iterator { $this->i++; } + /** + * @return bool + */ public function valid() { return isset($this->dataset[$this->i]); } diff --git a/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php b/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php index 0436a06ebb..8e2773c6c6 100644 --- a/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php +++ b/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php @@ -77,6 +77,10 @@ class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase { $mail->walkParts( $context, $mail ); } + /** + * @param $context + * @param $mailPart + */ public static function mailWalkCallback( $context, $mailPart ) { if ( $mailPart instanceof ezcMailText ) { switch ( $mailPart->subType ) { diff --git a/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php b/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php index 2f5880c9f2..2934c7f7bd 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php @@ -34,6 +34,9 @@ require_once 'CiviTest/Membership.php'; * @package CiviCRM */ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'MembershipLog Test', diff --git a/tests/phpunit/CRM/Member/BAO/MembershipTest.php b/tests/phpunit/CRM/Member/BAO/MembershipTest.php index 923d6d9c68..16b06d1f7c 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipTest.php @@ -33,7 +33,13 @@ require_once 'CiviTest/ContributionPage.php'; require_once 'CiviTest/Membership.php'; require_once 'CRM/Core/Controller.php'; +/** + * Class CRM_Member_BAO_MembershipTest + */ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'Membership BAOs', diff --git a/tests/phpunit/CRM/PCP/BAO/PCPTest.php b/tests/phpunit/CRM/PCP/BAO/PCPTest.php index aa538249e5..40a6a70682 100644 --- a/tests/phpunit/CRM/PCP/BAO/PCPTest.php +++ b/tests/phpunit/CRM/PCP/BAO/PCPTest.php @@ -34,6 +34,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * @package CiviCRM */ class CRM_PCP_BAO_PCPTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'PCP BAOs', diff --git a/tests/phpunit/CRM/Queue/Queue/SqlTest.php b/tests/phpunit/CRM/Queue/Queue/SqlTest.php index f229c6a218..f238dd8fe0 100644 --- a/tests/phpunit/CRM/Queue/Queue/SqlTest.php +++ b/tests/phpunit/CRM/Queue/Queue/SqlTest.php @@ -34,6 +34,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * priority-queueing. */ class CRM_Queue_Queue_SqlTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'SQL Queue', diff --git a/tests/phpunit/CRM/Queue/QueueTest.php b/tests/phpunit/CRM/Queue/QueueTest.php index 5e37d12761..db54c31bee 100644 --- a/tests/phpunit/CRM/Queue/QueueTest.php +++ b/tests/phpunit/CRM/Queue/QueueTest.php @@ -32,6 +32,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Ensure that various queue implementations comply with the interface */ class CRM_Queue_QueueTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'SQL Queue', diff --git a/tests/phpunit/CRM/Queue/RunnerTest.php b/tests/phpunit/CRM/Queue/RunnerTest.php index fa94e95682..c8c3474211 100644 --- a/tests/phpunit/CRM/Queue/RunnerTest.php +++ b/tests/phpunit/CRM/Queue/RunnerTest.php @@ -32,6 +32,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Ensure that various queue implementations comply with the interface */ class CRM_Queue_RunnerTest extends CiviUnitTestCase { + /** + * @return array + */ function get_info() { return array( 'name' => 'SQL Queue', @@ -242,22 +245,46 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase { static $_recordedValues; + /** + * @param $taskCtx + * @param $value + * + * @return bool + */ static function _recordValue($taskCtx, $value) { self::$_recordedValues[] = $value; return TRUE; } + /** + * @param $taskCtx + * + * @return bool + */ static function _returnFalse($taskCtx) { return FALSE; } + /** + * @param $taskCtx + * @param $value + * + * @throws Exception + */ static function _throwException($taskCtx, $value) { throw new Exception("Manufactured error: $value"); } + /** + * @param $taskCtx + * @param $low + * @param $high + * + * @return bool + */ static function _enqueueNumbers($taskCtx, $low, $high) { for ($i = $low; $i <= $high; $i++) { diff --git a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php index 301d4d454a..e892417799 100644 --- a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php +++ b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php @@ -41,6 +41,9 @@ class CRM_Report_Form_Contribute_DetailTest extends CiviReportTestCase { 'civicrm_contribution', ); + /** + * @return array + */ public function dataProvider() { return array( array( diff --git a/tests/phpunit/CRM/Report/Form/TestCaseTest.php b/tests/phpunit/CRM/Report/Form/TestCaseTest.php index 6084739011..bf1c0f4f83 100644 --- a/tests/phpunit/CRM/Report/Form/TestCaseTest.php +++ b/tests/phpunit/CRM/Report/Form/TestCaseTest.php @@ -46,6 +46,9 @@ class CRM_Report_Form_TestCaseTest extends CiviReportTestCase { 'civicrm_contribution', ); + /** + * @return array + */ public function dataProvider() { $testCaseA = array( 'CRM_Report_Form_Contribute_Detail', @@ -77,6 +80,9 @@ class CRM_Report_Form_TestCaseTest extends CiviReportTestCase { ); } + /** + * @return array + */ public function badDataProvider() { return array( // This test-case is bad because the dataset-ascii.sql does not match the diff --git a/tests/phpunit/CRM/Utils/API/MatchOptionTest.php b/tests/phpunit/CRM/Utils/API/MatchOptionTest.php index 089bb87558..20f067975c 100644 --- a/tests/phpunit/CRM/Utils/API/MatchOptionTest.php +++ b/tests/phpunit/CRM/Utils/API/MatchOptionTest.php @@ -81,6 +81,9 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { ), 'Failed to match existing record'); } + /** + * @return array + */ function apiOptionNames() { return array( array('match'), diff --git a/tests/phpunit/CRM/Utils/HtmlToTextTest.php b/tests/phpunit/CRM/Utils/HtmlToTextTest.php index 681e978e6c..61088839c5 100644 --- a/tests/phpunit/CRM/Utils/HtmlToTextTest.php +++ b/tests/phpunit/CRM/Utils/HtmlToTextTest.php @@ -30,6 +30,9 @@ Links: ', ); + /** + * @return array + */ function get_info() { return array( 'name' => 'HtmlToText Test', diff --git a/tests/phpunit/CRM/Utils/JSTest.php b/tests/phpunit/CRM/Utils/JSTest.php index 7eebbfaa78..91ebdd0361 100644 --- a/tests/phpunit/CRM/Utils/JSTest.php +++ b/tests/phpunit/CRM/Utils/JSTest.php @@ -31,6 +31,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Tests for linking to resource files */ class CRM_Utils_JSTest extends CiviUnitTestCase { + /** + * @return array + */ function translateExamples() { $cases = array(); $cases[] = array( diff --git a/tests/phpunit/CRM/Utils/NumberTest.php b/tests/phpunit/CRM/Utils/NumberTest.php index b241eb94b4..18c931bb9d 100644 --- a/tests/phpunit/CRM/Utils/NumberTest.php +++ b/tests/phpunit/CRM/Utils/NumberTest.php @@ -32,6 +32,9 @@ class CRM_Utils_NumberTest extends CiviUnitTestCase { } } + /** + * @return array + */ function truncDecimalCases() { $cases = array(); // array($value, $precision, $expectedValue) @@ -56,4 +59,4 @@ class CRM_Utils_NumberTest extends CiviUnitTestCase { "assert createTruncatedValue($value, ($sigFigs,$decFigs)) == $expectedValue" ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/CRM/Utils/RuleTest.php b/tests/phpunit/CRM/Utils/RuleTest.php index bdceab698b..5ad268db99 100644 --- a/tests/phpunit/CRM/Utils/RuleTest.php +++ b/tests/phpunit/CRM/Utils/RuleTest.php @@ -41,6 +41,9 @@ class CRM_Utils_RuleTest extends CiviUnitTestCase { $this->assertEquals($expectedResult, CRM_Utils_Rule::positiveInteger($inputData)); } + /** + * @return array + */ function positiveDataProvider() { return array( array(10, true), @@ -59,6 +62,9 @@ class CRM_Utils_RuleTest extends CiviUnitTestCase { $this->assertEquals($expectedResult, CRM_Utils_Rule::numeric($inputData)); } + /** + * @return array + */ function numericDataProvider() { return array( array(10, true), diff --git a/tests/phpunit/CRM/Utils/SQL/SelectTest.php b/tests/phpunit/CRM/Utils/SQL/SelectTest.php index 8428c153a2..9443d3f91f 100644 --- a/tests/phpunit/CRM/Utils/SQL/SelectTest.php +++ b/tests/phpunit/CRM/Utils/SQL/SelectTest.php @@ -155,9 +155,14 @@ class CRM_Utils_SQL_SelectTest extends CiviUnitTestCase { } } + /** + * @param $expected + * @param $actual + * @param string $message + */ function assertLike($expected, $actual, $message = '') { $expected = trim((preg_replace('/[ \r\n\t]+/', ' ', $expected))); $actual = trim((preg_replace('/[ \r\n\t]+/', ' ', $actual))); $this->assertEquals($expected, $actual, $message); } -} \ No newline at end of file +} diff --git a/tests/phpunit/CRM/Utils/StringTest.php b/tests/phpunit/CRM/Utils/StringTest.php index b89c6bfff5..25e362e755 100644 --- a/tests/phpunit/CRM/Utils/StringTest.php +++ b/tests/phpunit/CRM/Utils/StringTest.php @@ -105,6 +105,9 @@ class CRM_Utils_StringTest extends CiviUnitTestCase { } } + /** + * @return array + */ public function parsePrefixData() { $cases = array(); $cases[] = array('administer CiviCRM', NULL, array(NULL, 'administer CiviCRM')); diff --git a/tests/phpunit/CRM/Utils/ZipTest.php b/tests/phpunit/CRM/Utils/ZipTest.php index a5cf60b018..359d62480f 100644 --- a/tests/phpunit/CRM/Utils/ZipTest.php +++ b/tests/phpunit/CRM/Utils/ZipTest.php @@ -150,6 +150,11 @@ class CRM_Utils_ZipTest extends CiviUnitTestCase { ); } + /** + * @param $expectedBaseDirName + * @param $dirs + * @param $files + */ function _doFindBaseDirName($expectedBaseDirName, $dirs, $files) { $this->file = tempnam(sys_get_temp_dir(), 'testzip-'); $this->assertTrue(CRM_Utils_Zip::createTestZip($this->file, $dirs, $files)); @@ -159,6 +164,12 @@ class CRM_Utils_ZipTest extends CiviUnitTestCase { $this->assertEquals($expectedBaseDirName, CRM_Utils_Zip::findBaseDirName($zip)); } + /** + * @param $expectedResult + * @param $dirs + * @param $files + * @param $expectedKey + */ function _doGuessBaseDir($expectedResult, $dirs, $files, $expectedKey) { $this->file = tempnam(sys_get_temp_dir(), 'testzip-'); $this->assertTrue(CRM_Utils_Zip::createTestZip($this->file, $dirs, $files)); diff --git a/tests/phpunit/Civi/API/RequestTest.php b/tests/phpunit/Civi/API/RequestTest.php index e930c4a6fc..439240d992 100644 --- a/tests/phpunit/Civi/API/RequestTest.php +++ b/tests/phpunit/Civi/API/RequestTest.php @@ -98,6 +98,9 @@ class RequestTest extends \CiviUnitTestCase { Request::create('MyEntity', 'bad!action', array('version' => 4), NULL); } + /** + * @return array + */ function validEntityActionPairs() { $cases = array(); $cases[] = array( @@ -124,6 +127,9 @@ class RequestTest extends \CiviUnitTestCase { $this->assertEquals($expected, array($apiRequest['entity'], $apiRequest['action'], $apiRequest['version'])); } + /** + * @return array + */ function invalidEntityActionPairs() { $cases = array(); $cases[] = array('My+Entity', 'MyAction', 4); @@ -143,4 +149,4 @@ class RequestTest extends \CiviUnitTestCase { Request::create($inEntity, $inAction, array('version' => $inVersion), NULL); } -} \ No newline at end of file +} diff --git a/tests/phpunit/CiviTest/AuthorizeNet.php b/tests/phpunit/CiviTest/AuthorizeNet.php index 13bae28459..78217f0a0a 100644 --- a/tests/phpunit/CiviTest/AuthorizeNet.php +++ b/tests/phpunit/CiviTest/AuthorizeNet.php @@ -36,6 +36,11 @@ class AuthorizeNet extends PHPUnit_Framework_Testcase { * @return boolean true if payment processor deleted, false otherwise * */ + /** + * @param $id + * + * @return mixed + */ function delete($id) { $paymentProcessor = new CRM_Financial_DAO_PaymentProcessor(); $paymentProcessor->id = $id; diff --git a/tests/phpunit/CiviTest/CiviDBAssert.php b/tests/phpunit/CiviTest/CiviDBAssert.php index 9d5dd2c9cb..734af80744 100644 --- a/tests/phpunit/CiviTest/CiviDBAssert.php +++ b/tests/phpunit/CiviTest/CiviDBAssert.php @@ -140,6 +140,11 @@ class CiviDBAssert { self::assertAttributesEquals($testCase, $expectedValues, $dbValues); } + /** + * @param $testCase + * @param $expectedValues + * @param $actualValues + */ function assertAttributesEquals(&$testCase, &$expectedValues, &$actualValues) { foreach ($expectedValues as $paramName => $paramValue) { if (isset($actualValues[$paramName])) { diff --git a/tests/phpunit/CiviTest/CiviMailUtils.php b/tests/phpunit/CiviTest/CiviMailUtils.php index c40e07ff4b..1c098de5a0 100644 --- a/tests/phpunit/CiviTest/CiviMailUtils.php +++ b/tests/phpunit/CiviTest/CiviMailUtils.php @@ -43,6 +43,9 @@ require_once 'ezc/Base/src/ezc_bootstrap.php'; require_once 'ezc/autoload/mail_autoload.php'; +/** + * Class CiviMailUtils + */ class CiviMailUtils extends PHPUnit_Framework_TestCase { /** @@ -143,6 +146,11 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { } } + /** + * @param string $type + * + * @return ezcMail|string + */ function getMostRecentEmail($type = 'raw') { $msg = ''; @@ -233,6 +241,9 @@ class CiviMailUtils extends PHPUnit_Framework_TestCase { return $msgs; } + /** + * @return int + */ function getSelectedOutboundOption() { $selectedOption = CRM_Mailing_Config::OUTBOUND_OPTION_MAIL; // Is there a better way to do this? How do you get the currently selected value of a radio button in selenium? diff --git a/tests/phpunit/CiviTest/CiviReportTestCase.php b/tests/phpunit/CiviTest/CiviReportTestCase.php index b51a0e2deb..5e4920cd2b 100644 --- a/tests/phpunit/CiviTest/CiviReportTestCase.php +++ b/tests/phpunit/CiviTest/CiviReportTestCase.php @@ -43,6 +43,13 @@ class CiviReportTestCase extends CiviUnitTestCase { parent::tearDown(); } + /** + * @param $reportClass + * @param $inputParams + * + * @return string + * @throws Exception + */ function getReportOutputAsCsv($reportClass, $inputParams) { $config = CRM_Core_Config::singleton(); $config->keyDisable = TRUE; @@ -90,6 +97,11 @@ class CiviReportTestCase extends CiviUnitTestCase { return $tmpFile; } + /** + * @param $csvFile + * + * @return array + */ function getArrayFromCsv($csvFile) { $arrFile = array(); if (($handle = fopen($csvFile, "r")) !== FALSE) { @@ -134,6 +146,11 @@ class CiviReportTestCase extends CiviUnitTestCase { } } + /** + * @param $rows + * + * @return string + */ public function flattenCsvArray($rows) { $result = ''; foreach ($rows as $row) { diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 12213c7867..dbf4add63e 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -230,6 +230,11 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return json_decode($result, TRUE); } + /** + * @param $option_group_name + * + * @return array|int + */ function webtestGetFirstValueForOptionGroup($option_group_name) { $result = $this->webtest_civicrm_api("OptionValue", "getvalue", array( 'option_group_name' => $option_group_name, @@ -239,6 +244,9 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return $result; } + /** + * @return mixed + */ function webtestGetValidCountryID() { static $_country_id; if (is_null($_country_id)) { @@ -248,6 +256,11 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return $_country_id; } + /** + * @param $entity + * + * @return mixed|null + */ function webtestGetValidEntityID($entity) { // michaelmcandrew: would like to use getvalue but there is a bug // for e.g. group where option.limit not working at the moment CRM-9110 @@ -258,6 +271,11 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return NULL; } + /** + * @param $field + * + * @return mixed + */ function webtestGetConfig($field) { static $_config_backend; if (is_null($_config_backend)) { @@ -326,6 +344,12 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return $email; } + /** + * @param string $householdName + * @param null $email + * + * @return null|string + */ function webtestAddHousehold($householdName = "Smith's Home", $email = NULL) { $this->openCiviPage("contact/add", "reset=1&ct=Household"); @@ -344,6 +368,13 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return $email; } + /** + * @param string $organizationName + * @param null $email + * @param null $contactSubtype + * + * @return null|string + */ function webtestAddOrganization($organizationName = "Organization XYZ", $email = NULL, $contactSubtype = NULL) { $url = $this->sboxPath . 'civicrm/contact/add?reset=1&ct=Organization'; @@ -397,6 +428,10 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * webtestFillDate('start_date',"next Thursday") * webtestFillDate('start_date',"last Monday") */ + /** + * @param $dateElement + * @param null $strToTimeArgs + */ function webtestFillDate($dateElement, $strToTimeArgs = NULL) { $timeStamp = strtotime($strToTimeArgs ? $strToTimeArgs : '+1 month'); @@ -413,6 +448,10 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } // 1. set both date and time. + /** + * @param $dateElement + * @param null $strToTimeArgs + */ function webtestFillDateTime($dateElement, $strToTimeArgs = NULL) { $this->webtestFillDate($dateElement, $strToTimeArgs); @@ -672,6 +711,13 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->select('credit_card_exp_date[Y]', 'label=2019'); } + /** + * @param null $firstName + * @param null $middleName + * @param null $lastName + * + * @return array + */ function webtestAddBillingDetails($firstName = NULL, $middleName = NULL, $lastName = NULL) { if (!$firstName) { $firstName = 'John'; @@ -699,6 +745,12 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return array($firstName, $middleName, $lastName); } + /** + * @param $fieldLocator + * @param null $filePath + * + * @return null|string + */ function webtestAttachFile($fieldLocator, $filePath = NULL) { if (!$filePath) { $filePath = '/tmp/testfile_' . substr(sha1(rand()), 0, 7) . '.txt'; @@ -714,6 +766,13 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return $filePath; } + /** + * @param $headers + * @param $rows + * @param null $filePath + * + * @return null|string + */ function webtestCreateCSV($headers, $rows, $filePath = NULL) { if (!$filePath) { $filePath = '/tmp/testcsv_' . substr(sha1(rand()), 0, 7) . '.csv'; @@ -1204,6 +1263,14 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } + /** + * @param string $period_type + * @param int $duration_interval + * @param string $duration_unit + * @param string $auto_renew + * + * @return array + */ function webtestAddMembershipType($period_type = 'rolling', $duration_interval = 1, $duration_unit = 'year', $auto_renew = 'no') { $membershipTitle = substr(sha1(rand()), 0, 7); $membershipOrg = $membershipTitle . ' memorg'; @@ -1257,6 +1324,12 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return $memTypeParams; } + /** + * @param null $groupName + * @param null $parentGroupName + * + * @return null|string + */ function WebtestAddGroup($groupName = NULL, $parentGroupName = NULL) { $this->openCiviPage('group/add', 'reset=1', '_qf_Edit_upload-bottom'); @@ -1291,6 +1364,11 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return $groupName; } + /** + * @param string $activityType + * + * @return null + */ function WebtestAddActivity($activityType = "Meeting") { // Adding Adding contact with randomized first name for test testContactContextActivityAdd // We're using Quick Add block on the main page for this. @@ -1362,6 +1440,9 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return $this->urlArg('id'); } + /** + * @return bool + */ static function checkDoLocalDBTest() { if (defined('CIVICRM_WEBTEST_LOCAL_DB') && @@ -1392,6 +1473,15 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } // Request a record from the DB by seachColumn+searchValue. Success if a record is found. + /** + * @param $daoName + * @param $searchValue + * @param $returnColumn + * @param $searchColumn + * @param $message + * + * @return null|string + */ function assertDBNotNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { if (!self::checkDoLocalDBTest()) { return; @@ -1401,6 +1491,13 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } // Request a record from the DB by seachColumn+searchValue. Success if returnColumn value is NULL. + /** + * @param $daoName + * @param $searchValue + * @param $returnColumn + * @param $searchColumn + * @param $message + */ function assertDBNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { if (!self::checkDoLocalDBTest()) { return; @@ -1410,6 +1507,11 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } // Request a record from the DB by id. Success if row not found. + /** + * @param $daoName + * @param $id + * @param $message + */ function assertDBRowNotExist($daoName, $id, $message) { if (!self::checkDoLocalDBTest()) { return; @@ -1419,6 +1521,14 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } // Compare a single column value in a retrieved DB record to an expected value + /** + * @param $daoName + * @param $searchValue + * @param $returnColumn + * @param $searchColumn + * @param $expectedValue + * @param $message + */ function assertDBCompareValue($daoName, $searchValue, $returnColumn, $searchColumn, $expectedValue, $message ) { @@ -1432,6 +1542,11 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } // Compare all values in a single retrieved DB record to an array of expected values + /** + * @param $daoName + * @param $searchParams + * @param $expectedValues + */ function assertDBCompareValues($daoName, $searchParams, $expectedValues) { if (!self::checkDoLocalDBTest()) { return; @@ -1440,6 +1555,10 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return CiviDBAssert::assertDBCompareValues($this, $daoName, $searchParams, $expectedValues); } + /** + * @param $expectedValues + * @param $actualValues + */ function assertAttributesEquals(&$expectedValues, &$actualValues) { if (!self::checkDoLocalDBTest()) { return; @@ -1448,6 +1567,11 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return CiviDBAssert::assertAttributesEquals($expectedValues, $actualValues); } + /** + * @param $expected + * @param $actual + * @param string $message + */ function assertType($expected, $actual, $message = '') { return $this->assertInternalType($expected, $actual, $message); } @@ -1644,6 +1768,9 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } } + /** + * @param $verifySelectFieldData + */ function _assertSelectVerify($verifySelectFieldData) { foreach ($verifySelectFieldData as $key => $expectedvalue) { $actualvalue = $this->getSelectedLabel($key); @@ -1651,6 +1778,10 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } } + /** + * @param $financialType + * @param string $option + */ function addeditFinancialType($financialType, $option = 'new') { $this->openCiviPage("admin/financial/financialType", "reset=1"); @@ -1716,6 +1847,10 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->assertTrue($this->isTextPresent('The changes have been saved.')); } + /** + * @param $profileTitle + * @param $profileFields + */ function addProfile($profileTitle, $profileFields) { $this->openCiviPage('admin/uf/group', "reset=1"); @@ -1745,6 +1880,14 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } } + /** + * @param $name + * @param $sku + * @param $amount + * @param $price + * @param $cost + * @param $financialType + */ function addPremium($name, $sku, $amount, $price, $cost, $financialType) { $this->waitForElementPresent("_qf_ManagePremiums_upload-bottom"); $this->type("name", $name); @@ -1760,6 +1903,10 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } + /** + * @param $label + * @param $financialAccount + */ function addPaymentInstrument($label, $financialAccount) { $this->openCiviPage('admin/options/payment_instrument', 'action=add&reset=1', "_qf_Options_next-bottom"); $this->type("label", $label); @@ -1855,6 +2002,11 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } } + /** + * @param $customSets + * + * @return array + */ function addCustomGroupField($customSets) { foreach ($customSets as $customSet) { $this->openCiviPage("admin/custom/group", "action=add&reset=1"); diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index cea0ac4d85..912908c33d 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -166,10 +166,16 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { } } + /** + * @return bool + */ function requireDBReset() { return $this->DBResetRequired; } + /** + * @return string + */ static function getDBName() { $dbName = !empty($GLOBALS['mysql_db']) ? $GLOBALS['mysql_db'] : 'civicrm_tests_dev'; return $dbName; @@ -515,6 +521,16 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { } // Request a record from the DB by seachColumn+searchValue. Success if a record is found. + /** + * @param $daoName + * @param $searchValue + * @param $returnColumn + * @param $searchColumn + * @param $message + * + * @return null|string + * @throws PHPUnit_Framework_AssertionFailedError + */ function assertDBNotNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { if (empty($searchValue)) { $this->fail("empty value passed to assertDBNotNull"); @@ -526,12 +542,24 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { } // Request a record from the DB by seachColumn+searchValue. Success if returnColumn value is NULL. + /** + * @param $daoName + * @param $searchValue + * @param $returnColumn + * @param $searchColumn + * @param $message + */ function assertDBNull($daoName, $searchValue, $returnColumn, $searchColumn, $message) { $value = CRM_Core_DAO::getFieldValue($daoName, $searchValue, $returnColumn, $searchColumn, TRUE); $this->assertNull($value, $message); } // Request a record from the DB by id. Success if row not found. + /** + * @param $daoName + * @param $id + * @param null $message + */ function assertDBRowNotExist($daoName, $id, $message = NULL) { $message = $message ? $message : "$daoName (#$id) should not exist"; $value = CRM_Core_DAO::getFieldValue($daoName, $id, 'id', 'id', TRUE); @@ -539,6 +567,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { } // Request a record from the DB by id. Success if row not found. + /** + * @param $daoName + * @param $id + * @param null $message + */ function assertDBRowExist($daoName, $id, $message = NULL) { $message = $message ? $message : "$daoName (#$id) should exist"; $value = CRM_Core_DAO::getFieldValue($daoName, $id, 'id', 'id', TRUE); @@ -546,6 +579,14 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { } // Compare a single column value in a retrieved DB record to an expected value + /** + * @param $daoName + * @param $searchValue + * @param $returnColumn + * @param $searchColumn + * @param $expectedValue + * @param $message + */ function assertDBCompareValue($daoName, $searchValue, $returnColumn, $searchColumn, $expectedValue, $message ) { @@ -554,6 +595,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { } // Compare all values in a single retrieved DB record to an array of expected values + /** + * @param $daoName + * @param $searchParams + * @param $expectedValues + */ function assertDBCompareValues($daoName, $searchParams, $expectedValues) { //get the values from db $dbValues = array(); @@ -614,6 +660,13 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { $this->assertTrue(abs($actual - $expected) < $tolerance, $message); } + /** + * @param $expectedValues + * @param $actualValues + * @param null $message + * + * @throws PHPUnit_Framework_AssertionFailedError + */ function assertAttributesEquals($expectedValues, $actualValues, $message = NULL) { foreach ($expectedValues as $paramName => $paramValue) { if (isset($actualValues[$paramName])) { @@ -625,6 +678,10 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { } } + /** + * @param $key + * @param $list + */ function assertArrayKeyExists($key, &$list) { $result = isset($list[$key]) ? TRUE : FALSE; $this->assertTrue($result, ts("%1 element exists?", @@ -632,6 +689,10 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { )); } + /** + * @param $key + * @param $list + */ function assertArrayValueNotNull($key, &$list) { $this->assertArrayKeyExists($key, $list); @@ -683,6 +744,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { $this->assertNotEmpty($apiResult['error_message']); } + /** + * @param $expected + * @param $actual + * @param string $message + */ function assertType($expected, $actual, $message = '') { return $this->assertInternalType($expected, $actual, $message); } @@ -989,6 +1055,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { return $result['id']; } + /** + * @param $contactID + * + * @return array|int + */ function contactDelete($contactID) { $params = array( 'id' => $contactID, @@ -1006,6 +1077,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { return $result; } + /** + * @param $contactTypeId + * + * @throws Exception + */ function contactTypeDelete($contactTypeId) { require_once 'CRM/Contact/BAO/ContactType.php'; $result = CRM_Contact_BAO_ContactType::del($contactTypeId); @@ -1014,6 +1090,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { } } + /** + * @param array $params + * + * @return mixed + */ function membershipTypeCreate($params = array()) { CRM_Member_PseudoConstant::flush('membershipType'); CRM_Core_Config::clearDBCache(); @@ -1039,6 +1120,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { return $result['id']; } + /** + * @param $params + * + * @return mixed + */ function contactMembershipCreate($params) { $pre = array( 'join_date' => '2007-01-21', @@ -1068,12 +1154,20 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { return; } + /** + * @param $membershipID + */ function membershipDelete($membershipID) { $deleteParams = array('id' => $membershipID); $result = $this->callAPISuccess('Membership', 'Delete', $deleteParams); return; } + /** + * @param string $name + * + * @return mixed + */ function membershipStatusCreate($name = 'test member status') { $params['name'] = $name; $params['start_event'] = 'start_date'; @@ -1086,6 +1180,9 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { return $result['id']; } + /** + * @param $membershipStatusID + */ function membershipStatusDelete($membershipStatusID) { if (!$membershipStatusID) { return; @@ -1094,6 +1191,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { return; } + /** + * @param array $params + * + * @return mixed + */ function relationshipTypeCreate($params = array()) { $params = array_merge(array( 'name_a_b' => 'Relation 1 for relationship type create', @@ -1122,6 +1224,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { $this->callAPISuccess('relationship_type', 'delete', $params); } + /** + * @param null $params + * + * @return mixed + */ function paymentProcessorTypeCreate($params = NULL) { if (is_null($params)) { $params = array( @@ -2171,6 +2278,11 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { return $this->callAPISuccess('custom_field', 'create', $params); } + /** + * @param $entities + * + * @return bool + */ function confirmEntitiesDeleted($entities) { foreach ($entities as $entity) { @@ -2182,6 +2294,10 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { } } + /** + * @param $tablesToTruncate + * @param bool $dropCustomValueTables + */ function quickCleanup($tablesToTruncate, $dropCustomValueTables = FALSE) { if ($dropCustomValueTables) { $tablesToTruncate[] = 'civicrm_custom_group'; @@ -2247,6 +2363,15 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) * @param string $errorText text to print on error * */ + /** + * @param $params + * @param $id + * @param $entity + * @param int $delete + * @param string $errorText + * + * @throws Exception + */ function getAndCheck($params, $id, $entity, $delete = 1, $errorText = '') { $result = $this->callAPISuccessGetSingle($entity, array( @@ -2445,6 +2570,9 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) } } + /** + * @param $name + */ function financialAccountDelete($name) { $financialAccount = new CRM_Financial_DAO_FinancialAccount(); $financialAccount->name = $name; @@ -2742,7 +2870,11 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) } -function CiviUnitTestCase_fatalErrorHandler($message) { + /** + * @param $message + * + * @throws Exception + */function CiviUnitTestCase_fatalErrorHandler($message) { throw new Exception("{$message['message']}: {$message['code']}"); } } diff --git a/tests/phpunit/HelloTest.php b/tests/phpunit/HelloTest.php index 5098ec4f22..da36fe97ae 100644 --- a/tests/phpunit/HelloTest.php +++ b/tests/phpunit/HelloTest.php @@ -40,9 +40,17 @@ */ require_once 'PHPUnit/Framework/TestCase.php'; + +/** + * Class HelloTest + */ class HelloTest extends PHPUnit_Framework_TestCase { // contains the object handle of the string class var $abc; + + /** + * @param null $name + */ function __construct($name = NULL) { parent::__construct($name); } diff --git a/tests/phpunit/WebTest/Activity/IcalTest.php b/tests/phpunit/WebTest/Activity/IcalTest.php index 65686171e3..d942f936cc 100644 --- a/tests/phpunit/WebTest/Activity/IcalTest.php +++ b/tests/phpunit/WebTest/Activity/IcalTest.php @@ -29,6 +29,9 @@ require_once 'CiviTest/CiviMailUtils.php'; require_once 'ezc/Base/src/ezc_bootstrap.php'; require_once 'ezc/autoload/mail_autoload.php'; +/** + * Class WebTest_Activity_IcalTest + */ class WebTest_Activity_IcalTest extends CiviSeleniumTestCase { // This variable is a bit awkward, but the ezc callback function needed to walk through the email parts needs to be static, so use this variable to "report back" on whether we found what we're looking for or not. @@ -98,6 +101,10 @@ class WebTest_Activity_IcalTest extends CiviSeleniumTestCase { $this->assertTrue(self::$foundIt, ts('Generated email does not contain an ical attachment.')); } + /** + * @param $context + * @param $mailPart + */ public static function mailWalkCallback($context, $mailPart) { $disp = $mailPart->contentDisposition; diff --git a/tests/phpunit/WebTest/Activity/StandaloneAddTest.php b/tests/phpunit/WebTest/Activity/StandaloneAddTest.php index 4592e3bab8..f867d0e275 100644 --- a/tests/phpunit/WebTest/Activity/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Activity/StandaloneAddTest.php @@ -172,6 +172,10 @@ class WebTest_Activity_StandaloneAddTest extends CiviSeleniumTestCase { $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl); } + /** + * @param $expected + * @param null $xpathPrefix + */ function VerifyTabularData($expected, $xpathPrefix = NULL) { foreach ($expected as $label => $value) { $this->waitForElementPresent("xpath=//table/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td/span"); diff --git a/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php b/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php index b80bd1dc58..18118dc609 100644 --- a/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php +++ b/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php @@ -109,6 +109,11 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { } //moves a field from one field to another + /** + * @param $field_to_move + * @param $from_group_id + * @param $to_group_id + */ function _moveCustomField($field_to_move, $from_group_id, $to_group_id) { //go to the move field page $this->openCiviPage('admin/custom/group/field/move', "reset=1&fid={$field_to_move}"); @@ -135,6 +140,12 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { } //create a contact and return the contact id + /** + * @param string $firstName + * @param string $lastName + * + * @return mixed + */ function _createContact($firstName = "John", $lastName = "Doe") { $firstName .= "_" . substr(sha1(rand()), 0, 5); $lastName .= "_" . substr(sha1(rand()), 0, 5); @@ -146,6 +157,13 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { } //Get all custom field values for a given contact and custom group id using the api + /** + * @param $contact_id + * @param $group_id + * @param bool $reset_cache + * + * @return array + */ function _loadDataFromApi($contact_id, $group_id, $reset_cache = FALSE) { // cache the fields, just to speed things up a little static $field_ids = array(); @@ -182,6 +200,11 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { } //creates a new custom group and fields in that group, and returns the group Id + /** + * @param $prefix + * + * @return null + */ function _buildCustomFieldset($prefix) { $group_id = $this->_createCustomGroup($prefix); $field_ids[] = $this->_addCustomFieldToGroup($group_id, 'Alphanumeric', "CheckBox", $prefix); @@ -193,6 +216,12 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { } //Creates a custom field group for a specific entity type and returns the custom group Id + /** + * @param string $prefix + * @param string $entity + * + * @return null + */ function _createCustomGroup($prefix = "custom", $entity = "Contact") { $this->openCiviPage('admin/custom/group', 'action=add&reset=1'); @@ -217,6 +246,15 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { //Adds a new custom field to a specfied custom field group, using the given //datatype and widget. + /** + * @param $group_id + * @param string $type + * @param string $widget + * @param string $prefix + * + * @return mixed + * @throws PHPUnit_Framework_AssertionFailedError + */ function _addCustomFieldToGroup($group_id, $type = 'Alphanumeric', $widget = 'CheckBox', $prefix = '') { //A mapping of data type names to integer keys $type_map = array( @@ -350,6 +388,11 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { } //Populates $count options for a custom field on the add custom field page + /** + * @param int $count + * @param string $prefix + * @param array $values + */ function _createFieldOptions($count = 3, $prefix = "option", $values = array( )) { // Only support up to 10 options on the creation form @@ -363,6 +406,10 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { } //randomly generates data for a specific custom field + /** + * @param $contact_id + * @param $group_id + */ function _fillCustomDataForContact($contact_id, $group_id) { //edit the given contact $this->openCiviPage('contact/add', "reset=1&action=update&cid={$contact_id}"); diff --git a/tests/phpunit/WebTest/Campaign/ActivityTest.php b/tests/phpunit/WebTest/Campaign/ActivityTest.php index bfc97b3be7..5708498c59 100644 --- a/tests/phpunit/WebTest/Campaign/ActivityTest.php +++ b/tests/phpunit/WebTest/Campaign/ActivityTest.php @@ -109,6 +109,10 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase { $this->activityAddTest($campaignTitle, $id); } + /** + * @param $campaignTitle + * @param $id + */ function activityAddTest($campaignTitle, $id) { // Adding Adding contact with randomized first name for test testContactContextActivityAdd // We're using Quick Add block on the main page for this. diff --git a/tests/phpunit/WebTest/Campaign/MailingTest.php b/tests/phpunit/WebTest/Campaign/MailingTest.php index 61f151caac..7181b81050 100644 --- a/tests/phpunit/WebTest/Campaign/MailingTest.php +++ b/tests/phpunit/WebTest/Campaign/MailingTest.php @@ -98,6 +98,11 @@ class WebTest_Campaign_MailingTest extends CiviSeleniumTestCase { $this->mailingAddTest($groupName, $campaignTitle, $id); } + /** + * @param $groupName + * @param $campaignTitle + * @param $id + */ function mailingAddTest($groupName, $campaignTitle, $id) { //---- create mailing contact and add to mailing Group $firstName = substr(sha1(rand()), 0, 7); diff --git a/tests/phpunit/WebTest/Campaign/MembershipTest.php b/tests/phpunit/WebTest/Campaign/MembershipTest.php index ade5f690b6..e620f7dc09 100644 --- a/tests/phpunit/WebTest/Campaign/MembershipTest.php +++ b/tests/phpunit/WebTest/Campaign/MembershipTest.php @@ -107,6 +107,10 @@ class WebTest_Campaign_MembershipTest extends CiviSeleniumTestCase { $this->memberAddTest($campaignTitle, $id); } + /** + * @param $campaignTitle + * @param $id + */ function memberAddTest($campaignTitle, $id) { //Add new memebershipType $memTypeParams = $this->webtestAddMembershipType(); diff --git a/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php b/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php index 9b39e70e80..b1927eef06 100644 --- a/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php @@ -117,6 +117,11 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { $this->pastCampaignsTest($groupName); } + /** + * @param $campaignTitle + * @param $id + * @param bool $past + */ function offlineContributionTest($campaignTitle, $id, $past = FALSE) { // Create a contact to be used as soft creditor $softCreditFname = substr(sha1(rand()), 0, 7); @@ -228,6 +233,9 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { } } + /** + * @param $groupName + */ function pastCampaignsTest($groupName) { $this->openCiviPage('campaign/add', 'reset=1', '_qf_Campaign_upload-bottom'); diff --git a/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php b/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php index 0d551a6ef8..15519a873b 100644 --- a/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php +++ b/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php @@ -117,6 +117,10 @@ class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase $this->offlineParticipantAddTest($campaignTitle, $id); } + /** + * @param $campaignTitle + * @param $id + */ function offlineParticipantAddTest($campaignTitle, $id) { // connect campaign with event $this->openCiviPage("event/manage", "reset=1"); diff --git a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php index 68fcf9af6e..e187783632 100644 --- a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php @@ -113,6 +113,10 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase { $this->onlineContributionAddTest($campaignTitle, $id); } + /** + * @param $campaignTitle + * @param $id + */ function onlineContributionAddTest($campaignTitle, $id) { // We need a payment processor $processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7); diff --git a/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php b/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php index 21123077a9..83ef7287b7 100644 --- a/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php +++ b/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php @@ -110,6 +110,10 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase $this->onlineParticipantAddTest($campaignTitle, $id); } + /** + * @param $campaignTitle + * @param $id + */ function onlineParticipantAddTest($campaignTitle, $id) { // We need a payment processor $processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7); @@ -143,6 +147,11 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase $this->_testOnlineRegistration($campaignTitle, $registerUrl, $numberRegistrations, $anonymous); } + /** + * @param $id + * @param $eventTitle + * @param $eventDescription + */ function _testAddEventInfo($id, $eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); @@ -172,6 +181,9 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase $this->click("_qf_EventInfo_upload-bottom"); } + /** + * @param $streetAddress + */ function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForElementPresent("_qf_Location_upload-bottom"); @@ -190,6 +202,11 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase $this->waitForText('crm-notification-container', "saved"); } + /** + * @param bool $discount + * @param bool $priceSet + * @param $processorId + */ function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) { // Go to Fees tab $this->click("link=Fees"); @@ -219,6 +236,10 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase $this->waitForText('crm-notification-container', "saved"); } + /** + * @param $registerIntro + * @param bool $multipleRegistrations + */ function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { // Go to Online Registration tab $this->click("link=Online Registration"); @@ -242,6 +263,10 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase $this->waitForText('crm-notification-container', "saved"); } + /** + * @param $eventTitle + * @param $eventInfoStrings + */ function _testVerifyEventInfo($eventTitle, $eventInfoStrings) { // verify event input on info page // start at Manage Events listing @@ -252,6 +277,11 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase $this->assertStringsPresent($eventInfoStrings); } + /** + * @param $registerStrings + * + * @return string + */ function _testVerifyRegisterPage($registerStrings) { // Go to Register page and check for intro text and fee levels $this->click("link=Register Now"); @@ -260,6 +290,12 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase return $this->getLocation(); } + /** + * @param $campaignTitle + * @param $registerUrl + * @param int $numberRegistrations + * @param bool $anonymous + */ function _testOnlineRegistration($campaignTitle, $registerUrl, $numberRegistrations = 1, $anonymous = TRUE) { if ($anonymous) { $this->webtestLogout(); diff --git a/tests/phpunit/WebTest/Campaign/PledgeTest.php b/tests/phpunit/WebTest/Campaign/PledgeTest.php index fe10a1b002..b6e31cedd6 100644 --- a/tests/phpunit/WebTest/Campaign/PledgeTest.php +++ b/tests/phpunit/WebTest/Campaign/PledgeTest.php @@ -115,6 +115,10 @@ class WebTest_Campaign_PledgeTest extends CiviSeleniumTestCase { $this->pledgeAddTest($campaignTitle, $id); } + /** + * @param $campaignTitle + * @param $id + */ function pledgeAddTest($campaignTitle, $id) { // create unique name $name = substr(sha1(rand()), 0, 7); diff --git a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php index 48a2a4ecd3..026157762e 100644 --- a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php +++ b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php @@ -82,6 +82,12 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->_testAddNewActivity($firstName, $subject, $customGroupTitle, $contactName); } + /** + * @param $firstName + * @param $caseSubject + * @param $customGroupTitle + * @param $contactName + */ function _testAddNewActivity($firstName, $caseSubject, $customGroupTitle, $contactName) { $customDataParams = $this->_addCustomData($customGroupTitle); //$customDataParams = array( 'optionLabel_47d58', 'custom_8_-1' ); @@ -216,6 +222,11 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->waitForElementPresent("css=table#crm-activity-view-table tr.crm-case-activityview-form-block-groupTitle"); } + /** + * @param $customGroupTitle + * + * @return array + */ function _addCustomData($customGroupTitle) { $this->openCiviPage('admin/custom/group', 'reset=1'); diff --git a/tests/phpunit/WebTest/Case/AddCaseTest.php b/tests/phpunit/WebTest/Case/AddCaseTest.php index 70d62bfe5f..51ee21025a 100644 --- a/tests/phpunit/WebTest/Case/AddCaseTest.php +++ b/tests/phpunit/WebTest/Case/AddCaseTest.php @@ -154,6 +154,10 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl); } + /** + * @param $validateStrings + * @param $activityTypes + */ function _testVerifyCaseSummary($validateStrings, $activityTypes) { $this->assertStringsPresent($validateStrings); foreach ($activityTypes as $aType) { @@ -163,6 +167,10 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { $this->assertElementPresent("xpath=//a[text()=' Print Report']", "Print Case Summary button is missing."); } + /** + * @param $caseRoles + * @param $creatorName + */ function _testVerifyCaseRoles($caseRoles, $creatorName) { $this->waitForElementPresent("xpath=//table[@id='caseRoles-selector']/tbody/tr[4]/td[2]/a"); // check that expected roles are listed in the Case Roles pane @@ -173,6 +181,9 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { $this->verifyText("xpath=//table[@id='caseRoles-selector']/tbody/tr[4]/td[2]", $creatorName); } + /** + * @param $activityTypes + */ function _testVerifyCaseActivities($activityTypes) { $id = $this->urlArg('id'); // check that expected auto-created activities are listed in the Case Activities table @@ -181,6 +192,10 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { } } + /** + * @param $subject + * @param $openCaseData + */ function _testVerifyOpenCaseActivity($subject, $openCaseData) { $id = $this->urlArg('id'); // check that open case subject is present @@ -198,6 +213,11 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { $this->click("xpath=//span[@class='ui-button-icon-primary ui-icon ui-icon-closethick']"); } + /** + * @param $firstName + * @param $lastName + * @param $action + */ function _testSearchbyDate($firstName, $lastName, $action) { // Find Cases if ($action != "0") { diff --git a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php index e52099e613..4a64a14603 100644 --- a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php +++ b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php @@ -205,6 +205,10 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { $this->_testDeleteCustomData($customGrpId1, $customId); } + /** + * @param $validateStrings + * @param $activityTypes + */ function _testVerifyCaseSummary($validateStrings, $activityTypes) { $this->assertStringsPresent($validateStrings); foreach ($activityTypes as $aType) { @@ -214,6 +218,12 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { $this->assertElementPresent("name=case_report_all", "Print Case Summary button is missing."); } + /** + * @param $customGrpId1 + * @param bool $noteRichEditor + * + * @return array + */ function _testGetCustomFieldId($customGrpId1, $noteRichEditor=FALSE) { $customId = array(); @@ -285,6 +295,10 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { return $customId; } + /** + * @param $customGrpId1 + * @param $customId + */ function _testDeleteCustomData($customGrpId1, $customId) { // delete all custom data foreach ($customId as $cKey => $cValue) { @@ -439,6 +453,12 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { $this->_testDeleteCustomData($customGrpId1, $customId); } + /** + * @param $customId + * @param $custFname + * @param $custMname + * @param $custLname + */ function _testAdvansearchCaseData($customId, $custFname, $custMname, $custLname) { // search casecontact $this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh'); diff --git a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php index 6faa45d567..a2e908a644 100644 --- a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php +++ b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php @@ -82,6 +82,9 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { $this->_checkOpenedPanes(array_keys($allpanes)); } + /** + * @param array $openedPanes + */ function _checkOpenedPanes($openedPanes = array( )) { if (!$this->isTextPresent('No matches found')) { @@ -101,6 +104,10 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { } } + /** + * @param $paneRef + * @param array $selectFields + */ function _selectPaneFields($paneRef, $selectFields = array( )) { $pane = $this->_advanceSearchPanes($paneRef); @@ -147,6 +154,11 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { } } + /** + * @param null $paneRef + * + * @return array + */ function _advanceSearchPanes($paneRef = NULL) { static $_advance_search_panes; diff --git a/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php b/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php index f237ba5de7..f0ece7ab49 100644 --- a/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php +++ b/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php @@ -121,6 +121,12 @@ class WebTest_Contact_AdvanceSearchPrivacyOptionsTest extends CiviSeleniumTestCa $this->assertTrue($assertCheck, 'Do not trade / sms assertion failed using criteria(include , AND )'); } + /** + * @param $inEx + * @param $privacyOptions + * @param $privacyOperator + * @param $allPrivacyOptions + */ function _addPrivacyCriteria($inEx, $privacyOptions, $privacyOperator, $allPrivacyOptions) { $inExId = ($inEx == 'include') ? 'CIVICRM_QFID_2_privacy_toggle' : 'CIVICRM_QFID_1_privacy_toggle'; $this->click($inExId); @@ -144,6 +150,12 @@ class WebTest_Contact_AdvanceSearchPrivacyOptionsTest extends CiviSeleniumTestCa } } + /** + * @param $firstName + * @param $lastName + * + * @return bool + */ function _searchSortNameCriteria($firstName, $lastName) { //type in the criteria $this->type("sort_name", "{$lastName}, {$firstName}"); @@ -156,6 +168,11 @@ class WebTest_Contact_AdvanceSearchPrivacyOptionsTest extends CiviSeleniumTestCa return $this->isElementPresent("xpath=//div[@class='crm-search-results']/table/tbody/tr/td[3]/a[text()='{$lastName}, {$firstName}']"); } + /** + * @param $privacyOption + * + * @return string + */ function getOptionVal($privacyOption) { if ($privacyOption == 'do_not_phone') { $privacyOptionVal = 'Do not phone'; @@ -175,6 +192,11 @@ class WebTest_Contact_AdvanceSearchPrivacyOptionsTest extends CiviSeleniumTestCa return $privacyOptionVal; } + /** + * @param $firstName + * @param $lastName + * @param $options + */ function _addIndividual($firstName, $lastName, $options) { $this->openCiviPage('contact/add', 'reset=1&ct=Individual'); diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php index f9b193f060..1149c93f59 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php @@ -227,6 +227,9 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { } //function to check match for sumbit Advance Search + /** + * @param $firstName + */ function submitSearch($firstName) { $this->clickLink("_qf_Advanced_refresh"); // verify unique name @@ -238,6 +241,10 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { } // function to fill auto complete + /** + * @param $text + * @param $elementId + */ function fillAutoComplete($text, $elementId) { $this->click("$elementId"); $this->type("$elementId", "$text"); @@ -250,6 +257,11 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { } // function to fill basic search detail + /** + * @param $firstName + * @param $groupName + * @param $tagName + */ function addBasicSearchDetail($firstName, $groupName, $tagName) { // fill partial sort name $this->type("sort_name", "$firstName"); @@ -272,6 +284,9 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { } // function to fill address search block values in advance search + /** + * @param $firstName + */ function addAddressSearchDetail($firstName) { // select location type (home and main) $this->click("xpath=//div[@id='location']/table/tbody/tr[1]/td[1]//label[text()='Home']"); @@ -290,6 +305,9 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { } // function to fill activity search block in advance search + /** + * @param $firstName + */ function addActivitySearchDetail($firstName) { // check activity types $checkActivityTypes = array("Contribution", "Event Registration", "Membership Signup"); @@ -323,6 +341,9 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { } //function to fill contribution search details + /** + * @param $firstName + */ function addContributionSearchDetail($firstName) { // fill contribution date range $this->select("contribution_date_relative","value=0"); @@ -362,6 +383,9 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { } // function to fill member search details + /** + * @param $firstName + */ function addMemberSearchDetail($firstName) { // check membership type (Student) $this->click("xpath=//div[@id='memberForm']/table/tbody/tr[1]/td[1]/div[1]//div/label[text()='Student']"); @@ -386,6 +410,9 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { } // function to fill member search details + /** + * @param $firstName + */ function addPledgeSearchDetail($firstName) { // fill pledge schedule date range $this->select("pledge_payment_date_relative","value=0"); @@ -411,6 +438,9 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { } // function to create contact with details (contact details, address, Constituent information ...) + /** + * @param null $firstName + */ function createDetailContact($firstName = NULL) { if (!$firstName) { $firstName = substr(sha1(rand()), 0, 7); diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 7bc6b986fa..7882d75a19 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -136,6 +136,10 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->_testSearchResult($relType); } + /** + * @param $eventTitle + * @param $eventDescription + */ function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); @@ -161,6 +165,9 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->click("_qf_EventInfo_upload-bottom"); } + /** + * @param $streetAddress + */ function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -181,6 +188,11 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->waitForText('crm-notification-container', "'Event Location' information has been saved."); } + /** + * @param bool $discount + * @param bool $priceSet + * @param $processorId + */ function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) { // Go to Fees tab $this->click("link=Fees"); @@ -211,6 +223,11 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->waitForTextPresent("'Fees' information has been saved."); } + /** + * @param $ContactName + * @param $relatedName + * @param $relType + */ function _testAddRelationship($ContactName, $relatedName, $relType) { $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh'); @@ -263,6 +280,9 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->assertElementContainsText("xpath=//table[@class='crm-info-panel']", $relType); } + /** + * @param $relType + */ function _testSearchResult($relType) { //search related contact using Advanced Search diff --git a/tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php b/tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php index 84c3d68c51..3ad223a59a 100644 --- a/tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php +++ b/tests/phpunit/WebTest/Contact/CreateCmsUserFromContactTest.php @@ -200,12 +200,20 @@ class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase $this->assertTrue($results['count'] == 1); } + /** + * @param $username + * @param $password + * @param $confirm_password + */ function _fillCMSUserForm($username, $password, $confirm_password) { $this->type("cms_name", $username); $this->type("cms_pass", $password); $this->type("cms_confirm_pass", $confirm_password); } + /** + * @return array + */ function _createUserAndGoToForm() { $firstName = substr(sha1(rand()), 0, 7) . "John"; $lastName = substr(sha1(rand()), 0, 7) . "Smith"; diff --git a/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php index 7165398b15..1641605a9e 100644 --- a/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php @@ -85,6 +85,13 @@ class WebTest_Contact_DeceasedContactsAdvancedSearchTest extends CiviSeleniumTes $this->assertElementContainsText('search-status', '3 Contacts'); } + /** + * @param $firstName + * @param $lastName + * @param $email + * @param $groupName + * @param bool $deceased + */ function _testAddContact($firstName, $lastName, $email, $groupName, $deceased = FALSE) { $this->webtestAddContact($firstName, $lastName, $email); if ($deceased) { diff --git a/tests/phpunit/WebTest/Contact/GroupAddTest.php b/tests/phpunit/WebTest/Contact/GroupAddTest.php index 9e4fa165c7..e0e801e1cb 100644 --- a/tests/phpunit/WebTest/Contact/GroupAddTest.php +++ b/tests/phpunit/WebTest/Contact/GroupAddTest.php @@ -183,6 +183,11 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase { $this->_roleDelete($role); } + /** + * @param $roleid + * + * @return string + */ function _testCreateUser($roleid) { $this->open($this->sboxPath . "admin/people/create"); @@ -216,6 +221,9 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase { return $name; } + /** + * @param $role + */ function _roleDelete($role) { $this->waitForElementPresent("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']"); $this->click("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']"); diff --git a/tests/phpunit/WebTest/Contact/MergeContactsTest.php b/tests/phpunit/WebTest/Contact/MergeContactsTest.php index 28de7db35c..7185c315b8 100644 --- a/tests/phpunit/WebTest/Contact/MergeContactsTest.php +++ b/tests/phpunit/WebTest/Contact/MergeContactsTest.php @@ -195,6 +195,11 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->assertChecked("check_3"); } + /** + * @param $firstName + * @param $lastName + * @param $subject + */ function addActivity($firstName, $lastName, $subject) { $withContact = substr(sha1(rand()), 0, 7); $this->webtestAddContact($withContact, "Anderson", $withContact . "@anderson.name"); diff --git a/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php b/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php index f726500be5..8f6b7102b9 100644 --- a/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php +++ b/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php @@ -137,6 +137,12 @@ class WebTest_Contact_ProfileChecksumTest extends CiviSeleniumTestCase { $this->assertStringsPresent($checkFieldValues); } + /** + * @param $fields + * @param $profileName + * + * @return null + */ function _testCreateContactProfile($fields, $profileName) { // Add new profile. $this->openCiviPage("admin/uf/group", "reset=1"); diff --git a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php index 60c82a1684..7954bf636a 100644 --- a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php +++ b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php @@ -68,6 +68,9 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { } // function to create contact with details (contact details, address, Constituent information ...) + /** + * @param null $firstName + */ function createDetailContact($firstName = NULL) { if (!$firstName) { @@ -205,6 +208,13 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { $this->_advancedSearch("this is notes by $firstName8", $firstName8, NULL, NULL, 'note_both', 'notes'); } + /** + * @param $field + * @param null $fieldValue + * @param null $name + * @param string $op + * @param null $count + */ function _searchBuilder($field, $fieldValue = NULL, $name = NULL, $op = '=', $count = NULL) { // search builder using contacts(not using contactType) $this->openCiviPage("contact/search/builder", "reset=1"); @@ -264,6 +274,13 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { } } + /** + * @param null $fieldValue + * @param null $name + * @param null $contactType + * @param null $count + * @param $field + */ function _advancedSearch($fieldValue = NULL, $name = NULL, $contactType = NULL, $count = NULL, $field) { //advanced search by selecting the contactType $this->openCiviPage("contact/search/advanced", "reset=1"); @@ -309,6 +326,13 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { } } + /** + * @param $contactType + * @param $name + * @param $email + * @param null $streetName + * @param null $postalCode + */ function _createContact($contactType, $name, $email, $streetName = NULL, $postalCode = NULL) { $this->openCiviPage('contact/add', array('reset' => 1, 'ct' => $contactType), '_qf_Contact_cancel'); diff --git a/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php b/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php index 54530b9eaa..b6a020c7ad 100644 --- a/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php +++ b/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php @@ -149,6 +149,9 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase { $this->waitForPageToLoad(2 * $this->getTimeoutMsec()); } + /** + * @param array $openedPanes + */ function _checkOpenedPanes($openedPanes = array( )) { if (!$this->isTextPresent('No matches found')) { @@ -168,6 +171,10 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase { } } + /** + * @param $paneRef + * @param array $selectFields + */ function _selectPaneFields($paneRef, $selectFields = array( )) { $pane = $this->_advanceSearchPanesDateFilter($paneRef); @@ -214,6 +221,11 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase { } } + /** + * @param null $paneRef + * + * @return array + */ function _advanceSearchPanesDateFilter($paneRef = NULL) { static $_advance_search_panes; diff --git a/tests/phpunit/WebTest/Contact/TagSetSearchTest.php b/tests/phpunit/WebTest/Contact/TagSetSearchTest.php index 0974896406..b634c61119 100644 --- a/tests/phpunit/WebTest/Contact/TagSetSearchTest.php +++ b/tests/phpunit/WebTest/Contact/TagSetSearchTest.php @@ -110,6 +110,9 @@ class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase { $this->assertElementContainsText('css=.crm-search-results table.selector', "Anderson, $contact2"); } + /** + * @return array + */ function _testAddTagSet() { // Go to add tag set url. $this->openCiviPage('admin/tag', 'action=add&reset=1&tagset=1'); diff --git a/tests/phpunit/WebTest/Contribute/AddBatchesTest.php b/tests/phpunit/WebTest/Contribute/AddBatchesTest.php index 4f38f2ac6a..7ec0e2e6c4 100644 --- a/tests/phpunit/WebTest/Contribute/AddBatchesTest.php +++ b/tests/phpunit/WebTest/Contribute/AddBatchesTest.php @@ -112,6 +112,11 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase { $this->_verifyData($data, "Membership"); } + /** + * @param $data + * @param $row + * @param $type + */ function _fillData($data, $row, $type) { $email = $data['first_name'] . '@example.com'; $this->webtestNewDialogContact($data['first_name'], $data['last_name'], $email, 4, @@ -164,6 +169,10 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase { } } + /** + * @param $data + * @param $type + */ function _checkResult($data, $type) { if ($type == "Contribution") { $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low"); @@ -224,6 +233,10 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase { } } + /** + * @param $data + * @param $type + */ function _verifyData($data, $type) { $this->waitForElementPresent("xpath=//div[@id='crm-batch-selector_wrapper']//table//tbody/tr[1]/td[7]/span/a[text()='Enter records']"); $this->clickLink("xpath=//div[@id='crm-batch-selector_wrapper']//table//tbody/tr[1]/td[7]/span/a[text()='Enter records']", "_qf_Entry_upload"); diff --git a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php index 40682c41d7..675ce0c7a6 100644 --- a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php @@ -64,6 +64,12 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { $this->_testVerifyPriceSet($validateStrings, $sid); } + /** + * @param $setTitle + * @param $usedFor + * @param $setHelp + * @param null $financialType + */ function _testAddSet($setTitle, $usedFor, $setHelp, $financialType = NULL) { $this->openCiviPage("admin/price", "reset=1&action=add", '_qf_Set_next-bottom'); @@ -85,6 +91,12 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { $this->clickLink('_qf_Set_next-bottom', '_qf_Field_next-bottom'); } + /** + * @param $fields + * @param $validateString + * @param $financialType + * @param bool $dateSpecificFields + */ function _testAddPriceFields(&$fields, &$validateString, $financialType, $dateSpecificFields = FALSE) { $validateStrings[] = $financialType; foreach ($fields as $label => $type) { @@ -165,6 +177,9 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { } } + /** + * @return string + */ function _testAddFinancialType() { //Add new Financial Type $financialType['name'] = 'FinancialType ' . substr(sha1(rand()), 0, 4); @@ -174,6 +189,10 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { return $financialType['name']; } + /** + * @param $validateStrings + * @param $sid + */ function _testVerifyPriceSet($validateStrings, $sid) { // verify Price Set at Preview page // start at Manage Price Sets listing diff --git a/tests/phpunit/WebTest/Contribute/ConfirmOptionalTest.php b/tests/phpunit/WebTest/Contribute/ConfirmOptionalTest.php index 1b0cdb5a05..3ad03aafc3 100644 --- a/tests/phpunit/WebTest/Contribute/ConfirmOptionalTest.php +++ b/tests/phpunit/WebTest/Contribute/ConfirmOptionalTest.php @@ -56,6 +56,9 @@ class WebTest_Contribute_ConfirmOptionalTest extends CiviSeleniumTestCase { $this->assertFalse($this->isTextPresent("Your contribution will not be completed until"), "Loaded confirmation page"); } + /** + * @param $isConfirmEnabled + */ protected function _addContributionPage($isConfirmEnabled) { // log in $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php index 81ce6e861a..e35ecf3ad5 100644 --- a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php @@ -308,6 +308,12 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { } //common function for doing offline contribution + /** + * @param $params + * @param $firstName + * @param $lastName + * @param $processorName + */ function _doOfflineContribution($params, $firstName, $lastName, $processorName) { $this->waitForElementPresent("css=li#tab_contribute a"); @@ -359,6 +365,9 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { } //common function for verifing total_amount, and non_deductible_amount + /** + * @param $verifyData + */ function _verifyAmounts($verifyData) { // since we are doing test contributions we need to search for test contribution and select first contribution // record for the contact diff --git a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php index f0dda80072..69099696bd 100644 --- a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php +++ b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php @@ -554,6 +554,11 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->_testOrganization($pageId, $cid, $pageTitle); } + /** + * @param $pageId + * @param $cid + * @param $pageTitle + */ function _testOrganization($pageId, $cid, $pageTitle) { //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom"); @@ -580,6 +585,11 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { } + /** + * @param $pageId + * @param $cid + * @param $pageTitle + */ function _testAnomoyousOganization($pageId, $cid, $pageTitle) { //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom"); @@ -650,6 +660,11 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { } } + /** + * @param $pageId + * @param $cid + * @param $pageTitle + */ function _testUserWithOneRelationship($pageId, $cid, $pageTitle) { $this->webtestLogin('admin'); @@ -891,6 +906,11 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent('Selected Profile Field has been deleted.'), "Status message didn't show up after saving!"); } + /** + * @param $pageId + * @param $cid + * @param $pageTitle + */ function _testUserWithMoreThanOneRelationship($pageId, $cid, $pageTitle) { $this->webtestLogin('admin'); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -1362,6 +1382,11 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "Selected Profile Field has been deleted."); } + /** + * @param $pageId + * @param $cid + * @param $pageTitle + */ function _testOrganizationWithImageUpload($pageId, $cid, $pageTitle) { //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", '_qf_Main_upload-bottom'); diff --git a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php index f0f7d1b5d5..4c5b33786f 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php @@ -247,6 +247,10 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { $this->_doContributionAndVerifyData($pageId, TRUE); } + /** + * @param $pageId + * @param bool $priceSet + */ function _doContributionAndVerifyData($pageId, $priceSet = FALSE) { //logout $this->webtestLogout(); diff --git a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php index 24926cc447..2468e4ee12 100644 --- a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php @@ -183,7 +183,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { 'is_reserved' => FALSE, 'is_deductible' => FALSE, ); - + $this->addeditFinancialType($financialType); $this->addStandaloneContribution($financialType); $this->addStandaloneContribution($financialType); @@ -194,11 +194,11 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { $this->clickLink("_qf_Search_refresh"); $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[1]", "2 Result"); $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[2]", "Financial Type IN {$financialType['name']}"); - + $this->openCiviPage("contact/search/advanced", "reset=1", "_qf_Advanced_refresh-top"); $this->click('CiviContribute'); $this->waitForElementPresent("financial_type_id"); - + // select group $this->select("financial_type_id", "label={$financialType['name']}"); $this->clickLink("_qf_Advanced_refresh-top"); @@ -206,8 +206,11 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { $this->assertElementContainsText("xpath=//div[@id='search-status']//table/tbody/tr[1]/td[2]", "Financial Type IN {$financialType['name']}"); } + /** + * @param $financialType + */ function addStandaloneContribution($financialType) { - + $this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload"); // create new contact using dialog diff --git a/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php index 8f364a60a6..ce53edaa43 100644 --- a/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateBatchPendingContributionTest.php @@ -128,6 +128,9 @@ class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSelenium $this->webtestVerifyTabularData($expected); } + /** + * @param $firstName + */ function _addParticipant($firstName) { $this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", '_qf_Participant_upload-bottom'); diff --git a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php index b8fb41575f..b9c9451b7a 100644 --- a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php @@ -132,7 +132,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->select("account_relationship", "label=Premiums Inventory Account is"); $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'; @@ -204,7 +204,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $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->select("financial_account_id", "label=$to"); $this->clickLink("_qf_FinancialTypeAccount_next-botttom", "xpath=//a[@id='newfinancialTypeAccount']", FALSE); @@ -384,7 +384,16 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->assertEquals($fValue2, "100.00", "Verify Amount"); } - function _getPremiumActualCost($entityId, $from = NULL, $to = NULL, $cost = NULL, $entityTable = NULL, $select = "ft.total_amount AS amount") { + /** + * @param $entityId + * @param null $from + * @param null $to + * @param null $cost + * @param null $entityTable + * @param string $select + * + * @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 {$select} @@ -408,7 +417,11 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { return $result; } - function _getFinancialTrxnAmount($contId) { + /** + * @param $contId + * + * @return null|string + */function _getFinancialTrxnAmount($contId) { $query = "SELECT SUM( ft.total_amount ) AS total FROM civicrm_financial_trxn AS ft @@ -419,7 +432,11 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { return $result; } - function _getFinancialItemAmount($contId) { + /** + * @param $contId + * + * @return null|string + */function _getFinancialItemAmount($contId) { $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution')); $query = "SELECT SUM(amount) @@ -430,7 +447,11 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { return $result; } - function _getTotalContributedAmount($contId) { + /** + * @param $contId + * + * @return null|string + */function _getTotalContributedAmount($contId) { $query = "SELECT SUM(amount) FROM civicrm_entity_financial_trxn @@ -440,7 +461,14 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { return $result; } - function _testOfflineContribution($firstName, $lastName, $email, $amount, $status="Completed") { + /** + * @param $firstName + * @param $lastName + * @param $email + * @param $amount + * @param string $status + */ + function _testOfflineContribution($firstName, $lastName, $email, $amount, $status="Completed") { $this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload"); diff --git a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php index 56204097ff..75938e12e7 100644 --- a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php @@ -72,6 +72,11 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC $this->verifyText("xpath=id('contributionSearch')/table[1]/tbody/tr[2]/td[9]", preg_quote($status)); } + /** + * @param $firstName + * @param $lastName + * @param $email + */ function _testOfflineContribution($firstName, $lastName, $email) { // Create a contact to be used as soft creditor $softCreditFname = substr(sha1(rand()), 0, 7); @@ -175,6 +180,11 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC } } + /** + * @param $firstName + * @param $lastName + * @param $email + */ function _testOnlineContribution($firstName, $lastName, $email) { // We need a payment processor diff --git a/tests/phpunit/WebTest/Contribute/VerifySSLContributionTest.php b/tests/phpunit/WebTest/Contribute/VerifySSLContributionTest.php index 46ad13b59b..77f1dcefda 100644 --- a/tests/phpunit/WebTest/Contribute/VerifySSLContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/VerifySSLContributionTest.php @@ -99,6 +99,9 @@ class WebTest_Contribute_VerifySSLContributionTest extends CiviSeleniumTestCase } } + /** + * @param $name + */ function _tryPaymentProcessor($name) { // load contribution page $this->openCiviPage("contribute/transact", "reset=1&action=preview&id={$this->pageId}", "_qf_Main_upload-bottom"); diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index e1c338ee9a..6a07dd63fc 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -204,6 +204,11 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->_deleteDiscount($id, $eventTitle, $discount); } + /** + * @param $id + * @param $eventTitle + * @param $discount + */ function _deleteDiscount($id, $eventTitle, $discount) { $this->openCiviPage("event/manage/fee", "reset=1&action=update&id=$id", "_qf_Fee_upload-bottom"); $this->type("discount_name_2", ""); @@ -327,6 +332,10 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl); } + /** + * @param $eventTitle + * @param $eventDescription + */ function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); @@ -354,6 +363,12 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } + /** + * @param $eventTitle + * @param $eventDescription + * @param $templateID + * @param $eventTypeID + */ function _testAddEventInfoFromTemplate($eventTitle, $eventDescription, $templateID, $eventTypeID) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); @@ -386,6 +401,9 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { } + /** + * @param $streetAddress + */ function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -406,6 +424,15 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->waitForTextPresent("'Location' information has been saved."); } + /** + * @param bool $discount + * @param bool $priceSet + * @param string $processorName + * @param bool $double + * @param bool $payLater + * + * @return array + */ function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro", $double = FALSE, $payLater = FALSE) { $discount1 = "Early-bird" . substr(sha1(rand()), 0, 7); $discount2 = ""; @@ -471,6 +498,10 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { return array($discount1, $discount2); } + /** + * @param $registerIntro + * @param bool $multipleRegistrations + */ function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { // Go to Online Registration tab $this->click("link=Online Registration"); @@ -496,6 +527,13 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->waitForTextPresent("'Registration' information has been saved."); } + /** + * @param $eventTitle + * @param $eventInfoStrings + * @param null $eventFees + * + * @return null + */ function _testVerifyEventInfo($eventTitle, $eventInfoStrings, $eventFees = NULL) { // verify event input on info page // start at Manage Events listing @@ -516,6 +554,11 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { return $this->urlArg('id'); } + /** + * @param $registerStrings + * + * @return string + */ function _testVerifyRegisterPage($registerStrings) { // Go to Register page and check for intro text and fee levels $this->click("link=Register Now"); @@ -524,6 +567,16 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { return $this->getLocation(); } + /** + * @param $registerUrl + * @param int $numberRegistrations + * @param bool $anonymous + * @param bool $isPayLater + * @param array $participantEmailInfo + * @param null $paymentProcessor + * + * @return array + */ function _testOnlineRegistration($registerUrl, $numberRegistrations = 1, $anonymous = TRUE, $isPayLater = FALSE, $participantEmailInfo = array(), $paymentProcessor = NULL) { $infoPassed = FALSE; if (!empty($participantEmailInfo)) { @@ -615,6 +668,9 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { return $primaryParticipantInfo; } + /** + * @param $eventTitle + */ function _testAddReminder($eventTitle) { // Go to Schedule Reminders tab $this->click('css=li#tab_reminder a'); @@ -786,6 +842,9 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { $this->verifyFinancialRecords($contributionID); } + /** + * @param $contributionID + */ function verifyFinancialRecords($contributionID) { // check count for civicrm_contribution and civicrm_financial_item in civicrm_entity_financial_trxn $query = "SELECT COUNT(DISTINCT(c1.id)) civicrm_contribution, COUNT(c2.id) civicrm_financial_item FROM civicrm_entity_financial_trxn c1 @@ -898,7 +957,10 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'"; } - function _testEnableParticipantStatuses($status) { + /** + * @param $status + */ + function _testEnableParticipantStatuses($status) { // enable participant status if ($this->isElementPresent("xpath=//td[@class='crm-particpant-label'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']")){ $this->click("xpath=//td[@class='crm-particpant-label'][contains(text(), '{$status}')]/../td[9]/span/a[2][text()='Enable']"); diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index 7b12137292..f3fcfb46d2 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -415,6 +415,11 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { } } + /** + * @param $firstName + * @param $lastName + * @param $processorId + */ function _fillParticipantDetails($firstName, $lastName, $processorId) { $this->webtestNewDialogContact($firstName, $lastName); diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index 3d433f436f..f8e5f376f0 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -61,6 +61,12 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->_testVerifyPriceSet($validateStrings, $sid); } + /** + * @param $setTitle + * @param $usedFor + * @param $setHelp + * @param string $financialType + */ function _testAddSet($setTitle, $usedFor, $setHelp, $financialType = 'Event Fee') { $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom'); @@ -81,6 +87,11 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->clickLink('_qf_Set_next-bottom', '_qf_Field_next-bottom'); } + /** + * @param $fields + * @param $validateStrings + * @param bool $dateSpecificFields + */ function _testAddPriceFields(&$fields, &$validateStrings, $dateSpecificFields = FALSE) { foreach ($fields as $label => $type) { $validateStrings[] = $label; @@ -164,6 +175,10 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { } } + /** + * @param $validateStrings + * @param $sid + */ function _testVerifyPriceSet($validateStrings, $sid) { // verify Price Set at Preview page // start at Manage Price Sets listing @@ -657,17 +672,17 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { function testDeletePriceSetforEventTemplate() { // Log in using webtestLogin() method $this->webtestLogin(); - + $setTitle = 'Conference Fees - ' . substr(sha1(rand()), 0, 7); $usedFor = 'Event'; $setHelp = 'Select your conference options.'; $this->_testAddSet($setTitle, $usedFor, $setHelp); - + // Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form // which is where we are after adding Price Set. $sid = $this->urlArg('sid'); $this->assertType('numeric', $sid); - + $validStrings = array(); $fields = array( 'Test Field' => 'Text', @@ -686,7 +701,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->select("default_role_id", "value=1"); $this->type("title", "Test Event"); $this->type("summary", "This is a great conference. Sign up now!"); - + $this->click("_qf_EventInfo_upload-bottom"); $this->waitForElementPresent('link=Fees'); // Go to Fees tab @@ -697,7 +712,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->select('price_set_id', 'label=' . $setTitle); $templateId = $this->urlArg('id'); $this->click('_qf_Fee_upload-bottom'); - + //check the delete for price field $this->openCiviPage("admin/price/field", "reset=1&action=browse&sid={$sid}"); $this->click("xpath=//table[@id='option11']/tbody/tr/td[9]/span[2]/ul/li[2]/a"); @@ -710,7 +725,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { //assert the message $this->waitForText('price_set_used_by', "it is currently in use by one or more active events or contribution pages or contributions or event templates."); - + //check the delete for priceset $this->openCiviPage("admin/price", "reset=1"); $this->click("xpath=//table[@id='option11']/tbody/tr/td[4]/span[2]/ul/li[3]/a"); @@ -724,7 +739,10 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->waitForText('price_set_used_by', "it is currently in use by one or more active events or contribution pages or contributions or event templates."); } - + + /** + * @param $expectedLineItems + */ function _checkLineItems($expectedLineItems) { foreach ($expectedLineItems as $lineKey => $lineValue) { foreach ($lineValue as $key => $value) { diff --git a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php index 2b6958560c..2fd858d11b 100644 --- a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php +++ b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php @@ -211,6 +211,10 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { $this->waitForElementPresent("xpath=//table[@id='info']/tbody/tr/th[6][contains(text(), 'Status')]/../../tr[2]/td[6][contains(text(), 'Completed')]/../../tr[3]/td[6][contains(text(), 'Completed')]"); } + /** + * @param $feeAmt + * @param $amtPaid + */ function _checkPaymentInfoTable($feeAmt, $amtPaid) { $this->assertElementContainsText("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td", "$ {$feeAmt}", 'Missing text: appropriate fee amount'); $this->assertElementContainsText("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td[2]", "$ {$amtPaid}", 'Missing text: appropriate fee amount'); diff --git a/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php b/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php index 9f0660519c..0946b87967 100644 --- a/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php +++ b/tests/phpunit/WebTest/Event/ChangeParticipantStatus.php @@ -98,6 +98,9 @@ class WebTest_Event_ChangeParticipantStatus extends CiviSeleniumTestCase { $this->webtestVerifyTabularData(array('Status' => 'Attended')); } + /** + * @param $firstName + */ function addParticipant($firstName) { $this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", '_qf_Participant_upload-bottom'); diff --git a/tests/phpunit/WebTest/Event/EventListingTest.php b/tests/phpunit/WebTest/Event/EventListingTest.php index 380e544117..5aad33f701 100644 --- a/tests/phpunit/WebTest/Event/EventListingTest.php +++ b/tests/phpunit/WebTest/Event/EventListingTest.php @@ -109,6 +109,11 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase { $this->waitForTextPresent("The block settings have been updated."); } + /** + * @param $eventTitle + * @param $startdate + * @param $enddate + */ function _testCreateEvent($eventTitle, $startdate, $enddate) { $this->openCiviPage("event/add", "reset=1&action=add"); diff --git a/tests/phpunit/WebTest/Event/EventWaitListTest.php b/tests/phpunit/WebTest/Event/EventWaitListTest.php index e2e35410a3..17c9ae70d3 100644 --- a/tests/phpunit/WebTest/Event/EventWaitListTest.php +++ b/tests/phpunit/WebTest/Event/EventWaitListTest.php @@ -149,6 +149,10 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase { $this->assertStringsPresent("This event is currently full."); } + /** + * @param $eventTitle + * @param $eventInfoStrings + */ function _testVerifyEventInfo($eventTitle, $eventInfoStrings) { // verify event input on info page // start at Manage Events listing @@ -159,6 +163,11 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase { $this->assertStringsPresent($eventInfoStrings); } + /** + * @param $registerStrings + * + * @return string + */ function _testVerifyRegisterPage($registerStrings) { // Go to Register page and check for intro text and fee levels $this->click("link=Register Now"); @@ -167,6 +176,11 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase { return $this->getLocation(); } + /** + * @param $registerUrl + * @param int $numberRegistrations + * @param bool $anonymous + */ function _testOnlineRegistration($registerUrl, $numberRegistrations = 1, $anonymous = TRUE) { if ($anonymous) { $this->webtestLogout(); diff --git a/tests/phpunit/WebTest/Event/MultipleEventRegistrationbyCartTest.php b/tests/phpunit/WebTest/Event/MultipleEventRegistrationbyCartTest.php index 6688af918a..bd053cdb74 100755 --- a/tests/phpunit/WebTest/Event/MultipleEventRegistrationbyCartTest.php +++ b/tests/phpunit/WebTest/Event/MultipleEventRegistrationbyCartTest.php @@ -228,6 +228,10 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest $this->_checkContributionsandEventRegistration($value[0], $value[1], $events); } + /** + * @param $eventTitle + * @param $eventDescription + */ function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); @@ -253,6 +257,9 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest $this->click("_qf_EventInfo_upload-bottom"); } + /** + * @param $streetAddress + */ function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -271,6 +278,11 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest $this->waitForTextPresent("'Location' information has been saved."); } + /** + * @param bool $discount + * @param bool $priceSet + * @param string $processorName + */ function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") { // Go to Fees tab $this->click("link=Fees"); @@ -309,6 +321,10 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest $this->waitForTextPresent("'Fee' information has been saved."); } + /** + * @param $registerIntro + * @param bool $multipleRegistrations + */ function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { // Go to Online Registration tab $this->click("link=Online Registration"); @@ -333,6 +349,11 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest $this->waitForTextPresent("'Registration' information has been saved."); } + /** + * @param $eventTitle + * @param $eventInfoStrings + * @param null $eventFees + */ function _AddEventToCart($eventTitle, $eventInfoStrings, $eventFees = NULL) { // verify event input on info page // start at Manage Events listing @@ -343,6 +364,13 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest $this->assertTrue($this->isTextPresent("$eventTitle has been added to your cart")); } + /** + * @param $eventTitle + * @param $eventInfoStrings + * @param null $eventFees + * + * @return string + */ function _testVerifyEventInfo($eventTitle, $eventInfoStrings, $eventFees = NULL) { // verify event input on info page // start at Manage Events listing @@ -361,6 +389,11 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest return $this->getLocation(); } + /** + * @param $registerUrl + * @param int $numberRegistrations + * @param bool $anonymous + */ function _testOnlineRegistration($registerUrl, $numberRegistrations = 1, $anonymous = TRUE) { if ($anonymous) { $this->webtestLogout(); @@ -372,6 +405,9 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest $this->waitForPageToLoad($this->getTimeoutMsec()); } + /** + * @return array + */ function _testCheckOut() { //View the Cart $this->click("xpath=//div[@id='messages']/div/div/a[text()='View your cart.']"); @@ -411,6 +447,11 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest return array($firstName, $lastName); } + /** + * @param $firstName + * @param $lastName + * @param $events + */ function _checkContributionsandEventRegistration($firstName, $lastName, $events) { //Type the registered participant's email in autocomplete. $this->click('sort_name_navigation'); diff --git a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php index 3b09c4c3a8..e1d4003be5 100644 --- a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php +++ b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php @@ -265,6 +265,11 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } + /** + * @param $customGrpId1 + * + * @return array + */ function _testGetCustomFieldId($customGrpId1) { $customId = array(); @@ -306,6 +311,9 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { return $customId; } + /** + * @param $eventPageId + */ function _testRemoveProfile($eventPageId) { $this->openCiviPage("event/manage/settings", "reset=1&action=update&id=$eventPageId"); @@ -320,6 +328,11 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Registration_upload-bottom"); } + /** + * @param $customId + * + * @return array + */ function _testGetProfileId($customId) { // create profiles $profileId = array(); @@ -392,6 +405,13 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { return $profileId; } + /** + * @param $profilefield + * @param int $location + * @param $type + * + * @return null + */ function _testCreateProfile($profilefield, $location = 0, $type) { $locationfields = array( 'supplemental_address_1', @@ -437,6 +457,10 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { return $profileId; } + /** + * @param $eventTitle + * @param $eventDescription + */ function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); @@ -462,6 +486,9 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->click("_qf_EventInfo_upload-bottom"); } + /** + * @param $streetAddress + */ function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -482,6 +509,11 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->waitForTextPresent("'Event Location' information has been saved."); } + /** + * @param bool $discount + * @param bool $priceSet + * @param string $processorName + */ function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") { // Go to Fees tab $this->click("link=Fees"); @@ -516,6 +548,11 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->waitForTextPresent("'Fees' information has been saved."); } + /** + * @param $profileId + * + * @return null + */ function _testAddMultipleProfile($profileId) { // Go to Online Contribution tab $this->click("link=Online Registration"); @@ -583,6 +620,16 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { return $this->urlArg('id'); } + /** + * @param $eventPageId + * @param $customId + * @param $firstName + * @param $lastName + * @param $participantfname + * @param $participantlname + * @param $email1 + * @param $email2 + */ function _testEventRegistration($eventPageId, $customId, $firstName, $lastName, $participantfname, $participantlname, $email1, $email2 ) { @@ -662,6 +709,16 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } + /** + * @param $eventPageId + * @param $customId + * @param $firstName2 + * @param $lastName2 + * @param $participantfname2 + * @param $participantlname2 + * @param $email3 + * @param $email4 + */ function _testEventRegistrationAfterRemoving($eventPageId, $customId, $firstName2, $lastName2, $participantfname2, $participantlname2, $email3, $email4) { $this->openCiviPage("event/register", "id={$eventPageId}&reset=1", "_qf_Register_upload-bottom"); $this->select("additional_participants", "value=1"); @@ -727,6 +784,9 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $this->click("_qf_Confirm_next-bottom"); } + /** + * @return array|string + */ function _addEmailField() { //add email field in name and address profile $this->openCiviPage('admin/uf/group/field/add', 'reset=1&action=add&gid=1', "_qf_Field_next-bottom"); @@ -746,6 +806,9 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { return $cfId; } + /** + * @param $cfId + */ function _removeEmailField($cfId) { $this->openCiviPage("admin/uf/group/field", "action=delete&id={$cfId}"); $this->click("_qf_Field_next-bottom"); diff --git a/tests/phpunit/WebTest/Event/PCPAddTest.php b/tests/phpunit/WebTest/Event/PCPAddTest.php index ba005219b7..44a7c5694c 100644 --- a/tests/phpunit/WebTest/Event/PCPAddTest.php +++ b/tests/phpunit/WebTest/Event/PCPAddTest.php @@ -112,6 +112,15 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->_testAddEventForPCP($processorName, $campaignType, NULL, $firstName, $lastName, $middleName, $email); } + /** + * @param $processorName + * @param $campaignType + * @param null $contributionPageId + * @param $firstName + * @param $lastName + * @param $middleName + * @param $email + */ function _testAddEventForPCP($processorName, $campaignType, $contributionPageId = NULL, $firstName, $lastName, $middleName, $email) { $this->openCiviPage("event/add", "reset=1&action=add"); @@ -134,6 +143,10 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->_testOnlineRegistration($eventTitle, $pageId, $firstName, $lastName, $middleName, $email, '', $campaignType, TRUE); } + /** + * @param $eventTitle + * @param $eventDescription + */ function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); @@ -159,6 +172,9 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->click("_qf_EventInfo_upload-bottom"); } + /** + * @param $streetAddress + */ function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -179,6 +195,11 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->waitForTextPresent("'Event Location' information has been saved."); } + /** + * @param bool $discount + * @param bool $priceSet + * @param string $processorName + */ function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName = "PP Pro") { // Go to Fees tab $this->click("link=Fees"); @@ -209,6 +230,10 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->waitForTextPresent("'Fees' information has been saved."); } + /** + * @param $registerIntro + * @param bool $multipleRegistrations + */ function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { // Go to Online Registration tab $this->click("link=Online Registration"); @@ -234,6 +259,17 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->waitForTextPresent("'Online Registration' information has been saved."); } + /** + * @param $eventTitle + * @param $pageId + * @param $firstName + * @param $lastName + * @param $middleName + * @param $email + * @param int $numberRegistrations + * @param $campaignType + * @param bool $anonymous + */ function _testOnlineRegistration($eventTitle, $pageId, $firstName, $lastName, $middleName, $email, $numberRegistrations = 1, $campaignType, $anonymous = TRUE) { $hash = substr(sha1(rand()), 0, 7); $contributionAmount = 600; @@ -393,6 +429,12 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { } } + /** + * @param $campaignType + * @param $contributionPageId + * + * @return null + */ function _testEventPcpAdd($campaignType, $contributionPageId) { $hash = substr(sha1(rand()), 0, 7); $isPcpApprovalNeeded = TRUE; @@ -430,6 +472,14 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { return $this->urlArg('id'); } + /** + * @param $eventName + * @param $lastNameDonar + * @param $firstNameDonar + * @param $firstNameCreator + * @param $lastNameCreator + * @param $amount + */ function _testParticipantSearchEventName($eventName, $lastNameDonar, $firstNameDonar, $firstNameCreator, $lastNameCreator, $amount) { $sortName = $lastNameDonar . ', ' . $firstNameDonar; $this->openCiviPage("event/search", "reset=1"); @@ -454,6 +504,13 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { $this->verifyText("xpath=//div[@id='PCPView']/div[2]//table[@class='crm-info-panel']/tbody/tr[2]/td[2]", preg_quote($softCreditor), 'In line ' . __LINE__); } + /** + * @param $firstName + * @param $lastName + * @param $pcpCreatorFirstName + * @param $pcpCreatorLastName + * @param $amount + */ function _testSearchTest($firstName, $lastName, $pcpCreatorFirstName, $pcpCreatorLastName, $amount) { $sortName = "$pcpCreatorLastName, $pcpCreatorFirstName"; $displayName = "$firstName $lastName"; diff --git a/tests/phpunit/WebTest/Event/ParticipantCountTest.php b/tests/phpunit/WebTest/Event/ParticipantCountTest.php index 8b16442c4b..47df58ac57 100644 --- a/tests/phpunit/WebTest/Event/ParticipantCountTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantCountTest.php @@ -292,6 +292,10 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->_testPricesetDetailsCustomSearch($paramsEvent, $participants, $priceFieldOptionCounts); } + /** + * @param $setTitle + * @param string $financialType + */ function _testAddSet($setTitle, $financialType = 'Event Fee') { $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom'); @@ -305,6 +309,9 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->clickLink('_qf_Set_next-bottom', '_qf_Field_next-bottom'); } + /** + * @param $options + */ function _testAddMultipleChoiceOptions($options) { foreach ($options as $oIndex => $oValue) { $this->type("option_label_{$oIndex}", $oValue['label']); @@ -318,6 +325,11 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->click('CIVICRM_QFID_1_2'); } + /** + * @param $params + * + * @return string + */ function _testAddEvent($params) { $this->openCiviPage('event/add', 'reset=1&action=add', '_qf_EventInfo_upload-bottom'); @@ -391,6 +403,9 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { return $this->getLocation(); } + /** + * @param array $participant + */ function _testRegisterWithBillingInfo($participant = array()) { $this->waitForElementPresent("credit_card_type"); $this->select('credit_card_type', 'value=Visa'); @@ -415,6 +430,11 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->assertStringsPresent($thankStrings); } + /** + * @param $eventParams + * @param $participants + * @param $priceFieldOptionCounts + */ function _testPricesetDetailsCustomSearch($eventParams, $participants, $priceFieldOptionCounts) { $this->openCiviPage('contact/search/custom', 'csid=9&reset=1'); diff --git a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php index 5851befbad..62a5532f79 100644 --- a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php @@ -31,6 +31,9 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { parent::setUp(); } + /** + * @param $strings + */ function _checkStrings(&$strings) { // search for elements foreach ($strings as $string) { diff --git a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php index 66f6d2c474..d3547c2dad 100644 --- a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php +++ b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php @@ -1026,6 +1026,10 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { $this->_checkConfirmationAndRegister(); } + /** + * @param $setTitle + * @param null $financialType + */ function _testAddSet($setTitle, $financialType = NULL) { $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom'); @@ -1044,6 +1048,9 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { $this->clickLink('_qf_Set_next-bottom', '_qf_Field_next-bottom'); } + /** + * @param $fields + */ function _testAddPriceFields($fields) { $fieldCount = count($fields); $count = 1; @@ -1095,6 +1102,10 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { } } + /** + * @param $options + * @param $fieldType + */ function _testAddMultipleChoiceOptions($options, $fieldType) { foreach ($options as $oIndex => $oValue) { $this->type("option_label_{$oIndex}", $oValue['label']); @@ -1126,6 +1137,11 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { } } + /** + * @param $params + * + * @return string + */ function _testAddEvent($params) { $this->openCiviPage('event/add', 'reset=1&action=add', '_qf_EventInfo_upload-bottom'); diff --git a/tests/phpunit/WebTest/Event/TellAFriendTest.php b/tests/phpunit/WebTest/Event/TellAFriendTest.php index 8b01cd7430..93c36aeaa6 100644 --- a/tests/phpunit/WebTest/Event/TellAFriendTest.php +++ b/tests/phpunit/WebTest/Event/TellAFriendTest.php @@ -166,6 +166,10 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { ); } + /** + * @param $eventTitle + * @param $eventDescription + */ function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); @@ -191,6 +195,9 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->click("_qf_EventInfo_upload-bottom"); } + /** + * @param $streetAddress + */ function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -211,6 +218,10 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->waitForTextPresent("'Event Location' information has been saved."); } + /** + * @param $registerIntro + * @param bool $multipleRegistrations + */ function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { // Go to Online Registration tab $this->click("link=Online Registration"); @@ -235,6 +246,11 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->waitForTextPresent("'Online Registration' information has been saved."); } + /** + * @param $subject + * @param $thankYouMsg + * @param $eventTitle + */ function _testAddTellAFriend($subject, $thankYouMsg, $eventTitle) { // Go to Tell A Friend Tab $this->click('link=Tell a Friend'); diff --git a/tests/phpunit/WebTest/Export/ContactTest.php b/tests/phpunit/WebTest/Export/ContactTest.php index 9dc3eb46c0..cac2f6058c 100644 --- a/tests/phpunit/WebTest/Export/ContactTest.php +++ b/tests/phpunit/WebTest/Export/ContactTest.php @@ -411,6 +411,10 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { $this->reviewCSV($csvFile, $checkHeaders, $checkRows, 2); } + /** + * @param string $groupName + * @param string $parentGroupName + */ function addContactGroup($groupName = 'New Group', $parentGroupName = "- select group -") { $this->openCiviPage("group/add", "reset=1", "_qf_Edit_upload"); @@ -440,6 +444,14 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { $this->waitForText('crm-notification-container', "The Group '$groupName' has been saved."); } + /** + * @param string $fname + * @param string $lname + * @param null $email + * @param null $contactSubtype + * + * @return array + */ function webtestAddContactWithGenderPrefixSuffix($fname = 'Anthony', $lname = 'Anderson', $email = NULL, $contactSubtype = NULL) { $url = $this->sboxPath . 'civicrm/contact/add?reset=1&ct=Individual'; if ($contactSubtype) { @@ -479,6 +491,12 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { return array($email,$prefixLabel,$suffixLabel,$genderLabel); } + /** + * @param $optionGroupName + * @param $optionValue + * + * @return array|int + */ function getOptionLabel($optionGroupName,$optionValue){ $params = array( 'version' => 3, diff --git a/tests/phpunit/WebTest/Financial/FinancialBatchExport.php b/tests/phpunit/WebTest/Financial/FinancialBatchExport.php index e3132319db..238c783532 100644 --- a/tests/phpunit/WebTest/Financial/FinancialBatchExport.php +++ b/tests/phpunit/WebTest/Financial/FinancialBatchExport.php @@ -53,6 +53,15 @@ class WebTest_Financial_FinancialBatchExport extends CiviSeleniumTestCase { $this->_testExportBatch($setTitle, $batchId, $exportFormat); } + /** + * @param $setTitle + * @param $setDescription + * @param $setPaymentInstrument + * @param $numberOfTrxn + * @param $totalAmt + * + * @return null + */ function _testAddBatch($setTitle, $setDescription, $setPaymentInstrument, $numberOfTrxn, $totalAmt) { // Enter Optional Constraints $this->type('title', $setTitle); @@ -83,6 +92,9 @@ class WebTest_Financial_FinancialBatchExport extends CiviSeleniumTestCase { return $batchId; } + /** + * @param $numberOfTrxn + */ function _testAssignBatch($numberOfTrxn) { $this->select( "xpath=//div[@id='crm-transaction-selector-assign_length']/label/select[@name='crm-transaction-selector-assign_length']", "value=$numberOfTrxn" ); // Because it tends to cause problems, all uses of sleep() must be justified in comments @@ -95,6 +107,11 @@ class WebTest_Financial_FinancialBatchExport extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } + /** + * @param $setTitle + * @param $batchId + * @param $exportFormat + */ function _testExportBatch($setTitle, $batchId, $exportFormat) { $this->openCiviPage("financial/batch", "reset=1&action=export&id=$batchId"); if ($exportFormat == 'CSV') { diff --git a/tests/phpunit/WebTest/Generic/CheckDashboardTest.php b/tests/phpunit/WebTest/Generic/CheckDashboardTest.php index 0da9ce9ad7..620f45808e 100644 --- a/tests/phpunit/WebTest/Generic/CheckDashboardTest.php +++ b/tests/phpunit/WebTest/Generic/CheckDashboardTest.php @@ -46,6 +46,11 @@ class WebTest_Generic_CheckDashboardTest extends CiviSeleniumTestCase { // More dashlet tests can be added here using the functions modeled below } + /** + * @param $widgetConfigureID + * @param $widgetEnabledSelector + * @param $widgetTitle + */ function _testAddDashboardElement($widgetConfigureID, $widgetEnabledSelector, $widgetTitle) { // Check if desired widget is already loaded on dashboard and remove it if it is so we can test adding it. // Because it tends to cause problems, all uses of sleep() must be justified in comments @@ -88,6 +93,10 @@ class WebTest_Generic_CheckDashboardTest extends CiviSeleniumTestCase { $this->click("xpath=//*[@class='ui-button-text'][contains(text(), 'close')]"); } + /** + * @param $widgetConfigureID + * @param $widgetEnabledSelector + */ function _testRemoveDashboardElement($widgetConfigureID, $widgetEnabledSelector) { $this->click("link=Configure Your Dashboard"); $this->waitForElementPresent("dashlets-header-col-0"); diff --git a/tests/phpunit/WebTest/Import/ActivityTest.php b/tests/phpunit/WebTest/Import/ActivityTest.php index f92039a770..34fb129d48 100644 --- a/tests/phpunit/WebTest/Import/ActivityTest.php +++ b/tests/phpunit/WebTest/Import/ActivityTest.php @@ -46,6 +46,9 @@ class WebTest_Import_ActivityTest extends ImportCiviSeleniumTestCase { $this->importCSVComponent('Activity', $headers, $rows, NULL, NULL, $fieldMapper); } + /** + * @return array + */ function _activityCSVData() { $firstName1 = substr(sha1(rand()), 0, 7); diff --git a/tests/phpunit/WebTest/Import/AddressImportTest.php b/tests/phpunit/WebTest/Import/AddressImportTest.php index 5904fa3b8c..9cc6f0bb14 100644 --- a/tests/phpunit/WebTest/Import/AddressImportTest.php +++ b/tests/phpunit/WebTest/Import/AddressImportTest.php @@ -64,6 +64,12 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for custom data import. */ + /** + * @param $customDataParams + * @param $firstName1 + * + * @return array + */ function _individualCustomCSVData($customDataParams, $firstName1) { $headers = array( @@ -97,6 +103,9 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { return array($headers, $rows); } + /** + * @return array + */ function _addCustomData() { $this->openCiviPage('admin/custom/group', 'reset=1'); @@ -274,6 +283,12 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { ); } + /** + * @param $customFieldName + * @param $type + * + * @return array + */ function _createMultipleValueCustomField( $customFieldName, $type ){ $this->type('label', $customFieldName); $this->select("data_type[0]","value=0"); diff --git a/tests/phpunit/WebTest/Import/AddressParsingTest.php b/tests/phpunit/WebTest/Import/AddressParsingTest.php index d926e96be0..b20df90c21 100644 --- a/tests/phpunit/WebTest/Import/AddressParsingTest.php +++ b/tests/phpunit/WebTest/Import/AddressParsingTest.php @@ -180,6 +180,9 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide csv data with Valid Street Address. */ + /** + * @return array + */ function _validStreetAddressCSVData() { $headers = array( 'first_name' => 'First Name', @@ -228,6 +231,9 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide csv data with Invalid Street Address. */ + /** + * @return array + */ function _invalidStreetAddressCSVData() { $headers = array( 'first_name' => 'First Name', diff --git a/tests/phpunit/WebTest/Import/ContactCustomDataTest.php b/tests/phpunit/WebTest/Import/ContactCustomDataTest.php index ae33f06ef3..b64f018ec0 100644 --- a/tests/phpunit/WebTest/Import/ContactCustomDataTest.php +++ b/tests/phpunit/WebTest/Import/ContactCustomDataTest.php @@ -105,6 +105,12 @@ class WebTest_Import_ContactCustomDataTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for custom data import. */ + /** + * @param $customDataParams + * @param $firstName1 + * + * @return array + */ function _individualCustomCSVData($customDataParams, $firstName1) { $headers = array( 'first_name' => 'First Name', @@ -122,10 +128,18 @@ class WebTest_Import_ContactCustomDataTest extends ImportCiviSeleniumTestCase { return array($headers, $rows); } + /** + * @param $originalHeaders + * @param $originalRows + * @param $checkSummary + */ function checkDuplicateContacts($originalHeaders, $originalRows, $checkSummary) { $this->assertTrue($this->isTextPresent('CiviCRM has detected one record which is a duplicate of existing CiviCRM contact record. These records have not been imported.')); } + /** + * @return array + */ function _addCustomData() { $this->openCiviPage("admin/custom/group", "reset=1"); diff --git a/tests/phpunit/WebTest/Import/ContactSubtypeTest.php b/tests/phpunit/WebTest/Import/ContactSubtypeTest.php index 8d67b42572..a74f1f52b3 100644 --- a/tests/phpunit/WebTest/Import/ContactSubtypeTest.php +++ b/tests/phpunit/WebTest/Import/ContactSubtypeTest.php @@ -271,6 +271,9 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { /* * Helper function to create Household Subtype. */ + /** + * @return string + */ function _createHouseholdSubtype() { // Visit to create contact subtype @@ -288,6 +291,9 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Individuals Subtype. */ + /** + * @return array + */ function _individualSubtypeCSVData() { $headers = array( 'first_name' => 'First Name', @@ -333,6 +339,9 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Organizations Subtype. */ + /** + * @return array + */ function _organizationSubtypeCSVData() { $headers = array( 'organization_name' => 'Organization Name', @@ -372,6 +381,9 @@ class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Household Subtype. */ + /** + * @return array + */ function _householdSubtypeCSVData() { $headers = array( 'household_name' => 'Household Name', diff --git a/tests/phpunit/WebTest/Import/ContactTest.php b/tests/phpunit/WebTest/Import/ContactTest.php index 9db6dcf3f6..9a036c44b3 100644 --- a/tests/phpunit/WebTest/Import/ContactTest.php +++ b/tests/phpunit/WebTest/Import/ContactTest.php @@ -283,6 +283,9 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Individuals. */ + /** + * @return array + */ function _individualCSVData() { $headers = array( 'first_name' => 'First Name', @@ -328,6 +331,9 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Organizations. */ + /** + * @return array + */ function _organizationCSVData() { $headers = array( 'organization_name' => 'Organization Name', @@ -367,6 +373,9 @@ class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Household. */ + /** + * @return array + */ function _householdCSVData() { $headers = array( 'household_name' => 'Household Name', diff --git a/tests/phpunit/WebTest/Import/ContributionTest.php b/tests/phpunit/WebTest/Import/ContributionTest.php index bffc4b06b5..253806bf38 100644 --- a/tests/phpunit/WebTest/Import/ContributionTest.php +++ b/tests/phpunit/WebTest/Import/ContributionTest.php @@ -75,6 +75,9 @@ class WebTest_Import_ContributionTest extends ImportCiviSeleniumTestCase { $this->importCSVComponent('Contribution', $headers, $rows, 'Household', 'Insert new contributions', $fieldMapper); } + /** + * @return array + */ function _contributionIndividualCSVData() { $firstName1 = substr(sha1(rand()), 0, 7); $email1 = 'mail_' . substr(sha1(rand()), 0, 7) . '@example.com'; @@ -112,6 +115,9 @@ class WebTest_Import_ContributionTest extends ImportCiviSeleniumTestCase { return array($headers, $rows); } + /** + * @return array + */ function _contributionHouseholdCSVData() { $household1 = substr(sha1(rand()), 0, 7) . ' home'; $this->webtestAddHousehold($household1, TRUE); @@ -147,6 +153,9 @@ class WebTest_Import_ContributionTest extends ImportCiviSeleniumTestCase { return array($headers, $rows); } + /** + * @return array + */ function _contributionOrganizationCSVData() { $organization1 = substr(sha1(rand()), 0, 7) . ' org'; $this->webtestAddOrganization($organization1, TRUE); diff --git a/tests/phpunit/WebTest/Import/CustomDataTest.php b/tests/phpunit/WebTest/Import/CustomDataTest.php index 680b1192db..3b311b39ed 100644 --- a/tests/phpunit/WebTest/Import/CustomDataTest.php +++ b/tests/phpunit/WebTest/Import/CustomDataTest.php @@ -101,6 +101,15 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for custom data import. */ + /** + * @param $customGroupTitle + * @param $firstName1 + * @param $firstName2 + * @param $id1 + * @param $id2 + * + * @return array + */ function _individualCustomCSVData($customGroupTitle, $firstName1, $firstName2, $id1, $id2) { list($customDataParams, $customDataVerify) = $this->_addCustomData($customGroupTitle, $id1, $id2); @@ -136,6 +145,13 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase { return array($headers, $rows, $customDataVerify); } + /** + * @param $customGroupTitle + * @param $id1 + * @param $id2 + * + * @return array + */ function _addCustomData($customGroupTitle, $id1, $id2) { $this->openCiviPage("admin/custom/group", "reset=1"); diff --git a/tests/phpunit/WebTest/Import/DateFormatTest.php b/tests/phpunit/WebTest/Import/DateFormatTest.php index ea5cdb5278..a0ff63ec2c 100644 --- a/tests/phpunit/WebTest/Import/DateFormatTest.php +++ b/tests/phpunit/WebTest/Import/DateFormatTest.php @@ -149,6 +149,9 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Individuals and yyyy-mm-dd OR yyyymmdd dateformat. */ + /** + * @return array + */ function _individualCSVData_yyyy_mm_dd() { $headers = array( 'first_name' => 'First Name', @@ -197,6 +200,9 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Individuals and mm/dd/yy OR mm-dd-yy dateformat. */ + /** + * @return array + */ function _individualCSVData_mm_dd_yy() { $headers = array( 'first_name' => 'First Name', @@ -245,6 +251,9 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Individuals and mm/dd/yyyy OR mm-dd-yyyy dateformat. */ + /** + * @return array + */ function _individualCSVData_mm_dd_yyyy() { $headers = array( 'first_name' => 'First Name', @@ -293,6 +302,9 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Individuals and Month dd, yyyy dateformat. */ + /** + * @return array + */ function _individualCSVData_Month_dd_yyyy() { $headers = array( 'first_name' => 'First Name', @@ -341,6 +353,9 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Individuals and dd-mon-yy OR dd/mm/yy dateformat. */ + /** + * @return array + */ function _individualCSVData_dd_mon_yy() { $headers = array( 'first_name' => 'First Name', @@ -389,6 +404,9 @@ class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Individuals and dd/mm/yyyy dateformat. */ + /** + * @return array + */ function _individualCSVData_dd_mm_yyyy() { $headers = array( 'first_name' => 'First Name', diff --git a/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php b/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php index a5c4f6aba9..7b6337bcf5 100644 --- a/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php +++ b/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php @@ -323,6 +323,11 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { $this->importContacts($headers, $rows, 'Household', 'No Duplicate Checking'); } + /** + * @param $originalHeaders + * @param $originalRows + * @param $checkSummary + */ function checkDuplicateContacts($originalHeaders, $originalRows, $checkSummary) { $this->assertTrue($this->isTextPresent('CiviCRM has detected one record which is a duplicate of existing CiviCRM contact record. These records have not been imported.')); @@ -341,6 +346,11 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { * Helper function to provide data for contact import for * Individual Duplicate Matching. */ + /** + * @param $individualFields + * + * @return array + */ function _individualDuplicateMatchingCSVData($individualFields) { $headers = array( 'first_name' => 'First Name', @@ -387,6 +397,11 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { * Helper function to provide data for contact import for * Organizations Duplicate Matching. */ + /** + * @param $organizationFields + * + * @return array + */ function _organizationDuplicateMatchingCSVData($organizationFields) { $headers = array( 'organization_name' => 'Organization Name', @@ -426,6 +441,11 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { * Helper function to provide data for contact import for Household * Duplicate Matching. */ + /** + * @param $householdFields + * + * @return array + */ function _householdDuplicateMatchingCSVData($householdFields) { $headers = array( 'household_name' => 'Household Name', diff --git a/tests/phpunit/WebTest/Import/GroupTest.php b/tests/phpunit/WebTest/Import/GroupTest.php index 2acdade7d3..cd113ce03a 100644 --- a/tests/phpunit/WebTest/Import/GroupTest.php +++ b/tests/phpunit/WebTest/Import/GroupTest.php @@ -92,6 +92,9 @@ class WebTest_Import_GroupTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for Individuals. */ + /** + * @return array + */ function _individualGroupCSVData() { $headers = array( 'first_name' => 'First Name', diff --git a/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php b/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php index 0e2c0e3354..850686ef35 100644 --- a/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php +++ b/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php @@ -46,6 +46,15 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * saveMappingName : to override mapping name * */ + /** + * @param $component + * @param $headers + * @param $rows + * @param string $contactType + * @param string $mode + * @param array $fieldMapper + * @param array $other + */ function importCSVComponent($component, $headers, $rows, @@ -187,6 +196,15 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * @todo:currently only supports csv, need to work on sql import */ + /** + * @param $headers + * @param $rows + * @param string $contactType + * @param string $mode + * @param array $fieldMapper + * @param array $other + * @param string $type + */ function importContacts($headers, $rows, $contactType = 'Individual', $mode = 'Skip', $fieldMapper = array( ), $other = array(), $type = 'csv') { @@ -434,6 +452,11 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * @return string import url */ + /** + * @param $component + * + * @return mixed + */ function _getImportComponentUrl($component) { $importComponentUrl = array( @@ -454,6 +477,12 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * @return string import url */ + /** + * @param $component + * @param $contactType + * + * @return mixed + */ function _getImportComponentContactType($component, $contactType) { $importComponentMode = array( 'Event' => array('Individual' => 'CIVICRM_QFID_1_8', @@ -482,6 +511,13 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * @params array $rows field rows * @params array $checkMapperHeaders override default mapper headers */ + /** + * @param $headers + * @param $rows + * @param null $existingMapping + * @param array $checkMapperHeaders + * @param string $headerSelector + */ function _checkImportMapperData($headers, $rows, $existingMapping = NULL, $checkMapperHeaders = array( ), $headerSelector = 'th') { @@ -525,6 +561,12 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * * @return array $contactIds imported contact ids */ + /** + * @param $rows + * @param string $contactType + * + * @return array + */ function _getImportedContactIds($rows, $contactType = 'Individual') { $contactIds = array(); @@ -569,6 +611,10 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { * @params array $headers data headers * @params string $rows data rows */ + /** + * @param $headers + * @param $rows + */ function _formatContactCSVdata(&$headers, &$rows) { if (!isset($headers['contact_relationships'])) { return; diff --git a/tests/phpunit/WebTest/Import/MatchExternalIdTest.php b/tests/phpunit/WebTest/Import/MatchExternalIdTest.php index 1aa0db57ed..0f26e4fa5c 100644 --- a/tests/phpunit/WebTest/Import/MatchExternalIdTest.php +++ b/tests/phpunit/WebTest/Import/MatchExternalIdTest.php @@ -74,6 +74,9 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contribution import for Individual. */ + /** + * @return array + */ function _contributionIndividualCSVData() { $firstName1 = substr(sha1(rand()), 0, 7); $lastName1 = substr(sha1(rand()), 0, 7); @@ -122,6 +125,9 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for membership import for Individual. */ + /** + * @return array + */ function _memberIndividualCSVData() { $memTypeParams = $this->webtestAddMembershipType(); @@ -169,6 +175,9 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for participant import for Individual. */ + /** + * @return array + */ function _participantIndividualCSVData() { $eventInfo = $this->_addNewEvent(); @@ -229,6 +238,13 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { * * @return int external id */ + /** + * @param $firstName + * @param $lastName + * @param $externalId + * + * @return mixed + */ function _addContact($firstName, $lastName, $externalId) { $this->openCiviPage('contact/add', 'reset=1&ct=Individual'); @@ -256,6 +272,11 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { * * @return array $params event details of newly created event */ + /** + * @param array $params + * + * @return array + */ function _addNewEvent($params = array( )) { if (empty($params)) { diff --git a/tests/phpunit/WebTest/Import/MemberTest.php b/tests/phpunit/WebTest/Import/MemberTest.php index a03a1e56af..54c8754690 100644 --- a/tests/phpunit/WebTest/Import/MemberTest.php +++ b/tests/phpunit/WebTest/Import/MemberTest.php @@ -76,6 +76,9 @@ class WebTest_Import_MemberTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for Membeship import for Individuals. */ + /** + * @return array + */ function _memberIndividualCSVData() { $memTypeParams = $this->webtestAddMembershipType(); @@ -120,6 +123,9 @@ class WebTest_Import_MemberTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for Membeship import for Households. */ + /** + * @return array + */ function _memberHouseholdCSVData() { $memTypeParams = $this->webtestAddMembershipType(); @@ -162,6 +168,9 @@ class WebTest_Import_MemberTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for Membeship import for Organizations. */ + /** + * @return array + */ function _memberOrganizationCSVData() { $memTypeParams = $this->webtestAddMembershipType(); diff --git a/tests/phpunit/WebTest/Import/MultipleRelationshipTest.php b/tests/phpunit/WebTest/Import/MultipleRelationshipTest.php index 86af6e7e46..739479a71b 100644 --- a/tests/phpunit/WebTest/Import/MultipleRelationshipTest.php +++ b/tests/phpunit/WebTest/Import/MultipleRelationshipTest.php @@ -48,6 +48,9 @@ class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase * Helper function to provide data for multiple relationship import * for Individuals. + */ + /** + * @return array */ function _individualRelationshipCSVData() { diff --git a/tests/phpunit/WebTest/Import/ParticipantTest.php b/tests/phpunit/WebTest/Import/ParticipantTest.php index 4037aad2c0..bc715b7366 100644 --- a/tests/phpunit/WebTest/Import/ParticipantTest.php +++ b/tests/phpunit/WebTest/Import/ParticipantTest.php @@ -97,6 +97,9 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for participant import for Individuals. */ + /** + * @return array + */ function _participantIndividualCSVData() { $eventInfo = $this->_addNewEvent(); @@ -142,6 +145,9 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for participant import for Household. */ + /** + * @return array + */ function _participantHouseholdCSVData() { $eventInfo = $this->_addNewEvent(); @@ -185,6 +191,9 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for participant import for Organization. */ + /** + * @return array + */ function _participantOrganizationCSVData() { $eventInfo = $this->_addNewEvent(); @@ -232,6 +241,11 @@ class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase { * * @return array $params event details of newly created event */ + /** + * @param array $params + * + * @return array + */ function _addNewEvent($params = array( )) { diff --git a/tests/phpunit/WebTest/Import/SavedMappingTest.php b/tests/phpunit/WebTest/Import/SavedMappingTest.php index 08713d5253..ab34a08a9d 100644 --- a/tests/phpunit/WebTest/Import/SavedMappingTest.php +++ b/tests/phpunit/WebTest/Import/SavedMappingTest.php @@ -81,6 +81,9 @@ class WebTest_Import_SavedMapping extends ImportCiviSeleniumTestCase { /* * Helper function to provide csv data for Individuals contact import. */ + /** + * @return array + */ function _individualCSVData() { $headers = array( 'individual_prefix' => 'Individual Prefix', diff --git a/tests/phpunit/WebTest/Import/TagTest.php b/tests/phpunit/WebTest/Import/TagTest.php index 2628b08f54..72e431d51f 100644 --- a/tests/phpunit/WebTest/Import/TagTest.php +++ b/tests/phpunit/WebTest/Import/TagTest.php @@ -87,6 +87,9 @@ class WebTest_Import_TagTest extends ImportCiviSeleniumTestCase { /* * Helper function to provide data for contact import for sample. */ + /** + * @return array + */ function _contactTagCSVData() { $headers = array( 'first_name' => 'First Name', diff --git a/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php b/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php index 3c38d5d30c..f3ea2be417 100644 --- a/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php +++ b/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php @@ -31,6 +31,10 @@ class WebTest_Mailing_AddMessageTemplateTest extends CiviSeleniumTestCase { parent::setUp(); } + /** + * @param bool $useTokens + * @param null $msgTitle + */ function testTemplateAdd($useTokens = FALSE, $msgTitle = NULL) { $this->webtestLogin(); diff --git a/tests/phpunit/WebTest/Mailing/MailingTest.php b/tests/phpunit/WebTest/Mailing/MailingTest.php index 65d9a87225..2a33bb6a6b 100644 --- a/tests/phpunit/WebTest/Mailing/MailingTest.php +++ b/tests/phpunit/WebTest/Mailing/MailingTest.php @@ -489,6 +489,10 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { $this->criteriaCheck($criteriaCheck, $mailingReportUrl); } + /** + * @param $criteriaCheck + * @param $mailingReportUrl + */ function criteriaCheck($criteriaCheck, $mailingReportUrl) { foreach($criteriaCheck as $key => $infoFilter) { foreach($infoFilter as $entity => $dataToCheck) { @@ -503,6 +507,11 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { } } + /** + * @param $summaryInfo + * @param $dataToCheck + * @param $entity + */ function _verifyCriteria($summaryInfo, $dataToCheck, $entity) { foreach($dataToCheck as $key => $value) { if ($entity == 'report') { diff --git a/tests/phpunit/WebTest/Mailing/SpoolTest.php b/tests/phpunit/WebTest/Mailing/SpoolTest.php index 046a2090d4..2ff40f1ee0 100644 --- a/tests/phpunit/WebTest/Mailing/SpoolTest.php +++ b/tests/phpunit/WebTest/Mailing/SpoolTest.php @@ -77,6 +77,10 @@ class WebTest_Mailing_SpoolTest extends CiviSeleniumTestCase { $mut->stop(); } + /** + * @param $context + * @param $mailPart + */ public static function mailWalkCallback($context, $mailPart) { if ($mailPart instanceof ezcMailText) { self::assertEquals($mailPart->subType, 'html'); diff --git a/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php b/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php index 92bbe51311..3b5f115030 100644 --- a/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php +++ b/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php @@ -149,6 +149,9 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { $this->webtestVerifyTabularData($verifyData); } + /** + * @param $memTypeParams + */ function _addMembership($memTypeParams) { // click through to the membership view screen $this->click("css=li#tab_member a"); @@ -183,6 +186,10 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { $this->waitForTextPresent($sourceText); } + /** + * @param $profileTitle + * @param $customDataParams + */ function _addProfile($profileTitle, $customDataParams) { $this->openCiviPage("admin/uf/group", "reset=1"); @@ -218,6 +225,9 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field 'Membership Status' has been saved to '{$profileTitle}'."); } + /** + * @return array + */ function _addCustomData() { $customGroupTitle = 'Custom_' . substr(sha1(rand()), 0, 4); diff --git a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php index 5e84b63ac5..2e6adddd7b 100755 --- a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php +++ b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php @@ -119,6 +119,13 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom"); } + /** + * @param $firstName + * @param $lastName + * @param $email + * @param $contactParams + * @param $streetAddress + */ function contactInfoFill($firstName, $lastName, $email, $contactParams, $streetAddress) { //Credit Card Info $this->select("credit_card_type", "value=Visa"); @@ -137,14 +144,28 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase $this->type("billing_postal_code-5", "94129"); } + /** + * @param $priceSetSection + * @param $optionNumber + */ function checkOptions($priceSetSection, $optionNumber) { $this->assertChecked("xpath=//div[@id='priceset']/div[@class='crm-section {$priceSetSection}']/div[2]/div[{$optionNumber}]/span/input"); } + /** + * @param $priceSetSection + * @param $optionNumber + */ function _testDefaultSenarios($priceSetSection, $optionNumber) { $this->click("xpath=//div[@id='priceset']/div[@class='crm-section {$priceSetSection}']/div[2]/div[{$optionNumber}]/span/input"); } + /** + * @param $setTitle + * @param $usedFor + * @param null $contributionType + * @param $setHelp + */ function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) { $this->openCiviPage("admin/price", "reset=1&action=add", '_qf_Set_next-bottom'); @@ -169,6 +190,17 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase $this->assertTrue($this->isTextPresent("Your Set '{$setTitle}' has been added. You can add fields to this set now.")); } + /** + * @param $fields + * @param $validateString + * @param bool $dateSpecificFields + * @param $title + * @param $sid + * @param bool $defaultPriceSet + * @param $contributionType + * + * @return array + */ function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $defaultPriceSet = FALSE, $contributionType) { if ($defaultPriceSet) { diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php index 61ceaf2e9b..f86ba5a71a 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php @@ -163,6 +163,12 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa } + /** + * @param $setTitle + * @param $usedFor + * @param null $contributionType + * @param $setHelp + */ function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) { $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom'); @@ -187,6 +193,16 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa $this->waitForText('crm-notification-container', "Your Set '{$setTitle}' has been added. You can add fields to this set now."); } + /** + * @param $fields + * @param $validateString + * @param bool $dateSpecificFields + * @param $title + * @param $sid + * @param $contributionType + * + * @return array + */ function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $contributionType) { $memTypeParams1 = $this->webtestAddMembershipType(); $memTypeTitle1 = $memTypeParams1['membership_type']; @@ -249,6 +265,10 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa return array($memTypeTitle1, $memTypeTitle2); } + /** + * @param $validateStrings + * @param $sid + */ function _testVerifyPriceSet($validateStrings, $sid) { // verify Price Set at Preview page // start at Manage Price Sets listing @@ -264,6 +284,13 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa $this->assertStringsPresent($validateStrings); } + /** + * @param $sid + * @param $contactParams + * @param $memTypeTitle1 + * @param $memTypeTitle2 + * @param bool $renew + */ function _testSignUpOrRenewMembership($sid, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = FALSE) { //build the membership dates. require_once 'CRM/Core/Config.php'; @@ -342,6 +369,12 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa $this->waitForElementPresent("xpath=//div[@id='memberships']//table/tbody/tr"); } + /** + * @param $sid + * @param $contactParams + * @param $memTypeTitle1 + * @param $term + */ function _testMultilpeTermsMembershipRegistration($sid, $contactParams, $memTypeTitle1, $term){ //build the membership dates. require_once 'CRM/Core/Config.php'; diff --git a/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipGCTest.php b/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipGCTest.php index 84ae09746c..c0995d2f85 100644 --- a/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipGCTest.php +++ b/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipGCTest.php @@ -94,6 +94,9 @@ class WebTest_Member_OnlineAutoRenewMembershipGCTest extends CiviSeleniumTestCas // has changed a bit. No point in adding test for external page as we 'll test with fake transactions. } + /** + * @return null + */ function _configureMembershipPage() { static $pageId = NULL; diff --git a/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipTest.php b/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipTest.php index 74fa8c37b2..7053c23135 100644 --- a/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipTest.php +++ b/tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipTest.php @@ -121,6 +121,9 @@ class WebTest_Member_OnlineAutoRenewMembershipTest extends CiviSeleniumTestCase $this->assertElementContainsText("xpath=//div[@class='crm-group amount_display-group']/div[2]", $text, 'Missing text: ' . $text); } + /** + * @return null + */ function _configureMembershipPage() { static $pageId = NULL; diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php index 7ef3bb385d..5fe65c5fa2 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php @@ -183,6 +183,12 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas } + /** + * @param $setTitle + * @param $usedFor + * @param null $contributionType + * @param $setHelp + */ function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) { $this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom'); @@ -207,6 +213,16 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas $this->waitForText('crm-notification-container', "Your Set '{$setTitle}' has been added. You can add fields to this set now."); } + /** + * @param $fields + * @param $validateString + * @param bool $dateSpecificFields + * @param $title + * @param $sid + * @param $contributionType + * + * @return array + */ function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $contributionType) { $memTypeParams1 = $this->webtestAddMembershipType(); $memTypeTitle1 = $memTypeParams1['membership_type']; @@ -267,6 +283,10 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas return array($memTypeTitle1, $memTypeTitle2); } + /** + * @param $validateStrings + * @param $sid + */ function _testVerifyPriceSet($validateStrings, $sid) { // verify Price Set at Preview page // start at Manage Price Sets listing @@ -279,6 +299,13 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas $this->assertStringsPresent($validateStrings); } + /** + * @param $pageId + * @param $contactParams + * @param $memTypeTitle1 + * @param $memTypeTitle2 + * @param bool $renew + */ function _testSignUpOrRenewMembership($pageId, $contactParams, $memTypeTitle1, $memTypeTitle2, $renew = FALSE) { $this->webtestLogout(); @@ -382,6 +409,13 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas } } + /** + * @param $pageId + * @param $contactParams + * @param $memTypeTitle1 + * @param $term + * @param bool $renew + */ function _testMultilpeTermsMembershipRegistration($pageId, $contactParams, $memTypeTitle1, $term, $renew = FALSE){ if($renew){ $this->openCiviPage('member/search', 'reset=1', 'member_end_date_high'); diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php index 5bac3f1e26..6b980dce1d 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php @@ -177,6 +177,15 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase { $this->assertElementContainsText('search-status', '2 Results', 'Missing text: ' . '2 Results'); } + /** + * @param $pageId + * @param $memTypeId + * @param $firstName + * @param $lastName + * @param $payLater + * @param $hash + * @param bool $otherAmount + */ function _testOnlineMembershipSignup($pageId, $memTypeId, $firstName, $lastName, $payLater, $hash, $otherAmount = FALSE) { //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom"); diff --git a/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php b/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php index 4c087ca21c..98e126be64 100644 --- a/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php +++ b/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php @@ -138,6 +138,11 @@ class WebTest_Member_SeperateMembershipPaymentTest extends CiviSeleniumTestCase $this->waitForElementPresent("xpath=//form[@id='MembershipView']/div[2]/div/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); } + /** + * @param $pageId + * @param $memTypeId + * @param null $cid + */ function _testOnlineMembershipSignup($pageId, $memTypeId, $cid = NULL) { //Open Live Contribution Page $args = array('reset' => 1, 'id' => $pageId); diff --git a/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php b/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php index dc96ea4722..04c2d8b96e 100644 --- a/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php +++ b/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php @@ -80,6 +80,9 @@ class WebTest_Member_UpdateMembershipScriptTest extends CiviSeleniumTestCase { ); } + /** + * @return array + */ function addMembershipType() { $membershipTitle = substr(sha1(rand()), 0, 7); $membershipOrg = $membershipTitle . ' memorg'; diff --git a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php index 921003719f..4a1c86f618 100644 --- a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php +++ b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php @@ -572,6 +572,11 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); } + /** + * @param $profileTitle + * @param $customDataArr + * @param $profileFor + */ function _addProfile($profileTitle, $customDataArr, $profileFor) { $this->openCiviPage('admin/uf/group', 'reset=1'); @@ -599,6 +604,11 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { } } + /** + * @param $profileFor + * + * @return array + */ function _addCustomData($profileFor) { $returnArray = array(); $customGroupTitle = 'Custom_' . substr(sha1(rand()), 0, 4); diff --git a/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php b/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php index ec3a64975e..1fbc77b10d 100644 --- a/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php +++ b/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php @@ -60,6 +60,13 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { $this->_deleteProfile($id, $profileTitle); } + /** + * @param bool $checkMultiRecord + * @param bool $checkSearchable + * @param bool $userCheck + * + * @return array + */ function _addNewProfile($checkMultiRecord = TRUE, $checkSearchable = FALSE, $userCheck = FALSE) { $params = $this->_testCustomAdd($checkSearchable); @@ -287,6 +294,10 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { return array($gid, $profileTitle); } + /** + * @param $gid + * @param $profileTitle + */ function _deleteProfile($gid, $profileTitle) { $this->webtestLogin(); $this->openCiviPage("admin/uf/group", "action=delete&id={$gid}", '_qf_Group_next-bottom'); @@ -295,6 +306,11 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { $this->assertElementContainsText('crm-container', "Your CiviCRM Profile '{$profileTitle}' has been deleted."); } + /** + * @param $checkSearchable + * + * @return mixed + */ function _testCustomAdd($checkSearchable) { $this->openCiviPage('admin/custom/group', 'action=add&reset=1'); @@ -360,6 +376,12 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { return $params; } + /** + * @param string $context + * @param string $parentElement + * + * @return mixed + */ function _addRecords($context = 'Edit', $parentElement = '//') { $params['text'] = 'text' . substr(sha1(rand()), 0, 3); $this->waitForElementPresent("//div[@id='crm-profile-block']/div/div[2]/input[@class='crm-form-text required']"); diff --git a/tests/phpunit/WebTest/Profile/ProfileAddTest.php b/tests/phpunit/WebTest/Profile/ProfileAddTest.php index 9bca83c79a..616c182ea6 100644 --- a/tests/phpunit/WebTest/Profile/ProfileAddTest.php +++ b/tests/phpunit/WebTest/Profile/ProfileAddTest.php @@ -226,6 +226,9 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase { $this->_testdeleteProfile($profileTitle); } + /** + * @param $profileTitle + */ function _testdeleteProfile($profileTitle) { //$this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[4]/a[text()='Delete']"); @@ -248,11 +251,11 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase { // open Add Profile page $this->openCiviPage("admin/uf/group/add", "action=add&reset=1"); - + $this->waitForElementPresent('_qf_Group_next-bottom'); $profileTitle = 'Test Profile' . substr(sha1(rand()), 0, 7); $this->type('title', $profileTitle); - + // check if description field is present $this->waitForElementPresent('description'); @@ -265,7 +268,7 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase { // Wait for "saved" status msg $this->waitForText('crm-notification-container', 'Profile Added'); - + $this->waitForElementPresent('_qf_Field_next-bottom'); // select field(s) to be added in profile @@ -298,7 +301,7 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase { // Wait for "saved" status msg $this->waitForText('crm-notification-container', 'Profile Saved'); - + $this->clickLink("xpath=//div[@id='breadcrumb']/div//a[text()='Profiles']"); $this->waitForElementPresent("xpath=//div[@class='crm-submit-buttons']/a[@id='newCiviCRMProfile-bottom']"); $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody/tr[@id='UFGroup-$id']/td[2]/a"); @@ -317,7 +320,7 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase { // Is contact present? $this->assertTrue($this->isTextPresent("$createdBy"), "Contact did not find!"); - + $this->openCiviPage('admin/uf/group', 'reset=1'); // delete created profile $this->_testdeleteProfile($profileTitle); diff --git a/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php b/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php index 048c91348c..2f8f69b3ba 100644 --- a/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php +++ b/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php @@ -126,6 +126,9 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase $this->_testdeleteProfile($profileTitle); } + /** + * @param $profileTitle + */ function _testdeleteProfile($profileTitle) { $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[4]/a[text()='Delete']"); $this->click("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[4]/a[text()='Delete']"); diff --git a/tests/phpunit/WebTest/Release/InstallScript.php b/tests/phpunit/WebTest/Release/InstallScript.php index 2d52e315d1..1a50123ec8 100644 --- a/tests/phpunit/WebTest/Release/InstallScript.php +++ b/tests/phpunit/WebTest/Release/InstallScript.php @@ -30,6 +30,9 @@ require_once 'ReleaseTestCase.php'; // webtest is not picked up by the suite, since it needs to run // on specially prepare sandbox // more details: http://wiki.civicrm.org/confluence/display/CRMDOC/Release+testing+script +/** + * Class WebTest_Release_InstallScript + */ class WebTest_Release_InstallScript extends WebTest_Release_ReleaseTestCase { protected function setUp() { diff --git a/tests/phpunit/WebTest/Release/ReleaseTestCase.php b/tests/phpunit/WebTest/Release/ReleaseTestCase.php index 3d83d5c5d6..0838411465 100644 --- a/tests/phpunit/WebTest/Release/ReleaseTestCase.php +++ b/tests/phpunit/WebTest/Release/ReleaseTestCase.php @@ -30,6 +30,9 @@ require_once 'CiviTest/CiviSeleniumTestCase.php'; // webtest is not picked up by the suite, since it needs to run // on specially prepare sandbox // more details: http://wiki.civicrm.org/confluence/display/CRMDOC/Release+testing+script +/** + * Class WebTest_Release_ReleaseTestCase + */ class WebTest_Release_ReleaseTestCase extends CiviSeleniumTestCase { /** diff --git a/tests/phpunit/WebTest/Release/UpgradeScript.php b/tests/phpunit/WebTest/Release/UpgradeScript.php index 50d4c5cabc..ac6496d99b 100644 --- a/tests/phpunit/WebTest/Release/UpgradeScript.php +++ b/tests/phpunit/WebTest/Release/UpgradeScript.php @@ -30,6 +30,9 @@ require_once 'ReleaseTestCase.php'; // webtest is not picked up by the suite, since it needs to run // on specially prepare sandbox // more details: http://wiki.civicrm.org/confluence/display/CRMDOC/Release+testing+script +/** + * Class WebTest_Release_UpgradeScript + */ class WebTest_Release_UpgradeScript extends WebTest_Release_ReleaseTestCase { protected function setUp() { diff --git a/tests/phpunit/WebTest/Report/LoggingReportTest.php b/tests/phpunit/WebTest/Report/LoggingReportTest.php index 56828c4fec..49f28ec3f5 100644 --- a/tests/phpunit/WebTest/Report/LoggingReportTest.php +++ b/tests/phpunit/WebTest/Report/LoggingReportTest.php @@ -265,6 +265,9 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { $this->waitForTextPresent("Changes Saved"); } + /** + * @param $data + */ function verifyReportData($data) { foreach ($data as $value) { // check for the row contains proper data @@ -279,6 +282,10 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { } } + /** + * @param $dataForReportDetail + * @param array $filters + */ function detailReportCheck($dataForReportDetail, $filters = array()) { foreach ($dataForReportDetail as $value) { $this->waitForElementPresent("xpath=//table/tbody//tr/td[2][contains(text(), '{$value['log_type']}')]/../td[4]/a[contains(text(), '{$value['altered_contact']}')]/../../td[1]/a[2]"); diff --git a/tests/phpunit/WebTest/Report/RolePermissionReportTest.php b/tests/phpunit/WebTest/Report/RolePermissionReportTest.php index 904cc8ed2e..a1c423a7e6 100644 --- a/tests/phpunit/WebTest/Report/RolePermissionReportTest.php +++ b/tests/phpunit/WebTest/Report/RolePermissionReportTest.php @@ -200,6 +200,9 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase { $this->_roleDelete($role); } + /** + * @param $role + */ function _roleDelete($role) { $this->waitForElementPresent("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']"); $this->click("xpath=//table[@id='user-roles']/tbody//tr/td[text()='{$role}']/..//td/a[text()='edit role']"); @@ -210,6 +213,11 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase { $this->waitForTextPresent("The role has been deleted."); } + /** + * @param $roleid + * + * @return string + */ function _testCreateUser($roleid) { $this->open($this->sboxPath . "admin/people/create"); diff --git a/tests/phpunit/WebTest/Utils/RestTest.php b/tests/phpunit/WebTest/Utils/RestTest.php index 4f19741bee..9b7fda6e5d 100644 --- a/tests/phpunit/WebTest/Utils/RestTest.php +++ b/tests/phpunit/WebTest/Utils/RestTest.php @@ -35,6 +35,11 @@ class WebTest_Utils_RestTest extends CiviSeleniumTestCase { protected $session_id; protected $nocms_contact_id; + /** + * @param $apiResult + * @param $cmpvar + * @param string $prefix + */ protected function assertAPIErrorCode($apiResult, $cmpvar, $prefix = '') { if (!empty($prefix)) { $prefix .= ': '; diff --git a/tests/phpunit/api/v3/APIStandardsTest.php b/tests/phpunit/api/v3/APIStandardsTest.php index 15fd69ecdb..822658ebd3 100644 --- a/tests/phpunit/api/v3/APIStandardsTest.php +++ b/tests/phpunit/api/v3/APIStandardsTest.php @@ -124,6 +124,9 @@ class api_v3_APIStandardsTest extends CiviUnitTestCase { * Get all the files in the API directory for the relevant version which contain API functions * @return array $files array of php files in the directory excluding helper files */ + /** + * @return array + */ function getAllFilesinAPIDir() { $files = array(); $handle = opendir($this->_apiDir); @@ -146,6 +149,9 @@ class api_v3_APIStandardsTest extends CiviUnitTestCase { * Require once Files * @files array list of files to load */ + /** + * @param $files + */ function requireOnceFilesArray($files) { foreach ($files as $key => $file) { require_once $this->_apiDir . $file; @@ -156,6 +162,9 @@ class api_v3_APIStandardsTest extends CiviUnitTestCase { * Get all api exposed functions that are expected to conform to standards * @return array $functionlist */ + /** + * @return array + */ function getAllAPIStdFunctions() { $functionlist = get_defined_functions(); $functions = preg_grep($this->_regexForGettingAPIStdFunctions, $functionlist['user']); diff --git a/tests/phpunit/api/v3/APIWrapperTest.php b/tests/phpunit/api/v3/APIWrapperTest.php index 60cf8cd7e2..6df7694048 100644 --- a/tests/phpunit/api/v3/APIWrapperTest.php +++ b/tests/phpunit/api/v3/APIWrapperTest.php @@ -61,6 +61,10 @@ class api_v3_APIWrapperTest extends CiviUnitTestCase { parent::tearDown(); } + /** + * @param $apiWrappers + * @param $apiRequest + */ function onApiWrappers(&$apiWrappers, $apiRequest) { $this->assertTrue(is_string($apiRequest['entity']) && !empty($apiRequest['entity'])); $this->assertTrue(is_string($apiRequest['action']) && !empty($apiRequest['action'])); @@ -84,6 +88,9 @@ class api_v3_APIWrapperTest extends CiviUnitTestCase { } } +/** + * Class api_v3_APIWrapperTest_Impl + */ class api_v3_APIWrapperTest_Impl implements API_Wrapper { /** * {@inheritDoc} diff --git a/tests/phpunit/api/v3/ActivityTypeTest.php b/tests/phpunit/api/v3/ActivityTypeTest.php index 59d1d9054b..1bdc9a4dbd 100644 --- a/tests/phpunit/api/v3/ActivityTypeTest.php +++ b/tests/phpunit/api/v3/ActivityTypeTest.php @@ -37,6 +37,9 @@ class api_v3_ActivityTypeTest extends CiviUnitTestCase { protected $_apiversion; + /** + * @return array + */ function get_info() { return array( 'name' => 'Activity Type', diff --git a/tests/phpunit/api/v3/AddressTest.php b/tests/phpunit/api/v3/AddressTest.php index 4b50007d5e..e64c633afa 100644 --- a/tests/phpunit/api/v3/AddressTest.php +++ b/tests/phpunit/api/v3/AddressTest.php @@ -33,6 +33,10 @@ */ require_once 'CiviTest/CiviUnitTestCase.php'; + +/** + * Class api_v3_AddressTest + */ class api_v3_AddressTest extends CiviUnitTestCase { protected $_apiversion =3; protected $_contactID; diff --git a/tests/phpunit/api/v3/CRM11793Test.php b/tests/phpunit/api/v3/CRM11793Test.php index 6dadeb887c..fa997b2711 100644 --- a/tests/phpunit/api/v3/CRM11793Test.php +++ b/tests/phpunit/api/v3/CRM11793Test.php @@ -59,6 +59,9 @@ class api_v3_CRM11793Test extends CiviUnitTestCase { $this->_testCRM11793ContactType('Individual'); } + /** + * @param $contactType + */ function _testCRM11793ContactType($contactType) { $result = $this->callAPISuccess( 'contact', @@ -72,4 +75,4 @@ class api_v3_CRM11793Test extends CiviUnitTestCase { $this->assertEquals($contact['contact_type'], $contactType, "In line " . __LINE__); } } -} \ No newline at end of file +} diff --git a/tests/phpunit/api/v3/ContactTypeTest.php b/tests/phpunit/api/v3/ContactTypeTest.php index 441f3bab34..44f4357153 100644 --- a/tests/phpunit/api/v3/ContactTypeTest.php +++ b/tests/phpunit/api/v3/ContactTypeTest.php @@ -30,6 +30,10 @@ require_once 'CiviTest/CiviUnitTestCase.php'; + +/** + * Class api_v3_ContactTypeTest + */ class api_v3_ContactTypeTest extends CiviUnitTestCase { protected $_apiversion; diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index b32f500f63..cdc8830fb1 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -1393,7 +1393,11 @@ class api_v3_ContributionTest extends CiviUnitTestCase { return $contribution['id']; } - function _getFinancialTrxnAmount($contId) { + /** + * @param $contId + * + * @return null|string + */function _getFinancialTrxnAmount($contId) { $query = "SELECT SUM( ft.total_amount ) AS total FROM civicrm_financial_trxn AS ft @@ -1405,7 +1409,11 @@ class api_v3_ContributionTest extends CiviUnitTestCase { return $result; } - function _getFinancialItemAmount($contId) { + /** + * @param $contId + * + * @return null|string + */function _getFinancialItemAmount($contId) { $lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution')); $query = "SELECT SUM(amount) @@ -1416,7 +1424,11 @@ class api_v3_ContributionTest extends CiviUnitTestCase { return $result; } - function _checkFinancialItem($contId, $context) { + /** + * @param $contId + * @param $context + */ + function _checkFinancialItem($contId, $context) { if ($context != 'paylater') { $params = array ( 'entity_id' => $contId, @@ -1480,7 +1492,12 @@ class api_v3_ContributionTest extends CiviUnitTestCase { } } - function _checkFinancialTrxn($contribution, $context, $instrumentId = NULL) { + /** + * @param $contribution + * @param $context + * @param null $instrumentId + */ + function _checkFinancialTrxn($contribution, $context, $instrumentId = NULL) { $trxnParams = array( 'entity_id' => $contribution['id'], 'entity_table' => 'civicrm_contribution', @@ -1547,7 +1564,10 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $this->assertDBCompareValues('CRM_Financial_DAO_FinancialTrxn', $params, $compareParams); } - function _addPaymentInstrument () { + /** + * @return mixed + */ + function _addPaymentInstrument () { $gId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'payment_instrument', 'id', 'name'); $optionParams = array( 'option_group_id' => $gId, @@ -1570,7 +1590,11 @@ class api_v3_ContributionTest extends CiviUnitTestCase { return $optionValue['values'][$optionValue['id']]['value']; } - function _checkFinancialRecords($params,$context) { + /** + * @param $params + * @param $context + */ + function _checkFinancialRecords($params,$context) { $entityParams = array( 'entity_id' => $params['id'], 'entity_table' => 'civicrm_contribution', diff --git a/tests/phpunit/api/v3/CustomFieldTest.php b/tests/phpunit/api/v3/CustomFieldTest.php index 6b2e6ddfec..ef86546086 100644 --- a/tests/phpunit/api/v3/CustomFieldTest.php +++ b/tests/phpunit/api/v3/CustomFieldTest.php @@ -39,6 +39,9 @@ require_once 'tests/phpunit/CiviTest/CiviUnitTestCase.php'; class api_v3_CustomFieldTest extends CiviUnitTestCase { protected $_apiversion; + /** + * @return array + */ function get_info() { return array( 'name' => 'Custom Field Create', @@ -158,12 +161,22 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { /* * Can't figure out the point of this? */ + /** + * @param $params + */ function _loopingCustomFieldCreateTest($params) { $customField = $this->callAPISuccess('custom_field', 'create', $params); $this->assertNotNull($customField['id']); $this->getAndCheck($params, $customField['id'], 'CustomField'); } + /** + * @param $gid + * @param $htype + * @param $dtype + * + * @return array + */ function _buildParams($gid, $htype, $dtype) { $params = $this->_buildBasicParams($gid, $htype, $dtype); /* //Not Working for any type. Maybe redundant with testCustomFieldCreateWithOptionValues() @@ -181,6 +194,13 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { return $params; } + /** + * @param $gid + * @param $htype + * @param $dtype + * + * @return array + */ function _buildBasicParams($gid, $htype, $dtype) { return array( 'custom_group_id' => $gid, @@ -445,6 +465,11 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { } } + /** + * @param $getFieldsResult + * + * @return array + */ function getCustomFieldKeys($getFieldsResult) { $isCustom = function($key) { return preg_match('/^custom_/', $key); diff --git a/tests/phpunit/api/v3/CustomGroupTest.php b/tests/phpunit/api/v3/CustomGroupTest.php index b138b0d4aa..ae0d5d7eff 100644 --- a/tests/phpunit/api/v3/CustomGroupTest.php +++ b/tests/phpunit/api/v3/CustomGroupTest.php @@ -42,6 +42,9 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { public $DBResetRequired = TRUE; + /** + * @return array + */ function get_info() { return array( 'name' => 'Custom Group Create', diff --git a/tests/phpunit/api/v3/CustomValueContactTypeTest.php b/tests/phpunit/api/v3/CustomValueContactTypeTest.php index d7a7af644f..a773cab9ed 100644 --- a/tests/phpunit/api/v3/CustomValueContactTypeTest.php +++ b/tests/phpunit/api/v3/CustomValueContactTypeTest.php @@ -41,6 +41,9 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { protected $individualStudent; + /** + * @return array + */ function get_info() { return array( 'name' => 'Custom Data For Contact Subtype', diff --git a/tests/phpunit/api/v3/DashboardTest.php b/tests/phpunit/api/v3/DashboardTest.php index aa0a55bc29..39bf9e62e0 100644 --- a/tests/phpunit/api/v3/DashboardTest.php +++ b/tests/phpunit/api/v3/DashboardTest.php @@ -78,6 +78,10 @@ class api_v3_DashboardTest extends CiviUnitTestCase { $this->DashboardDelete($dashboard['id'], $oldCount); } + /** + * @param $id + * @param $oldCount + */ function DashboardDelete($id, $oldCount) { $params = array( 'version' => 3, diff --git a/tests/phpunit/api/v3/EntityTagTest.php b/tests/phpunit/api/v3/EntityTagTest.php index a15d3a18db..21e1a5f61b 100644 --- a/tests/phpunit/api/v3/EntityTagTest.php +++ b/tests/phpunit/api/v3/EntityTagTest.php @@ -36,6 +36,10 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ require_once 'CiviTest/CiviUnitTestCase.php'; + +/** + * Class api_v3_EntityTagTest + */ class api_v3_EntityTagTest extends CiviUnitTestCase { protected $_individualID; diff --git a/tests/phpunit/api/v3/EventTest.php b/tests/phpunit/api/v3/EventTest.php index e110df881b..6f8191577a 100644 --- a/tests/phpunit/api/v3/EventTest.php +++ b/tests/phpunit/api/v3/EventTest.php @@ -33,6 +33,9 @@ class api_v3_EventTest extends CiviUnitTestCase { protected $_apiversion; protected $_entity; + /** + * @return array + */ function get_info() { return array( 'name' => 'Event Create', diff --git a/tests/phpunit/api/v3/GroupContactTest.php b/tests/phpunit/api/v3/GroupContactTest.php index 7bcca93ced..28427ad8c5 100644 --- a/tests/phpunit/api/v3/GroupContactTest.php +++ b/tests/phpunit/api/v3/GroupContactTest.php @@ -35,6 +35,9 @@ class api_v3_GroupContactTest extends CiviUnitTestCase { protected $_apiversion = 3; protected $_groupId1; + /** + * @return array + */ function get_info() { return array( 'name' => 'Group Contact Create', diff --git a/tests/phpunit/api/v3/GroupOrganizationTest.php b/tests/phpunit/api/v3/GroupOrganizationTest.php index 5f61b20ad6..c64e31da11 100644 --- a/tests/phpunit/api/v3/GroupOrganizationTest.php +++ b/tests/phpunit/api/v3/GroupOrganizationTest.php @@ -36,6 +36,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; class api_v3_GroupOrganizationTest extends CiviUnitTestCase { protected $_apiversion; + /** + * @return array + */ function get_info() { return array( 'name' => 'Group Organization', diff --git a/tests/phpunit/api/v3/GroupTest.php b/tests/phpunit/api/v3/GroupTest.php index 9458953150..6def8b7ff9 100644 --- a/tests/phpunit/api/v3/GroupTest.php +++ b/tests/phpunit/api/v3/GroupTest.php @@ -37,6 +37,9 @@ class api_v3_GroupTest extends CiviUnitTestCase { protected $_apiversion; protected $_groupID; + /** + * @return array + */ function get_info() { return array( 'name' => 'Group Get', diff --git a/tests/phpunit/api/v3/JobTest.php b/tests/phpunit/api/v3/JobTest.php index 5b8dda4609..4fe5db3b66 100644 --- a/tests/phpunit/api/v3/JobTest.php +++ b/tests/phpunit/api/v3/JobTest.php @@ -36,6 +36,10 @@ * */ require_once 'CiviTest/CiviUnitTestCase.php'; + +/** + * Class api_v3_JobTest + */ class api_v3_JobTest extends CiviUnitTestCase { protected $_apiversion = 3; @@ -279,6 +283,12 @@ class api_v3_JobTest extends CiviUnitTestCase { $this->contactDelete($orgID); } + /** + * @param $op + * @param $objectName + * @param $id + * @param $params + */ function hookPreRelationship($op, $objectName, $id, &$params ) { if($op == 'delete') { return; diff --git a/tests/phpunit/api/v3/MailingContactTest.php b/tests/phpunit/api/v3/MailingContactTest.php index 0ad3b9f57c..292995e074 100644 --- a/tests/phpunit/api/v3/MailingContactTest.php +++ b/tests/phpunit/api/v3/MailingContactTest.php @@ -36,10 +36,14 @@ * */ require_once 'CiviTest/CiviUnitTestCase.php'; + +/** + * Class api_v3_MailingContactTest + */ class api_v3_MailingContactTest extends CiviUnitTestCase { protected $_apiversion = 3; protected $_entity = 'mailing'; - + function setUp() { parent::setUp(); $params = array( diff --git a/tests/phpunit/api/v3/MailingGroupTest.php b/tests/phpunit/api/v3/MailingGroupTest.php index cf6f664770..c4d881d8e5 100644 --- a/tests/phpunit/api/v3/MailingGroupTest.php +++ b/tests/phpunit/api/v3/MailingGroupTest.php @@ -38,6 +38,9 @@ class api_v3_MailingGroupTest extends CiviUnitTestCase { protected $_apiversion; + /** + * @return array + */ function get_info() { return array( 'name' => 'Mailer Group', diff --git a/tests/phpunit/api/v3/MailingTest.php b/tests/phpunit/api/v3/MailingTest.php index c09069d629..a9fdf028a2 100644 --- a/tests/phpunit/api/v3/MailingTest.php +++ b/tests/phpunit/api/v3/MailingTest.php @@ -39,6 +39,9 @@ class api_v3_MailingTest extends CiviUnitTestCase { protected $_entity = 'Mailing'; + /** + * @return array + */ function get_info() { return array( 'name' => 'Mailer', diff --git a/tests/phpunit/api/v3/MembershipStatusTest.php b/tests/phpunit/api/v3/MembershipStatusTest.php index 2724f869e5..a6ad472de0 100644 --- a/tests/phpunit/api/v3/MembershipStatusTest.php +++ b/tests/phpunit/api/v3/MembershipStatusTest.php @@ -35,6 +35,9 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { protected $_apiversion =3; + /** + * @return array + */ function get_info() { return array( 'name' => 'MembershipStatus Calc', diff --git a/tests/phpunit/api/v3/MembershipTest.php b/tests/phpunit/api/v3/MembershipTest.php index 7c97b9bed9..b79df091b4 100644 --- a/tests/phpunit/api/v3/MembershipTest.php +++ b/tests/phpunit/api/v3/MembershipTest.php @@ -35,6 +35,9 @@ require_once 'CiviTest/CiviUnitTestCase.php'; +/** + * Class api_v3_MembershipTest + */ class api_v3_MembershipTest extends CiviUnitTestCase { protected $_apiversion; protected $_contactID; diff --git a/tests/phpunit/api/v3/MembershipTypeTest.php b/tests/phpunit/api/v3/MembershipTypeTest.php index 4985db24f1..17c5a06c99 100644 --- a/tests/phpunit/api/v3/MembershipTypeTest.php +++ b/tests/phpunit/api/v3/MembershipTypeTest.php @@ -34,6 +34,9 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { protected $_entity = 'MembershipType'; + /** + * @return array + */ function get_info() { return array( 'name' => 'MembershipType Create', diff --git a/tests/phpunit/api/v3/NoteTest.php b/tests/phpunit/api/v3/NoteTest.php index 493337cdba..76eb1bb1f4 100644 --- a/tests/phpunit/api/v3/NoteTest.php +++ b/tests/phpunit/api/v3/NoteTest.php @@ -40,10 +40,16 @@ class api_v3_NoteTest extends CiviUnitTestCase { protected $_note; + /** + * + */ function __construct() { parent::__construct(); } + /** + * @return array + */ function get_info() { return array( 'name' => 'Note Create', diff --git a/tests/phpunit/api/v3/ParticipantPaymentTest.php b/tests/phpunit/api/v3/ParticipantPaymentTest.php index 30994059a2..21ee98b342 100644 --- a/tests/phpunit/api/v3/ParticipantPaymentTest.php +++ b/tests/phpunit/api/v3/ParticipantPaymentTest.php @@ -46,6 +46,9 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { protected $_contributionTypeId; + /** + * @return array + */ function get_info() { return array( 'name' => 'Participant Create', @@ -342,6 +345,10 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { $this->assertEquals($result['values'][$result['id']]['contribution_id'], $contributionID, 'Check Contribution Id'); } + /** + * @param $params + * @param $context + */ function _checkFinancialRecords($params, $context) { $entityParams = array( 'entity_id' => $params['id'], diff --git a/tests/phpunit/api/v3/ParticipantTest.php b/tests/phpunit/api/v3/ParticipantTest.php index 5a2cf37e46..96a1f62635 100644 --- a/tests/phpunit/api/v3/ParticipantTest.php +++ b/tests/phpunit/api/v3/ParticipantTest.php @@ -34,6 +34,10 @@ require_once 'CiviTest/CiviUnitTestCase.php'; */ require_once 'CRM/Utils/DeprecatedUtils.php'; require_once 'CiviTest/CiviUnitTestCase.php'; + +/** + * Class api_v3_ParticipantTest + */ class api_v3_ParticipantTest extends CiviUnitTestCase { protected $_apiversion; @@ -46,6 +50,9 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { protected $_individualId; protected $_params; + /** + * @return array + */ function get_info() { return array( 'name' => 'Participant Create', diff --git a/tests/phpunit/api/v3/PaymentProcessorTest.php b/tests/phpunit/api/v3/PaymentProcessorTest.php index bdd1daf87c..b676090252 100644 --- a/tests/phpunit/api/v3/PaymentProcessorTest.php +++ b/tests/phpunit/api/v3/PaymentProcessorTest.php @@ -36,6 +36,9 @@ class api_v3_PaymentProcessorTest extends CiviUnitTestCase { protected $_apiversion = 3; protected $_params; + /** + * @return array + */ function get_info() { return array( 'name' => 'PaymentProcessor Create', diff --git a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php index 327a99d5db..9c564ff4e9 100644 --- a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php +++ b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php @@ -35,6 +35,9 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { protected $_ppTypeID; protected $_apiversion; + /** + * @return array + */ function get_info() { return array( 'name' => 'PaymentProcessorType Create', diff --git a/tests/phpunit/api/v3/ProductTest.php b/tests/phpunit/api/v3/ProductTest.php index 0aca3aa959..a1c9dcc417 100644 --- a/tests/phpunit/api/v3/ProductTest.php +++ b/tests/phpunit/api/v3/ProductTest.php @@ -32,6 +32,10 @@ class api_v3_ProductTest extends CiviUnitTestCase { protected $_params; protected $_entity = 'Product'; + + /** + * @return array + */ function get_info() { return array( 'name' => 'Product Tests', diff --git a/tests/phpunit/api/v3/ProfileTest.php b/tests/phpunit/api/v3/ProfileTest.php index 4fed1fdb00..1a1e6ecb18 100644 --- a/tests/phpunit/api/v3/ProfileTest.php +++ b/tests/phpunit/api/v3/ProfileTest.php @@ -41,6 +41,10 @@ class api_v3_ProfileTest extends CiviUnitTestCase { protected $_profileID = 0; protected $_membershipTypeID; protected $_contactID; + + /** + * @return array + */ function get_info() { return array( 'name' => 'Profile Test', @@ -700,6 +704,11 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /* * Helper function to create an Individual with address/email/phone info. Import UF Group and UF Fields */ + /** + * @param array $params + * + * @return mixed + */ function _createIndividualContact($params = array()) { $contactParams = array_merge(array( 'first_name' => 'abc1', @@ -742,6 +751,9 @@ class api_v3_ProfileTest extends CiviUnitTestCase { return $profileData; } + /** + * @return array + */ function _createContactWithActivity() { // @TODO: Create profile with custom fields $op = new PHPUnit_Extensions_Database_Operation_Insert(); @@ -889,6 +901,9 @@ class api_v3_ProfileTest extends CiviUnitTestCase { $this->_profileID = $profile['id']; } + /** + * @param $profileID + */ function _addCustomFieldToProfile($profileID) { $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, ''); $this->uFFieldCreate(array('uf_group_id' => $profileID, 'field_name' => 'custom_' . $ids['custom_field_id'], 'contact_type' => 'Contact')); diff --git a/tests/phpunit/api/v3/RelationshipTest.php b/tests/phpunit/api/v3/RelationshipTest.php index f72a7aec99..a2c54549b4 100644 --- a/tests/phpunit/api/v3/RelationshipTest.php +++ b/tests/phpunit/api/v3/RelationshipTest.php @@ -48,6 +48,10 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { protected $_params; protected $_entity; + + /** + * @return array + */ function get_info() { return array( 'name' => 'Relationship Create', @@ -400,6 +404,9 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { $this->customGroupDelete($ids['custom_group_id']); } + /** + * @return mixed + */ function createCustomGroup() { $params = array( 'title' => 'Custom Group', @@ -414,6 +421,9 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { return $customGroup['id']; } + /** + * @return array + */ function createCustomField() { $ids = array(); $params = array( diff --git a/tests/phpunit/api/v3/RelationshipTypeTest.php b/tests/phpunit/api/v3/RelationshipTypeTest.php index db54200b3a..48dbb97131 100644 --- a/tests/phpunit/api/v3/RelationshipTypeTest.php +++ b/tests/phpunit/api/v3/RelationshipTypeTest.php @@ -64,6 +64,9 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { protected $_relTypeID; protected $_apiversion = 3; + /** + * @return array + */ function get_info() { return array( 'name' => 'RelationshipType Create', diff --git a/tests/phpunit/api/v3/SettingTest.php b/tests/phpunit/api/v3/SettingTest.php index 16860f56db..61d1405c4f 100644 --- a/tests/phpunit/api/v3/SettingTest.php +++ b/tests/phpunit/api/v3/SettingTest.php @@ -48,11 +48,17 @@ class api_v3_SettingTest extends CiviUnitTestCase { protected $_domainID2; protected $_domainID3; + /** + * + */ function __construct() { parent::__construct(); } + /** + * @return array + */ function get_info() { return array( 'name' => 'Settings Tests', diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 0f33d48d39..69c946a4b8 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -74,6 +74,11 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { } } + /** + * @param null $skip + * + * @return array + */ public static function entities($skip = NULL) { // To only test specific entities, call phpunit with SYNTAX_CONFORMANCE_ENTITIES="TheEntityName" // or uncomment this line: @@ -99,31 +104,52 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { return $entities; } + /** + * @return array + */ public static function entities_get() { // all the entities, beside the ones flagged return static::entities(static::toBeSkipped_get(TRUE)); } + /** + * @return array + */ public static function entities_create() { return static::entities(static::toBeSkipped_create(TRUE)); } + /** + * @return array + */ public static function entities_updatesingle() { return static::entities(static::toBeSkipped_updatesingle(TRUE)); } + /** + * @return array + */ public static function entities_getlimit() { return static::entities(static::toBeSkipped_getlimit()); } + /** + * @return array + */ public static function entities_delete() { return static::entities(static::toBeSkipped_delete(TRUE)); } + /** + * @return array + */ public static function custom_data_entities_get() { return static::custom_data_entities(); } + /** + * @return array + */ public static function custom_data_entities() { $entities = CRM_Core_BAO_CustomQuery::$extendsMap; $customDataEntities = array(); @@ -138,6 +164,11 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { return $customDataEntities; } + /** + * @param bool $sequential + * + * @return array + */ public static function toBeSkipped_get($sequential = FALSE) { $entitiesWithoutGet = array('MailingEventSubscribe', 'MailingEventConfirm', 'MailingEventResubscribe', 'MailingEventUnsubscribe', 'MailingGroup', 'Location'); if ($sequential === TRUE) { @@ -163,6 +194,11 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { return array('MailingContact'); } + /** + * @param bool $sequential + * + * @return array + */ public static function toBeSkipped_create($sequential = FALSE) { $entitiesWithoutCreate = array('MailingGroup', 'Constant', 'Entity', 'Location', 'Profile', 'MailingRecipients'); if ($sequential === TRUE) { @@ -175,6 +211,11 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { return $entities; } + /** + * @param bool $sequential + * + * @return array + */ public static function toBeSkipped_delete($sequential = FALSE) { $entitiesWithout = array('MailingContact', 'MailingEventConfirm', 'MailingEventResubscribe', 'MailingEventSubscribe', 'MailingEventUnsubscribe', 'MailingGroup', 'MailingRecipients', 'Constant', 'Entity', 'Location', 'Domain', 'Profile', 'CustomValue', 'Setting'); if ($sequential === TRUE) { -- 2.25.1