$GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'] = array();
$env = new CRM_Utils_Check_Env();
- CRM_Utils_Check::singleton()->assertValid($env->checkAll());
+ CRM_Utils_Check::singleton()->assertValid($env->checkMysqlTime());
}
/**
/**
* 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 null $expectedError
*/
function assertAPIFailure($apiResult, $prefix = '', $expectedError = NULL) {
if (!empty($prefix)) {
/**
* check that api returned 'is_error' => 1
* else provide full message
- * @param array $apiResult api result
+ * @param $result
+ * @param $expected
+ * @param array $valuesToExclude
* @param string $prefix extra test to add to message
+ * @internal param array $apiResult api result
*/
function assertAPIArrayComparison($result, $expected, $valuesToExclude = array(), $prefix = '') {
$valuesToExclude = array_merge($valuesToExclude, array('debug', 'xdebug', 'sequential'));
/**
* This function exists to wrap api functions
* so we can ensure they succeed & throw exceptions without litterering the test with checks
+ *
* @param string $entity
* @param string $action
* @param array $params
* 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 )
+ *
+ * @return array|int
*/
function callAPISuccess($entity, $action, $params, $checkAgainst = NULL) {
$params = array_merge(array(
* This function exists to wrap api getValue function & check the result
* so we can ensure they succeed & throw exceptions without litterering the test with checks
* There is a type check in this
+ *
* @param string $entity
* @param array $params
* @param string $type - per http://php.net/manual/en/function.gettype.php possible types
* - string
* - array
* - object
+ *
+ * @return array|int
*/
function callAPISuccessGetValue($entity, $params, $type = NULL) {
$params += array(
/**
* This function exists to wrap api getsingle function & check the result
* so we can ensure they succeed & throw exceptions without litterering the test with checks
+ *
* @param string $entity
* @param array $params
* @param array $checkAgainst - array to compare result against
* - string
* - array
* - object
+ *
+ * @return array|int
*/
function callAPISuccessGetSingle($entity, $params, $checkAgainst = NULL) {
$params += array(
}
return $result;
}
+
/**
* This function exists to wrap api getValue function & check the result
* so we can ensure they succeed & throw exceptions without litterering the test with checks
* There is a type check in this
* @param string $entity
* @param array $params
- * @param string $type - per http://php.net/manual/en/function.gettype.php possible types
+ * @param null $count
+ * @throws Exception
+ * @return array|int
+ * @internal param string $type - per http://php.net/manual/en/function.gettype.php possible types
* - boolean
* - integer
* - double
* @param string $action
* @param array $params
* @param string $expectedErrorMessage error
+ * @param null $extraOutput
+ * @return array|int
*/
function callAPIFailure($entity, $action, $params, $expectedErrorMessage = NULL, $extraOutput = NULL) {
if (is_array($params)) {
/**
* Function to delete Membership Type
*
- * @param int $membershipTypeID
+ * @param $params
+ * @internal param int $membershipTypeID
*/
function membershipTypeDelete($params) {
$result = $this->callAPISuccess('MembershipType', 'Delete', $params);
/**
* Function to create contribution page
*
+ * @param $params
* @return object of contribution page
*/
function contributionPageCreate($params) {
/**
* Function to create Tag
*
+ * @param array $params
* @return array result of created tag
*/
function tagCreate($params = array()) {
/**
* Add entity(s) to the tag
*
- * @param array $params
+ * @param array $params
+ *
+ * @return bool
*/
function entityTagAdd($params) {
$result = $this->callAPISuccess('entity_tag', 'create', $params);
/**
* Function to create contribution
*
- * @param int $cID contact_id
- * @param int $cTypeID id of financial type
+ * @param int $cID contact_id
+ *
+ * @internal param int $cTypeID id of financial type
*
* @return int id of created contribution
*/
/**
* Function to delete contribution
*
- * @param int $contributionId
+ * @param $pledgeId
+ * @internal param int $contributionId
*/
function pledgeDelete($pledgeId) {
$params = array(
/**
* Function to 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
+ * @param int $paymentInstrumentID
+ * @param bool $isFee
* @return int id of created contribution
*/
function contributionCreate($cID, $cTypeID = 1, $invoiceID = 67890, $trxnID = 12345, $paymentInstrumentID = 1, $isFee = TRUE) {
/**
* Function to create online contribution
*
- * @param int $financialType id of financial type
+ * @param $params
+ * @param int $financialType id of financial type
*
+ * @param int $invoiceID
+ * @param int $trxnID
* @return int id of created contribution
*/
function onlineContributionCreate($params, $financialType, $invoiceID = 67890, $trxnID = 12345) {
* Function to delete contribution
*
* @param int $contributionId
+ *
+ * @return array|int
*/
function contributionDelete($contributionId) {
$params = array(
/**
* Function to delete event
*
- * @param int $id ID of the event
+ * @param int $id ID of the event
+ *
+ * @return array|int
*/
function eventDelete($id) {
$params = array(
* Function to delete participant
*
* @param int $participantID
+ *
+ * @return array|int
*/
function participantDelete($participantID) {
$params = array(
/**
* Function to create participant payment
*
+ * @param $participantID
+ * @param null $contributionID
* @return int $id of created payment
*/
function participantPaymentCreate($participantID, $contributionID = NULL) {
/**
* Function to add a Location
*
+ * @param $contactID
* @return int location id of created location
*/
function locationAdd($contactID) {
/**
* Function to add a Location Type
*
+ * @param null $params
* @return int location id of created location
*/
function locationTypeCreate($params = NULL) {
*
* @params array to add group
*
+ * @param array $params
* @return int groupId of created group
- *
*/
function groupCreate($params = array()) {
$params = array_merge(array(
/**
* Function to delete a Group
*
- * @param int $id
+ * @param $gid
+ * @internal param int $id
*/
function groupDelete($gid) {
), $params);
$this->callAPISuccess('uf_field', 'create', $params);
}
+
/**
* Function to add a UF Join Entry
*
+ * @param null $params
* @return int $id of created UF Join
*/
function ufjoinCreate($params = NULL) {
/**
* Function to delete Group for a contact
*
- * @param array $params
+ * @param $contactId
+ * @internal param array $params
*/
function contactGroupDelete($contactId) {
$params = array(
/**
* Function to create Activity
*
- * @param int $contactId
+ * @param null $params
+ * @return array|int
+ * @internal param int $contactId
*/
function activityCreate($params = NULL) {
/**
* Function to create custom group
*
- * @param string $className
- * @param string $title name of custom group
+ * @param array $params
+ * @return array|int
+ * @internal param string $className
+ * @internal param string $title name of custom group
*/
function customGroupCreate($params = array()) {
$defaults = array(
* participant:testCreateWithCustom for how to use this
*
* @param string $function __FUNCTION__
- * @param string $file __FILE__
+ * @param $filename
+ * @internal param string $file __FILE__
*
* @return array $ids ids of created objects
- *
*/
function entityCustomGroupWithSingleFieldCreate($function, $filename) {
$params = array('title' => $function);
/**
* Function to delete custom group
*
- * @param int $customGroupID
+ * @param int $customGroupID
+ *
+ * @return array|int
*/
function customGroupDelete($customGroupID) {
$params['id'] = $customGroupID;
* Function to create custom field
*
* @param array $params (custom_group_id) is required
- * @param string $name name of custom field
- * @param int $apiversion API version to use
+ * @return array|int
+ * @internal param string $name name of custom field
+ * @internal param int $apiversion API version to use
*/
function customFieldCreate($params) {
$params = array_merge(array(
* Function to delete custom field
*
* @param int $customFieldID
+ *
+ * @return array|int
*/
function customFieldDelete($customFieldID) {
*
* @params array $params name-value pair for an event
*
+ * @param $cId
* @return array $note
*/
function noteCreate($cId) {
/**
* Tidy up examples array so that fields that change often ..don't
* and debug related fields are unset
- * @param array $params
+ *
+ * @param $result
+ *
+ * @internal param array $params
*/
function tidyExampleResult(&$result){
if(!is_array($result)) {
/**
* Function to create custom field with Option Values
*
- * @param array $customGroup
- * @param string $name name of custom field
+ * @param array $customGroup
+ * @param string $name name of custom field
+ *
+ * @return array|int
*/
function customFieldOptionValueCreate($customGroup, $name) {
$fieldParams = array(
/**
* Generate a temporary folder
*
- * @return $string
+ * @param string $prefix
+ * @return string $string
*/
function createTempDir($prefix = 'test-') {
$tempDir = CRM_Utils_File::tempdir($prefix);