/**
* 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 CRM_Core_Form $paymentForm reference to the form object if available
- * @param boolean $force should we force a reload of this payment object
+ * @param string $mode
+ * The mode of operation: live or test.
+ * @param array $paymentProcessor
+ * The details of the payment processor being invoked.
+ * @param CRM_Core_Form $paymentForm
+ * Reference to the form object if available.
+ * @param bool $force
+ * Should we force a reload of this payment object.
*
* @return object
* @static
* 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
+ * @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
/**
* Prepare a set of search fields
*
- * @param CRM_Core_Form $form modifiable
+ * @param CRM_Core_Form $form
+ * Modifiable.
* @return void
*/
function buildForm(&$form) {
/**
* Modify the content of each row
*
- * @param array $row modifiable SQL result row
+ * @param array $row
+ * Modifiable SQL result row.
* @return void
*/
function alterRow(&$row) {
* Create a contact and perform a series of steps with it; after each
* step, ensure that the contact's modified_date has increased.
*
- * @param $callbacks array ($name => $callable)
+ * @param $callbacks
+ * Array ($name => $callable).
*/
public function _testTimestamps($callbacks) {
CRM_Core_DAO::triggerRebuild();
/**
* Assert that the cache for a group contains exactly the listed contacts
*
- * @param $expectedContactIds array(int)
- * @param $groupId int
+ * @param $expectedContactIds
+ * Array(int).
+ * @param $groupId
+ * Int.
*/
public function assertCacheMatches($expectedContactIds, $groupId) {
$sql = 'SELECT contact_id FROM civicrm_group_contact_cache WHERE group_id = %1';
}
/**
- * @param $objects array DAO or BAO objects
+ * @param $objects
+ * Array DAO or BAO objects.
*/
public function registerTestObjects($objects) {
//if (is_object($objects)) {
}
/**
- * @param $objects array DAO or BAO objects
+ * @param $objects
+ * Array DAO or BAO objects.
*/
public function registerTestObjects($objects) {
//if (is_object($objects)) {
} // */
/**
- * @param array $fields list of fields to include in the profile
+ * @param array $fields
+ * List of fields to include in the profile.
* @return int field id
*/
protected function createUFGroup($fields) {
* Store the NACK and retry after the default time period (DEFAULT_RETRY).
*
* @dataProvider badWebResponses
- * @param array $badWebResponse Description of a web request that returns some kind of failure
+ * @param array $badWebResponse
+ * Description of a web request that returns some kind of failure.
*/
public function testGetDocument_NewFailure_CacheOK_UpdateOK($badWebResponse) {
$this->assertNotEmpty($badWebResponse);
* A new update succeeds.
*
* @dataProvider badWebResponses
- * @param array $badWebResponse Description of a web request that returns some kind of failure
+ * @param array $badWebResponse
+ * Description of a web request that returns some kind of failure.
*/
public function testGetDocument_NewOK_UpdateFailure_CacheOK_UpdateOK($badWebResponse) {
$this->assertNotEmpty($badWebResponse);
* Note: Expected URL is htmlized because that's what CRM_Utils_System::url()
* and CRM_Utils_System::redirect() work with.
*
- * @param string $requestPath eg "civicrm/requested/path"
- * @param string $requestArgs eg "foo=bar&whiz=bang"
- * @param string $pageArgs eg "url=civicrm/foo/bar?whiz=bang"
- * @param string $expectedUrl eg "/index.php?q=civicrm/foo/bar&whiz=bang"
+ * @param string $requestPath
+ * Eg "civicrm/requested/path".
+ * @param string $requestArgs
+ * Eg "foo=bar&whiz=bang".
+ * @param string $pageArgs
+ * Eg "url=civicrm/foo/bar?whiz=bang".
+ * @param string $expectedUrl
+ * Eg "/index.php?q=civicrm/foo/bar&whiz=bang".
* @dataProvider examples
*/
public function testCreateUrl($requestPath, $requestArgs, $pageArgs, $expectedUrl) {
/**
* @dataProvider translateData
- * @param string $input the name of a permission which should be translated
- * @param string $expected the name of an actual permission (based on translation matrix for "runtime")
+ * @param string $input
+ * The name of a permission which should be translated.
+ * @param string $expected
+ * The name of an actual permission (based on translation matrix for "runtime").
*/
public function testTranslate($input, $expected) {
$perm = new CRM_Core_Permission_Base();
/**
* @dataProvider translateData
- * @param string $input the name of a permission which should be translated
- * @param string $expected the name of an actual permission (based on translation matrix for "runtime")
+ * @param string $input
+ * The name of a permission which should be translated.
+ * @param string $expected
+ * The name of an actual permission (based on translation matrix for "runtime").
*/
public function testTranslate($input, $expected) {
$perm = new CRM_Core_Permission_Joomla();
}
/**
- * @param string $createStyle 'sql-insert'|'bao-create'
- * @param string $commitStyle 'implicit-commit'|'explicit-commit'
+ * @param string $createStyle
+ * 'sql-insert'|'bao-create'.
+ * @param string $commitStyle
+ * 'implicit-commit'|'explicit-commit'.
* @dataProvider dataCreateAndCommitStyles
*/
public function testBasicCommit($createStyle, $commitStyle) {
* Test in which an outer function makes multiple calls to inner functions
* but then rolls back the entire set.
*
- * @param string $createStyle 'sql-insert'|'bao-create'
- * @param string $commitStyle 'implicit-commit'|'explicit-commit'
+ * @param string $createStyle
+ * 'sql-insert'|'bao-create'.
+ * @param string $commitStyle
+ * 'implicit-commit'|'explicit-commit'.
* @dataProvider dataCreateAndCommitStyles
*/
public function testBatchRollback($createStyle, $commitStyle) {
* createContactWithTransaction use nesting (savepoints), so the
* batch is able to commit.
*
- * @param string $createStyle 'sql-insert'|'bao-create'
- * @param string $commitStyle 'implicit-commit'|'explicit-commit'
+ * @param string $createStyle
+ * 'sql-insert'|'bao-create'.
+ * @param string $commitStyle
+ * 'implicit-commit'|'explicit-commit'.
* @dataProvider dataCreateAndCommitStyles
*/
public function testMixedBatchCommit_nesting($createStyle, $commitStyle) {
* createContactWithTransaction reuses the main transaction,
* so the overall batch must rollback.
*
- * @param string $createStyle 'sql-insert'|'bao-create'
- * @param string $commitStyle 'implicit-commit'|'explicit-commit'
+ * @param string $createStyle
+ * 'sql-insert'|'bao-create'.
+ * @param string $commitStyle
+ * 'implicit-commit'|'explicit-commit'.
* @dataProvider dataCreateAndCommitStyles
*/
public function testMixedBatchCommit_reuse($createStyle, $commitStyle) {
* createContactWithTransaction using a mix of rollback/commit.
* The overall batch is rolled back.
*
- * @param string $createStyle 'sql-insert'|'bao-create'
- * @param string $commitStyle 'implicit-commit'|'explicit-commit'
+ * @param string $createStyle
+ * 'sql-insert'|'bao-create'.
+ * @param string $commitStyle
+ * 'implicit-commit'|'explicit-commit'.
* @dataProvider dataCreateAndCommitStyles
*/
public function testMixedBatchRollback_nesting($createStyle, $commitStyle) {
}
/**
- * @param string $createStyle 'sql-insert'|'bao-create'
- * @param string $commitStyle 'implicit-commit'|'explicit-commit'
+ * @param string $createStyle
+ * 'sql-insert'|'bao-create'.
+ * @param string $commitStyle
+ * 'implicit-commit'|'explicit-commit'.
* @dataProvider dataCreateAndCommitStyles
*/
public function testRun_ok($createStyle, $commitStyle) {
}
/**
- * @param string $createStyle 'sql-insert'|'bao-create'
- * @param string $commitStyle 'implicit-commit'|'explicit-commit'
+ * @param string $createStyle
+ * 'sql-insert'|'bao-create'.
+ * @param string $commitStyle
+ * 'implicit-commit'|'explicit-commit'.
* @dataProvider dataCreateAndCommitStyles
*/
public function testRun_exception($createStyle, $commitStyle) {
}
/**
- * @param array $existsByOffset array(int $cidOffset => bool $expectExists)
+ * @param array $existsByOffset
+ * Array(int $cidOffset => bool $expectExists).
* @param int $generalOffset
*/
public function assertContactsExistByOffset($existsByOffset, $generalOffset = 0) {
* Use SQL to INSERT a contact and assert success. Perform
* work within a transaction.
*
- * @param string $nesting 'reuse-tx'|'nest-tx' how to construct transaction
- * @param string $insert 'sql-insert'|'bao-create' how to add the example record
- * @param string $outcome 'rollback'|'implicit-commit'|'explicit-commit' how to finish transaction
+ * @param string $nesting
+ * 'reuse-tx'|'nest-tx' how to construct transaction.
+ * @param string $insert
+ * 'sql-insert'|'bao-create' how to add the example record.
+ * @param string $outcome
+ * 'rollback'|'implicit-commit'|'explicit-commit' how to finish transaction.
* @return int cid
*/
public function createContactWithTransaction($nesting, $insert, $outcome) {
/**
* Perform a series of operations within smaller transactions
*
- * @param string $nesting 'reuse-tx'|'nest-tx' how to construct transaction
- * @param array $callbacks see createContactWithTransaction
- * @param array $existsByOffset see assertContactsMix
- * @param string $outcome 'rollback'|'implicit-commit'|'explicit-commit' how to finish transaction
+ * @param string $nesting
+ * 'reuse-tx'|'nest-tx' how to construct transaction.
+ * @param array $callbacks
+ * See createContactWithTransaction.
+ * @param array $existsByOffset
+ * See assertContactsMix.
+ * @param string $outcome
+ * 'rollback'|'implicit-commit'|'explicit-commit' how to finish transaction.
* @return int cid
*/
public function runBatch($nesting, $callbacks, $existsByOffset, $outcome) {
/**
* @param $module
- * @param array $counts expected hook invocation counts ($hookName => $count)
+ * @param array $counts
+ * Expected hook invocation counts ($hookName => $count).
*/
public function assertHookCounts($module, $counts) {
global $_test_extension_manager_moduletest_counts;
* Implements ACLGroup hook
* aclGroup function returns a list of permitted groups
* @param string $type
- * @param integer $contactID
+ * @param int $contactID
* @param string $tableName
* @param array $allGroups
* @param array $currentGroups
* If there's one pre-existing record, then update it.
*
* @dataProvider apiOptionNames
- * @param string $apiOptionName e.g. "match" or "match-mandatory"
+ * @param string $apiOptionName
+ * E.g. "match" or "match-mandatory".
*/
public function testCreateMatch_one($apiOptionName) {
// create basic record
* If there's more than one pre-existing record, throw an error.
*
* @dataProvider apiOptionNames
- * @param string $apiOptionName e.g. "match" or "match-mandatory"
+ * @param string $apiOptionName
+ * E.g. "match" or "match-mandatory".
*/
public function testCreateMatch_many($apiOptionName) {
// create the first Lebowski
/**
* @param $input
- * @param $expected bool
+ * @param $expected
+ * Bool.
* @dataProvider booleanDataProvider
*/
public function testStrToBool($input, $expected) {
* Add listeners to $this->dispatcher which record each invocation of $monitoredEvents
* in $this->actualEventSequence.
*
- * @param array $monitoredEvents list of event names
+ * @param array $monitoredEvents
+ * List of event names.
*
* @internal param \Symfony\Component\EventDispatcher\EventDispatcher $this ->dispatcher
*/
/**
* Helper function to delete a PayPal Pro
* payment processor
- * @param int $id - id of the PayPal Pro payment processor
+ * @param int $id
+ * Id of the PayPal Pro payment processor.
* to be deleted
* @return boolean true if payment processor deleted, false otherwise
*
* Constructor
*
* @param CiviSeleniumTestCase|CiviUnitTestCase $unit_test The currently running test
- * @param bool $startImmediately Start writing to db now or wait until start() is called
+ * @param bool $startImmediately
+ * Start writing to db now or wait until start() is called.
*/
public function __construct(&$unit_test, $startImmediately = TRUE) {
$this->_ut = $unit_test;
}
/**
- * @param string $type 'raw'|'ezc'
+ * @param string $type
+ * 'raw'|'ezc'.
*
* @throws Exception
* @return array(ezcMail)|array(string)
/**
* Check contents of mail log
*
- * @param array $strings strings that should be included
- * @param array $absentStrings strings that should not be included
+ * @param array $strings
+ * Strings that should be included.
+ * @param array $absentStrings
+ * Strings that should not be included.
* @param string $prefix
*
* @return \ezcMail|string
/**
* Assert that $expectedRecipients (and no else) have received emails
*
- * @param array $expectedRecipients array($msgPos => array($recipPos => $emailAddr))
+ * @param array $expectedRecipients
+ * Array($msgPos => array($recipPos => $emailAddr)).
*/
public function assertRecipients($expectedRecipients) {
$recipients = array();
}
/**
- * @param string $msg email header and body
+ * @param string $msg
+ * Email header and body.
* @return ezcMail
*/
private function convertToEzc($msg) {
}
/**
- * @param array $expectedCsvArray two-dimensional array representing a CSV table
- * @param array $actualCsvArray two-dimensional array representing a CSV table
+ * @param array $expectedCsvArray
+ * Two-dimensional array representing a CSV table.
+ * @param array $actualCsvArray
+ * Two-dimensional array representing a CSV table.
*/
public function assertCsvArraysEqual($expectedCsvArray, $actualCsvArray) {
// TODO provide better debug output
* ReflectionClass of the Test class and checks the constructor
* of that class to decide how to set up the test.
*
- * @param string $name
- * @param array $data
- * @param string $dataName
+ * @param string $name
+ * @param array $data
+ * @param string $dataName
* @param array $browser
*/
public function __construct($name = NULL, array$data = array(), $dataName = '', array$browser = array()) {
}
/**
- * @param array $cookies each item is an array with keys:
+ * @param array $cookies
+ * Each item is an array with keys:.
* - name: string
* - value: string; note that RFC's don't define particular encoding scheme, so
* you must pick one yourself and pre-encode; does not allow values with
/**
* Open an internal path beginning with 'civicrm/'
*
- * @param $url (str) omit the 'civicrm/' it will be added for you
- * @param $args (str|array) optional url arguments
- * @param $waitFor - page element to wait for - using this is recommended to ensure the document is fully loaded
+ * @param $url
+ * (str) omit the 'civicrm/' it will be added for you.
+ * @param $args
+ * (str|array) optional url arguments.
+ * @param $waitFor
+ * Page element to wait for - using this is recommended to ensure the document is fully loaded.
*
* Although it doesn't seem to do much now, using this function is recommended for
* opening all civi pages, and using the $args param is also strongly encouraged
* Add a contact with the given first and last names and either a given email
* (when specified), a random email (when true) or no email (when unspecified or null).
*
- * @param string $fname contact’s first name
- * @param string $lname contact’s last name
- * @param mixed $email contact’s email (when string) or random email (when true) or no email (when null)
+ * @param string $fname
+ * Contact’s first name.
+ * @param string $lname
+ * Contact’s last name.
+ * @param mixed $email
+ * Contact’s email (when string) or random email (when true) or no email (when null).
*
* @param null $contactSubtype
*
/**
* Verify that given label/value pairs are in *sibling* td cells somewhere on the page.
*
- * @param array $expected Array of key/value pairs (like Status/Registered) to be checked
- * @param string $xpathPrefix Pass in an xpath locator to "get to" the desired table or tables. Will be prefixed to xpath
+ * @param array $expected
+ * Array of key/value pairs (like Status/Registered) to be checked.
+ * @param string $xpathPrefix
+ * Pass in an xpath locator to "get to" the desired table or tables. Will be prefixed to xpath.
* table path. Include leading forward slashes (e.g. "//div[@id='activity-content']").
- * @param string $tableId Pass in the id attribute of a table to be verified if you want to only check a specific table
+ * @param string $tableId
+ * Pass in the id attribute of a table to be verified if you want to only check a specific table.
* on the web page.
*/
public function webtestVerifyTabularData($expected, $xpathPrefix = NULL, $tableId = NULL) {
/**
* Types text into a ckEditor rich text field in a form
*
- * @param string $fieldName form field name (as assigned by PHP buildForm class)
- * @param string $text text to type into the field
- * @param string $editor which text editor (valid values are 'CKEditor', 'TinyMCE')
+ * @param string $fieldName
+ * Form field name (as assigned by PHP buildForm class).
+ * @param string $text
+ * Text to type into the field.
+ * @param string $editor
+ * Which text editor (valid values are 'CKEditor', 'TinyMCE').
*
* @return void
*/
* (for price set fields of type select, radio, or checkbox)
* TODO: extend for custom field multiple choice table input
*
- * @param array $options form field name (as assigned by PHP buildForm class)
- * @param array $validateStrings appends label and name strings to this array so they can be validated later
+ * @param array $options
+ * Form field name (as assigned by PHP buildForm class).
+ * @param array $validateStrings
+ * Appends label and name strings to this array so they can be validated later.
*
* @return void
*/
/**
* Use a contact EntityRef field to add a new contact
- * @param string $field selector
+ * @param string $field
+ * Selector.
* @param string $contactType
* @return array of contact attributes (id, names, email)
*/
* Define a payment processor for use by a webtest. Default is to create Dummy processor
* which is useful for testing online public forms (online contribution pages and event registration)
*
- * @param string $processorName Name assigned to new processor
- * @param string $processorType Name for processor type (e.g. PayPal, Dummy, etc.)
- * @param array $processorSettings Array of fieldname => value for required settings for the processor
+ * @param string $processorName
+ * Name assigned to new processor.
+ * @param string $processorType
+ * Name for processor type (e.g. PayPal, Dummy, etc.).
+ * @param array $processorSettings
+ * Array of fieldname => value for required settings for the processor.
*
* @param string $financialAccount
* @throws PHPUnit_Framework_AssertionFailedError
/**
* Create new relationship type w/ user specified params or default.
*
- * @param $params array of required params.
+ * @param $params
+ * Array of required params.
*
* @return an array of saved params values.
*/
* Update default strict rule.
*
* @param string $contactType
- * @param array $fields Fields to be set for strict rule
- * @param int $threshold Rule's threshold value
+ * @param array $fields
+ * Fields to be set for strict rule.
+ * @param int $threshold
+ * Rule's threshold value.
*/
public function webtestStrictDedupeRuleDefault($contactType = 'Individual', $fields = array(), $threshold = 10) {
// set default strict rule.
* checks custom fields rendering / loading properly on the fly WRT entity passed as parameter
*
*
- * @param array $customSets custom sets i.e entity wise sets want to be created and checked
+ * @param array $customSets
+ * Custom sets i.e entity wise sets want to be created and checked.
e.g $customSets = array(array('entity' => 'Contribution', 'subEntity' => 'Donation',
'triggerElement' => $triggerElement))
array $triggerElement: the element which is responsible for custom group to load
which uses the entity info as its selection value
- * @param array $pageUrl the url which on which the ajax custom group load takes place
+ * @param array $pageUrl
+ * The url which on which the ajax custom group load takes place.
* @param callable|boolean $beforeTriggering fn to execute before actual element triggering
* @return void
*/
* ReflectionClass of the Test class and checks the constructor
* of that class to decide how to set up the test.
*
- * @param string $name
- * @param array $data
- * @param string $dataName
+ * @param string $name
+ * @param array $data
+ * @param string $dataName
*/
public function __construct($name = NULL, array$data = array(), $dataName = '') {
parent::__construct($name, $data, $dataName);
/**
* Check that api returned 'is_error' => 0
* else provide full message
- * @param array $apiResult api result
- * @param string $prefix extra test to add to message
+ * @param array $apiResult
+ * Api result.
+ * @param string $prefix
+ * Extra test to add to message.
*/
public function assertAPISuccess($apiResult, $prefix = '') {
if (!empty($prefix)) {
* Check that api returned 'is_error' => 1
* else provide full message
*
- * @param array $apiResult api result
- * @param string $prefix extra test to add to message
+ * @param array $apiResult
+ * Api result.
+ * @param string $prefix
+ * Extra test to add to message.
* @param null $expectedError
*/
public function assertAPIFailure($apiResult, $prefix = '', $expectedError = NULL) {
* @param array $result
* @param $expected
* @param array $valuesToExclude
- * @param string $prefix extra test to add to message
+ * @param string $prefix
+ * Extra test to add to message.
*/
public function assertAPIArrayComparison($result, $expected, $valuesToExclude = array(), $prefix = '') {
$valuesToExclude = array_merge($valuesToExclude, array('debug', 'xdebug', 'sequential'));
* @param string $entity
* @param string $action
* @param array $params
- * @param mixed $checkAgainst optional value to check result against, implemented for getvalue,
+ * @param mixed $checkAgainst
+ * Optional value to check result against, implemented for getvalue,.
* getcount, getsingle. Note that for getvalue the type is checked rather than the value
* for getsingle the array is compared against an array passed in - the id is not compared (for
* better or worse )
*
* @param string $entity
* @param array $params
- * @param string $type - per http://php.net/manual/en/function.gettype.php possible types
+ * @param string $type
+ * Per http://php.net/manual/en/function.gettype.php possible types.
* - boolean
* - integer
* - double
*
* @param string $entity
* @param array $params
- * @param array $checkAgainst - array to compare result against
+ * @param array $checkAgainst
+ * Array to compare result against.
* - boolean
* - integer
* - double
* @param string $entity
* @param string $action
* @param array $params
- * @param string $function - pass this in to create a generated example
- * @param string $file - pass this in to create a generated example
+ * @param string $function
+ * Pass this in to create a generated example.
+ * @param string $file
+ * Pass this in to create a generated example.
* @param string $description
* @param string|null $subfile
* @param string|null $actionName
* @param string $entity
* @param string $action
* @param array $params
- * @param string $expectedErrorMessage error
+ * @param string $expectedErrorMessage
+ * Error.
* @param null $extraOutput
* @return array|int
*/
/**
* Generic function to create Organisation, to be used in test cases
*
- * @param array parameters for civicrm_contact_add api function call
- * @param int sequence number if creating multiple organizations
+ * @param array parameters for civicrm_contact_add api function call
+ * @param int sequence number if creating multiple organizations
*
* @return int id of Organisation created
*/
/**
* Generic function to create Individual, to be used in test cases
*
- * @param array parameters for civicrm_contact_add api function call
- * @param int sequence number if creating multiple individuals
+ * @param array parameters for civicrm_contact_add api function call
+ * @param int sequence number if creating multiple individuals
*
* @return int id of Individual created
*/
/**
* Generic function to create Household, to be used in test cases
*
- * @param array parameters for civicrm_contact_add api function call
- * @param int sequence number if creating multiple households
+ * @param array parameters for civicrm_contact_add api function call
+ * @param int sequence number if creating multiple households
*
* @return int id of Household created
*/
/**
* Helper function for getting sample contact properties
*
- * @param enum contact type: Individual, Organization
- * @param int sequence number for the values of this type
+ * @param enum contact type: Individual, Organization
+ * @param int sequence number for the values of this type
*
* @return array properties of sample contact (ie. $params for API call)
*/
/**
* Private helper function for calling civicrm_contact_add
*
- * @param array $params for civicrm_contact_add api function call
+ * @param array $params
+ * For civicrm_contact_add api function call.
*
* @throws Exception
*
/**
* Create Participant
*
- * @param array $params array of contact id and event id values
+ * @param array $params
+ * Array of contact id and event id values.
*
* @return int $id of participant created
*/
/**
* Delete Tag
*
- * @param int $tagId id of the tag to be deleted
+ * @param int $tagId
+ * Id of the tag to be deleted.
*/
public function tagDelete($tagId) {
require_once 'api/api.php';
/**
* Add entity(s) to the tag
*
- * @param array $params
+ * @param array $params
*
* @return bool
*/
/**
* Create contribution
*
- * @param int $cID contact_id
+ * @param int $cID
+ * Contact_id.
*
* @return int id of created contribution
*/
/**
* Create contribution
*
- * @param int $cID contact_id
- * @param int $cTypeID id of financial type
+ * @param int $cID
+ * Contact_id.
+ * @param int $cTypeID
+ * Id of financial type.
*
* @param int $invoiceID
* @param int $trxnID
* Create online contribution
*
* @param array $params
- * @param int $financialType id of financial type
+ * @param int $financialType
+ * Id of financial type.
*
* @param int $invoiceID
* @param int $trxnID
/**
* Create an Event
*
- * @param array $params name-value pair for an event
+ * @param array $params
+ * Name-value pair for an event.
*
* @return array $event
*/
/**
* Delete event
*
- * @param int $id ID of the event
+ * @param int $id
+ * ID of the event.
*
* @return array|int
*/
/**
* Delete Locations of contact
*
- * @param array $params parameters
+ * @param array $params
+ * Parameters.
*/
public function locationDelete($params) {
$this->callAPISuccess('Location', 'delete', $params);
/**
* Create an activity type
*
- * @param array $params parameters
+ * @param array $params
+ * Parameters.
*/
public function activityTypeCreate($params) {
$result = $this->callAPISuccess('ActivityType', 'create', $params);
/**
* Delete activity type
*
- * @param int $activityTypeId id of the activity type
+ * @param int $activityTypeId
+ * Id of the activity type.
*/
public function activityTypeDelete($activityTypeId) {
$params['activity_type_id'] = $activityTypeId;
* Create a custom group with a single text custom field. See
* participant:testCreateWithCustom for how to use this
*
- * @param string $function __FUNCTION__
- * @param $filename string $file __FILE__
+ * @param string $function
+ * __FUNCTION__.
+ * @param $filename
+ * String $file __FILE__.
*
* @return array $ids ids of created objects
*/
/**
* Create custom field
*
- * @param array $params (custom_group_id) is required
+ * @param array $params
+ * (custom_group_id) is required.
* @return array|int
*/
public function customFieldCreate($params) {
* To turn this off (e.g. on the server) set
* define(DONT_DOCUMENT_TEST_CONFIG ,1);
* in your settings file
- * @param array $params array as passed to civicrm_api function
- * @param array $result array as received from the civicrm_api function
- * @param string $function calling function - generally __FUNCTION__
- * @param string $filename called from file - generally __FILE__
- * @param string $description descriptive text for the example file
- * @param string $subfile name for subfile - if this is completed the example will be put in a subfolder (named by the entity)
- * @param string $action - optional action - otherwise taken from function name
+ * @param array $params
+ * Array as passed to civicrm_api function.
+ * @param array $result
+ * Array as received from the civicrm_api function.
+ * @param string $function
+ * Calling function - generally __FUNCTION__.
+ * @param string $filename
+ * Called from file - generally __FILE__.
+ * @param string $description
+ * Descriptive text for the example file.
+ * @param string $subfile
+ * Name for subfile - if this is completed the example will be put in a subfolder (named by the entity).
+ * @param string $action
+ * Optional action - otherwise taken from function name.
*/
public function documentMe($params, $result, $function, $filename, $description = "", $subfile = NULL, $action = NULL) {
if (defined('DONT_DOCUMENT_TEST_CONFIG') && DONT_DOCUMENT_TEST_CONFIG) {
* Create custom field with Option Values
*
* @param array $customGroup
- * @param string $name name of custom field
+ * @param string $name
+ * Name of custom field.
*
* @return array|int
*/
/*
* Function does a 'Get' on the entity & compares the fields in the Params with those returned
* Default behaviour is to also delete the entity
- * @param array $params params array to check agains
- * @param int $id id of the entity concerned
- * @param string $entity name of entity concerned (e.g. membership)
- * @param bool $delete should the entity be deleted as part of this check
- * @param string $errorText text to print on error
+ * @param array $params
+ * Params array to check agains.
+ * @param int $id
+ * Id of the entity concerned.
+ * @param string $entity
+ * Name of entity concerned (e.g. membership).
+ * @param bool $delete
+ * Should the entity be deleted as part of this check.
+ * @param string $errorText
+ * Text to print on error.
*
*/
/**
/**
* Get formatted values in the actual and expected result
- * @param array $actual actual calculated values
- * @param array $expected expected values
+ * @param array $actual
+ * Actual calculated values.
+ * @param array $expected
+ * Expected values.
*
*/
public function checkArrayEquals(&$actual, &$expected) {
/**
* Unset the key 'id' from the array
- * @param array $unformattedArray The array from which the 'id' has to be unset
+ * @param array $unformattedArray
+ * The array from which the 'id' has to be unset.
*
*/
public static function unsetId(&$unformattedArray) {
/**
* Helper to enable/disable custom directory support
*
- * @param array $customDirs with members:
+ * @param array $customDirs
+ * With members:.
* 'php_path' Set to TRUE to use the default, FALSE or "" to disable support, or a string path to use another path
* 'template_path' Set to TRUE to use the default, FALSE or "" to disable support, or a string path to use another path
*/
* WISHLIST: Monitor SQL queries in unit-tests and generate an exception
* if TRUNCATE or ALTER is called while using a transaction.
*
- * @param bool $nest whether to use nesting or reference-counting
+ * @param bool $nest
+ * Whether to use nesting or reference-counting.
*/
public function useTransaction($nest = TRUE) {
if (!$this->tx) {
/**
* Helper function to delete a contact
*
- * @param int $contactID id of the contact to delete
+ * @param int $contactID
+ * Id of the contact to delete.
* @return boolean true if contact deleted, false otherwise
*/
public static function delete($contactID) {
/**
* Helper function to delete a Contribution Page
*
- * @param int $contributionPageId - id of the Contribution Page
+ * @param int $contributionPageId
+ * Id of the Contribution Page.
* to be deleted
* @return boolean true if Contribution Page deleted, false otherwise
*/
/**
* Helper function to delete custom field
* @deprecated use function on parent class
- * @param object of Custom Field to delete
+ * @param object of Custom Field to delete
*/
public static function deleteField($params) {
require_once 'CRM/Core/BAO/CustomField.php';
/**
* Helper function to delete custom group
* @deprecated use function on parent class
- * @param object Custom Group to delete
+ * @param object Custom Group to delete
* @return boolean true if Group deleted, false otherwise
*/
public static function deleteGroup($params) {
/**
* Helper function to create a PCP Block for Contribution Page
*
- * @param int $contributionPageId - id of the Contribution Page
+ * @param int $contributionPageId
+ * Id of the Contribution Page.
* to be deleted
* @return array of created pcp block
*
/**
* Helper function to delete a PCP related stuff viz. Profile, PCP Block Entry
*
- * @param array key value pair
+ * @param array key value pair
* pcpBlockId - id of the PCP Block Id, profileID - id of Supporter Profile
* to be deleted
* @return boolean true if success, false otherwise
/**
* Helper function to delete a PayPal Pro
* payment processor
- * @param int $id - id of the PayPal Pro payment processor
+ * @param int $id
+ * Id of the PayPal Pro payment processor.
* to be deleted
* @return boolean true if payment processor deleted, false otherwise
*/
/**
* Click on an inline-edit block and wait for it to open
*
- * @param $block string selector
+ * @param $block
+ * String selector.
* @param bool $wait
*/
private function openInlineForm($block, $wait = TRUE) {
/**
* Enter values in an inline edit block and save
*
- * @param $block string selector
- * @param $params array
+ * @param $block
+ * String selector.
+ * @param $params
+ * Array.
* @param \str|string $valid str: submit behavior
* 'error' if we are expecting a form validation error,
* 're_open' (default) after saving, opens the form and validate inputs
/**
* Download CSV file.
*
- * @param string $selector element selector(download button in most of the cases).
- * @param string $fileName file name to be download.
- * @param string $downloadDir download dir.
+ * @param string $selector
+ * Element selector(download button in most of the cases).
+ * @param string $fileName
+ * File name to be download.
+ * @param string $downloadDir
+ * Download dir.
*
* @return string downloaded file path.
*/
/**
* Read CSV file and fire provided assertions.
*
- * @param string $file file path of CSV file.
- * @param array $checkColumns check first row of csv
+ * @param string $file
+ * File path of CSV file.
+ * @param array $checkColumns
+ * Check first row of csv.
* independent of index.
- * @param array $checkRows array of header and rows according to row index
+ * @param array $checkRows
+ * Array of header and rows according to row index.
* eg: array(
* 1 => array(
// Row index 1
* 'Last Name' => 'mayekar'
* ),
* );
- * @param int $rowCount count rows (excluding header row).
- * @param array $settings used for override settings.
+ * @param int $rowCount
+ * Count rows (excluding header row).
+ * @param array $settings
+ * Used for override settings.
*/
public function reviewCSV($file, $checkColumns = array(), $checkRows = array(), $rowCount = 0, $settings = array()) {
// Check file exists before proceed.
/**
* Test csv import for each component.
*
- * @param string $component component name ( Event, Contribution, Membership, Activity etc)
- * @param array $headers csv data headers
- * @param array $rows csv data rows
- * @param string $contactType contact type
- * @param string $mode import mode
- * @param array $fieldMapper select mapper fields while import
- * @param array $other other parameters
+ * @param string $component
+ * Component name ( Event, Contribution, Membership, Activity etc).
+ * @param array $headers
+ * Csv data headers.
+ * @param array $rows
+ * Csv data rows.
+ * @param string $contactType
+ * Contact type.
+ * @param string $mode
+ * Import mode.
+ * @param array $fieldMapper
+ * Select mapper fields while import.
+ * @param array $other
+ * Other parameters.
* useMappingName : to reuse mapping
* dateFormat : date format of data
/**
* Test contact import.
*
- * @param array $headers csv data headers
- * @param array $rows csv data rows
- * @param string $contactType contact type
- * @param string $mode import mode
- * @param array $fieldMapper select mapper fields while import
- * @param array $other other parameters
+ * @param array $headers
+ * Csv data headers.
+ * @param array $rows
+ * Csv data rows.
+ * @param string $contactType
+ * Contact type.
+ * @param string $mode
+ * Import mode.
+ * @param array $fieldMapper
+ * Select mapper fields while import.
+ * @param array $other
+ * Other parameters.
* contactSubtype : import for selected Contact Subtype
* useMappingName : to reuse mapping
* selectTag : select existing tag for contacts
* callbackImportSummary : function to override default import summary assertions
*
- * @param string $type import type (csv/sql)
+ * @param string $type
+ * Import type (csv/sql).
* @todo:currently only supports csv, need to work on sql import
*/
public function importContacts($headers, $rows, $contactType = 'Individual', $mode = 'Skip', $fieldMapper = array(), $other = array(), $type = 'csv') {
/**
* Helper function to get the import url of the component.
- * @param string $component component name
+ * @param string $component
+ * Component name.
*
* @return string import url
*/
/**
* Helper function to add new event
*
- * @param array $params parameters to create an event
+ * @param array $params
+ * Parameters to create an event.
*
* @return array $params event details of newly created event
*/
* ReflectionClass of the Test class and checks the constructor
* of that class to decide how to set up the test.
*
- * @param string $name
- * @param array $data
- * @param string $dataName
+ * @param string $name
+ * @param array $data
+ * @param string $dataName
* @param array $browser
*/
function __construct($name = NULL, array$data = array(
/**
* Require once Files
- * @param $files array list of files to load
+ * @param $files
+ * Array list of files to load.
*/
public function requireOnceFilesArray($files) {
foreach ($files as $key => $file) {
/**
* Create an attachment using "content" and then "get" the attachment
*
- * @param string $testEntityClass e.g. "CRM_Core_DAO_Activity"
+ * @param string $testEntityClass
+ * E.g. "CRM_Core_DAO_Activity".
* @param array $createParams
* @param string $expectedContent
* @dataProvider okCreateProvider
}
/**
- * @param integer $count
- * @param integer $groupID
+ * @param int $count
+ * @param int $groupID
*/
public function createContactsInGroup($count, $groupID) {
for($i = 1; $i <= $count; $i++ ) {
}
/**
- * @param integer $start
- * @param integer $count
+ * @param int $start
+ * @param int $count
*
* @return array
*/
}
/**
* Generate list of entities to test for get by id functions
- * @param boolean $sequential
+ * @param bool $sequential
* @return array Entities to be skipped
*/
public static function toBeSkipped_automock($sequential = FALSE) {
/**
* Check that get fetches an appropriate number of results
*
- * @param string $entityName Name of entity to test
+ * @param string $entityName
+ * Name of entity to test.
* @param array $params
- * @param integer $limit
+ * @param int $limit
* @param string $message
*/
public function checkLimitAgainstExpected($entityName, $params, $limit, $message) {
* @param string $entity
* @param string $action
* @param array $params
- * @param bool $throws whether we should pass any exceptions for authorization failures
+ * @param bool $throws
+ * Whether we should pass any exceptions for authorization failures.
*
* @throws API_Exception
* @throws Exception