* created entities and provides for brainless clenaup.
*
* @see CRM_Core_DAO::createTestObject
+ * @param $daoName
+ * @param array $params
+ * @param int $numObjects
+ * @param bool $createOnly
*/
function createTestObject($daoName, $params = array(), $numObjects = 1, $createOnly = FALSE) {
$objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly);
/**
* Test CRM_Contact_BAO_Query::searchQuery()
* @dataProvider dataProvider
+ * @param $fv
+ * @param $count
+ * @param $ids
+ * @param $full
*/
public function testSearch($fv, $count, $ids, $full) {
$op = new PHPUnit_Extensions_Database_Operation_Insert();
/**
* Test CRM_Contact_Form_Search_Custom_Group::count()
* @dataProvider dataProvider
+ * @param $fv
+ * @param $count
+ * @param $ids
+ * @param $full
+ * @throws \Exception
*/
public function testCount($fv, $count, $ids, $full) {
$this->foreignKeyChecksOff();
/**
* Test CRM_Contact_Form_Search_Custom_Group::all()
* @dataProvider dataProvider
+ * @param $fv
+ * @param $count
+ * @param $ids
+ * @param $full
+ * @throws \Exception
*/
public function testAll($fv, $count, $ids, $full) {
// Truncate affected tables
/**
* Test CRM_Contact_Form_Search_Custom_Group::contactIDs()
* @dataProvider dataProvider
+ * @param $fv
+ * @param $count
+ * @param $ids
+ * @param $full
+ * @throws \Exception
*/
public function testContactIDs($fv, $count, $ids, $full) {
// Truncate affected tables
* created entities and provides for brainless clenaup.
*
* @see CRM_Core_DAO::createTestObject
+ * @param $daoName
+ * @param array $params
+ * @param int $numObjects
+ * @param bool $createOnly
*/
function createTestObject($daoName, $params = array(), $numObjects = 1, $createOnly = FALSE) {
$objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly);
/**
* @dataProvider composeQueryExamples
+ * @param $inputSql
+ * @param $inputParams
+ * @param $expectSql
*/
public function testComposeQuery($inputSql, $inputParams, $expectSql) {
$actualSql = CRM_Core_DAO::composeQuery($inputSql, $inputParams);
/**
* @dataProvider sqlNameDataProvider
+ * @param $inputData
+ * @param $length
+ * @param $makeRandom
+ * @param $expectedResult
*/
public function testShortenSQLName($inputData, $length, $makeRandom, $expectedResult) {
$this->assertEquals($expectedResult, CRM_Core_DAO::shortenSQLName($inputData, $length, $makeRandom));
/**
* @dataProvider scopeCases
+ * @param $expected
+ * @param $input
*/
public function testBlank($expected, $input) {
$smarty = CRM_Core_Smarty::singleton();
/**
* @dataProvider dataCreateStyle
+ * @param $createStyle
*/
public function testBasicRollback($createStyle) {
$this->createContactWithTransaction('reuse-tx', $createStyle, 'rollback');
/**
* Test CRM_Contact_BAO_Query::searchQuery()
* @dataProvider dataProvider
+ * @param $fv
+ * @param $count
+ * @param $ids
+ * @param $full
*/
public function testSearch($fv, $count, $ids, $full) {
$op = new PHPUnit_Extensions_Database_Operation_Insert();
* Create a few queue items; alternately enqueue and dequeue various
*
* @dataProvider getQueueSpecs
+ * @param $queueSpec
*/
public function testPriorities($queueSpec) {
$this->queue = $this->queueService->create($queueSpec);
* Create a few queue items; alternately enqueue and dequeue various
*
* @dataProvider getQueueSpecs
+ * @param $queueSpec
*/
public function testBasicUsage($queueSpec) {
$this->queue = $this->queueService->create($queueSpec);
* Claim an item from the queue and release it back for subsequent processing
*
* @dataProvider getQueueSpecs
+ * @param $queueSpec
*/
public function testManualRelease($queueSpec) {
$this->queue = $this->queueService->create($queueSpec);
* Test that item leases expire at the expected time
*
* @dataProvider getQueueSpecs
+ * @param $queueSpec
*/
public function testTimeoutRelease($queueSpec) {
$this->queue = $this->queueService->create($queueSpec);
* Test that item leases can be ignored
*
* @dataProvider getQueueSpecs
+ * @param $queueSpec
*/
public function testStealItem($queueSpec) {
$this->queue = $this->queueService->create($queueSpec);
* Test that queue content is reset when reset=>TRUE
*
* @dataProvider getQueueSpecs
+ * @param $queueSpec
*/
public function testCreateResetTrue($queueSpec) {
$this->queue = $this->queueService->create($queueSpec);
* Test that queue content is not reset when reset is omitted
*
* @dataProvider getQueueSpecs
+ * @param $queueSpec
*/
public function testCreateResetFalse($queueSpec) {
$this->queue = $this->queueService->create($queueSpec);
* Test that queue content is not reset when using load()
*
* @dataProvider getQueueSpecs
+ * @param $queueSpec
*/
public function testLoad($queueSpec) {
$this->queue = $this->queueService->create($queueSpec);
/**
* @dataProvider dataProvider
+ * @param $reportClass
+ * @param $inputParams
+ * @param $dataSet
+ * @param $expectedOutputCsvFile
+ * @throws \Exception
*/
public function testReportOutput($reportClass, $inputParams, $dataSet, $expectedOutputCsvFile) {
$config = CRM_Core_Config::singleton();
/**
* @dataProvider dataProvider
+ * @param $reportClass
+ * @param $inputParams
+ * @param $dataSet
+ * @param $expectedOutputCsvFile
+ * @throws \Exception
*/
public function testReportOutput($reportClass, $inputParams, $dataSet, $expectedOutputCsvFile) {
$config = CRM_Core_Config::singleton();
/**
* @expectedException PHPUnit_Framework_AssertionFailedError
* @dataProvider badDataProvider
+ * @param $reportClass
+ * @param $inputParams
+ * @param $dataSet
+ * @param $expectedOutputCsvFile
+ * @throws \Exception
*/
public function testBadReportOutput($reportClass, $inputParams, $dataSet, $expectedOutputCsvFile) {
$config = CRM_Core_Config::singleton();
/**
* @dataProvider integerDataProvider
+ * @param $inputData
+ * @param $expectedResult
*/
public function testInteger($inputData, $expectedResult) {
$this->assertEquals($expectedResult, CRM_Utils_Rule::integer($inputData));
/**
* @dataProvider positiveDataProvider
+ * @param $inputData
+ * @param $expectedResult
*/
public function testPositive($inputData, $expectedResult) {
$this->assertEquals($expectedResult, CRM_Utils_Rule::positiveInteger($inputData));
/**
* @dataProvider numericDataProvider
+ * @param $inputData
+ * @param $expectedResult
*/
public function testNumeric($inputData, $expectedResult) {
$this->assertEquals($expectedResult, CRM_Utils_Rule::numeric($inputData));
/**
* @dataProvider parsePrefixData
+ * @param $input
+ * @param $defaultPrefix
+ * @param $expected
*/
public function testParsePrefix($input, $defaultPrefix, $expected) {
$actual = CRM_Utils_String::parsePrefix(':', $input, $defaultPrefix);
/**
* @dataProvider validateDataProvider
+ * @param $inputData
+ * @param $inputType
+ * @param $expectedResult
*/
public function testValidate($inputData, $inputType, $expectedResult) {
$this->assertEquals($expectedResult, CRM_Utils_Type::validate($inputData, $inputType, FALSE));
* @param array $monitoredEvents
* List of event names.
*
- * @internal param \Symfony\Component\EventDispatcher\EventDispatcher $this ->dispatcher
*/
public function monitorEvents($monitoredEvents) {
foreach ($monitoredEvents as $monitoredEvent) {
/**
* @dataProvider validEntityActionPairs
+ * @param $input
+ * @param $expected
+ * @throws \API_Exception
*/
public function testCreateRequest_EntityActionMunging($input, $expected) {
list ($inEntity, $inAction, $inVersion) = $input;
/**
* @dataProvider invalidEntityActionPairs
* @expectedException \API_Exception
+ * @param $inEntity
+ * @param $inAction
+ * @param $inVersion
+ * @throws \API_Exception
*/
public function testCreateRequest_InvalidEntityAction($inEntity, $inAction, $inVersion) {
Request::create($inEntity, $inAction, array('version' => $inVersion), NULL);
/**
* Ensure that API parameters "is_transactional" and "force_rollback" are parsed correctly
* @dataProvider transactionOptions
+ * @param $version
+ * @param $entity
+ * @param $action
+ * @param $params
+ * @param $isTransactional
+ * @param $isForceRollback
+ * @param $isNested
+ * @throws \API_Exception
*/
public function testTransactionOptions($version, $entity, $action, $params, $isTransactional, $isForceRollback, $isNested) {
$txs = new TransactionSubscriber();
* @match array Associative array of field name => expected value. Empty if asserting
* that a DELETE occurred
* @delete boolean True if we're checking that a DELETE action occurred.
+ * @param $testCase
+ * @param $daoName
+ * @param $id
+ * @param $match
+ * @param bool $delete
*/
public function assertDBState(&$testCase, $daoName, $id, $match, $delete = FALSE) {
if (empty($id)) {
/**
* Request a record from the DB by seachColumn+searchValue. Success if a record is found.
+ * @param $testCase
+ * @param $daoName
+ * @param $searchValue
+ * @param $returnColumn
+ * @param $searchColumn
+ * @param $message
+ * @return null|string
*/
public function assertDBNotNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) {
if (empty($searchValue)) {
/**
* Request a record from the DB by seachColumn+searchValue. Success if returnColumn value is NULL.
+ * @param $testCase
+ * @param $daoName
+ * @param $searchValue
+ * @param $returnColumn
+ * @param $searchColumn
+ * @param $message
*/
public function assertDBNull(&$testCase, $daoName, $searchValue, $returnColumn, $searchColumn, $message) {
$value = CRM_Core_DAO::getFieldValue($daoName, $searchValue, $returnColumn, $searchColumn);
/**
* Request a record from the DB by id. Success if row not found.
+ * @param $testCase
+ * @param $daoName
+ * @param $id
+ * @param $message
*/
public function assertDBRowNotExist(&$testCase, $daoName, $id, $message) {
$value = CRM_Core_DAO::getFieldValue($daoName, $id, 'id', 'id');
/**
* Compare all values in a single retrieved DB record to an array of expected values
+ * @param $testCase
+ * @param $daoName
+ * @param $searchParams
+ * @param $expectedValues
*/
public function assertDBCompareValues(&$testCase, $daoName, $searchParams, $expectedValues) {
//get the values from db
/**
* Check that mail log is empty
+ * @param string $prefix
*/
public function assertMailLogEmpty($prefix = '') {
$mail = $this->getMostRecentEmail('raw');
* Click on a link or button
* Wait for the page to load
* Wait for an element to be present
+ * @param $element
+ * @param string $waitFor
+ * @param bool $waitForPageLoad
*/
public function clickLink($element, $waitFor = 'civicrm-footer', $waitForPageLoad = TRUE) {
$this->click($element);
/**
* Call the API on the local server
* (kind of defeats the point of a webtest - see CRM-11889)
+ * @param $entity
+ * @param $action
+ * @param $params
+ * @return array|int
*/
public function webtest_civicrm_api($entity, $action, $params) {
if (!isset($params['version'])) {
* Call the API on the remote server
* Experimental - currently only works if permissions on remote site allow anon user to access ajax api
* @see CRM-11889
+ * @param $entity
+ * @param $action
+ * @param array $params
+ * @return mixed
*/
public function rest_civicrm_api($entity, $action, $params = array()) {
$params += array(
/**
* Ensures the required CiviCRM components are enabled
+ * @param $components
*/
public function enableComponents($components) {
$this->openCiviPage("admin/setting/component", "reset=1", "_qf_Component_next-bottom");
}
/**
+ * @param $sortName
+ * @param string $fieldName
*/
public function webtestFillAutocomplete($sortName, $fieldName = 'contact_id') {
$this->select2($fieldName, $sortName);
}
/**
+ * @param $sortName
*/
public function webtestOrganisationAutocomplete($sortName) {
$this->clickAt("//*[@id='contact_id']/../div/a");
* @param string $editor
* Which text editor (valid values are 'CKEditor', 'TinyMCE').
*
- * @return void
+ * @param bool $compressed
+ * @throws \PHPUnit_Framework_AssertionFailedError
*/
public function fillRichTextField($fieldName, $text = 'Typing this text into editor.', $editor = 'CKEditor', $compressed = FALSE) {
// make sure cursor focuses on the field
/**
* @deprecated in favor of createDialogContact
+ * @param string $fname
+ * @param string $lname
+ * @param string $email
+ * @param int $type
+ * @param string $selectId
+ * @param int $row
+ * @param string $prefix
*/
function webtestNewDialogContact(
$fname = 'Anthony', $lname = 'Anderson', $email = 'anthony@anderson.biz',
/**
* Returns a single argument from the url query
+ * @param $arg
+ * @param null $url
+ * @return null
*/
public function urlArg($arg, $url = NULL) {
$elements = $this->parseURL($url);
* @param string $financialType
* @param bool $fixedAmount
* @param bool $membershipsRequired
- * @internal param \can $User define pageTitle, hash and rand values for later data verification
*
* @return null
* of newly created online contribution page.
/**
* Edit Financial Account
+ * @param $editfinancialAccount
+ * @param bool $financialAccountTitle
+ * @param bool $financialAccountDescription
+ * @param bool $accountingCode
+ * @param bool $firstName
+ * @param bool $financialAccountType
+ * @param bool $taxDeductible
+ * @param bool $isActive
+ * @param bool $isTax
+ * @param bool $taxRate
+ * @param bool $isDefault
*/
function _testEditFinancialAccount(
$editfinancialAccount,
/**
* Delete Financial Account
+ * @param $financialAccountTitle
*/
public function _testDeleteFinancialAccount($financialAccountTitle) {
$this->click("xpath=//table/tbody//tr/td[1]/div[text()='{$financialAccountTitle}']/../../td[9]/span/a[text()='Delete']");
/**
* Verify data after ADD and EDIT
+ * @param $verifyData
*/
public function _assertFinancialAccount($verifyData) {
foreach ($verifyData as $key => $expectedValue) {
/**
* Give the specified permissions
* Note: this function logs in as 'admin' (logging out if necessary)
+ * @param $permission
*/
public function changePermissions($permission) {
$this->webtestLogin('admin');
/**
* Type and select first occurance of autocomplete
+ * @param $fieldName
+ * @param $label
+ * @param bool $multiple
+ * @param bool $xpath
*/
public function select2($fieldName, $label, $multiple = FALSE, $xpath = FALSE) {
// In the case of chainSelect, wait for options to load
/**
* Select multiple options
+ * @param $fieldid
+ * @param $params
*/
public function multiselect2($fieldid, $params) {
// In the case of chainSelect, wait for options to load
/**
* Check for unobtrusive status message as set by CRM.status
+ * @param null $text
*/
public function checkCRMStatus($text = NULL) {
$this->waitForElementPresent("css=.crm-status-box-outer.status-success");
/**
* Check for obtrusive status message as set by CRM.alert
+ * @param $text
+ * @param string $type
*/
public function checkCRMAlert($text, $type = 'success') {
$this->waitForElementPresent("css=div.ui-notify-message.$type");
/**
* Simple name based constructor
+ * @param string $theClass
+ * @param string $name
*/
public function __construct($theClass = '', $name = '') {
if (empty($name)) {
}
/**
+ * @param $myfile
+ * @return \PHPUnit_Framework_TestSuite
*/
protected function implSuite($myfile) {
$name = str_replace('_',
* @match array Associative array of field name => expected value. Empty if asserting
* that a DELETE occurred
* @delete boolean True if we're checking that a DELETE action occurred.
+ * @param $daoName
+ * @param $id
+ * @param $match
+ * @param bool $delete
+ * @throws \PHPUnit_Framework_AssertionFailedError
*/
public function assertDBState($daoName, $id, $match, $delete = FALSE) {
if (empty($id)) {
*
* Example: $this->assertSql(2, 'select count(*) from foo where foo.bar like "%1"',
* array(1 => array("Whiz", "String")));
+ * @param $expected
+ * @param $query
+ * @param array $params
+ * @param string $message
*/
public function assertDBQuery($expected, $query, $params = array(), $message = '') {
if ($message) {
/**
* Check that a deleted item has been deleted
+ * @param $entity
+ * @param $id
*/
public function assertAPIDeleted($entity, $id) {
$this->callAPISuccess($entity, 'getcount', array('id' => $id), 0);
/**
* Existing function doesn't allow params to be over-ridden so need a new one
* this one allows you to only pass in the params you want to change
+ * @param array $params
+ * @return array|int
*/
public function CustomGroupCreateByParams($params = array()) {
$defaults = array(
/**
* Create custom group with multi fields
+ * @param array $params
+ * @return array|int
*/
public function CustomGroupMultipleCreateByParams($params = array()) {
$defaults = array(
/**
* Create custom group with multi fields
+ * @param array $params
+ * @return array
*/
public function CustomGroupMultipleCreateWithFields($params = array()) {
// also need to pass on $params['custom_field'] if not set but not in place yet
/**
* Temporarily replace the singleton extension with a different one
+ * @param \CRM_Extension_System $system
*/
public function setExtensionSystem(CRM_Extension_System $system) {
if ($this->origExtensionSystem == NULL) {
* this parent class & we don't have a structure for that yet
* There is another function to this effect on the PaypalPro test but it appears to be silently failing
* & the best protection agains that is the functions this class affords
+ * @param array $params
+ * @return
*/
public function paymentProcessorCreate($params = array()) {
$params = array_merge(array(
/**
* Helper function to create membership block for contribution page
+ * @param $membershipType
+ * @param $contributionPageId
+ * @return $this
*/
public function createMembershipBlock($membershipType, $contributionPageId) {
$param = array(
/**
* Helper function to delete the membership block
+ * @param $blcokId
*/
public function deleteMembershipBlock($blcokId) {
$dao = new CRM_Member_DAO_MembershipBlock();
/**
* Construct an object for this database
+ * @param $host
+ * @param $port
+ * @param $user
+ * @param $pass
*/
public function __construct($host, $port, $user, $pass) {
try {
/**
* Helper FN
+ * @param null $firstName
+ * @param null $lastName
+ * @param null $organizationName
+ * @param string $contactType
+ * @return array
*/
public function _createContacts($firstName = NULL, $lastName = NULL, $organizationName = NULL, $contactType = 'Individual') {
if ($contactType == 'Individual') {
/**
* Helper FN
* to create new membership type
+ * @param $membershipOrganization
*/
public function addMembershipType($membershipOrganization) {
$this->openCiviPage("admin/member/membershipType", "reset=1&action=browse");
/**
* Add custom fields for a contact sub-type
+ * @param $contactSubType
+ * @return array
*/
public function _addCustomData($contactSubType) {
$this->openCiviPage("admin/custom/group", "action=add&reset=1");
/**
* Enter form values in a Search Builder row
+ * @param $set
+ * @param $row
+ * @param $entity
+ * @param $field
+ * @param $loc
+ * @param $op
+ * @param string $value
*/
public function enterValues($set, $row, $entity, $field, $loc, $op, $value = '') {
if ($set > 1 && $row == 1) {
* This code is reused with advanced search, hence the reference to $self
*
* @static
+ * @param string $tagName
+ * @param $self
*/
public static function addTag($tagName = 'New Tag', $self) {
$self->openCiviPage('admin/tag', array('reset' => 1, 'action' => 'add'), '_qf_Tag_next');
/**
* Helper function to select Editor.
+ * @param $editor
*/
public function _selectEditor($editor) {
$this->openCiviPage('admin/setting/preferences/display', 'reset=1');
/**
* Helper function for Check Signature in Editor.
+ * @param $fieldName
+ * @param $signature
+ * @param $editor
*/
public function _checkSignature($fieldName, $signature, $editor) {
if ($editor == 'CKEditor') {
/**
* Helper function for Check Signature in Activity.
+ * @param $subject
+ * @param $signature
*/
public function _checkActivity($subject, $signature) {
$this->openCiviPage('activity/search', 'reset=1', '_qf_Search_refresh');
/**
* @param string $context
- * @param string $parentElement
- *
+ * @param bool $dialog
* @return mixed
+ *
*/
public function _addRecords($context = 'Edit', $dialog = FALSE) {
$params['text'] = 'text' . substr(sha1(rand()), 0, 3);
/**
* @dataProvider apiTestCases
+ * @param $query
+ * @param $is_error
*/
public function testAPICalls($query, $is_error) {
$client = CRM_Utils_HttpClient::singleton();
/**
* @dataProvider entities
* confirm that without check permissions we still get 2 contacts returned
+ * @param $entity
*/
public function testEntitiesGetHookLimitingHookNoCheck($entity) {
CRM_Core_Config::singleton()->userPermissionClass->permissions = array();
/**
* @dataProvider entities
* confirm that without check permissions we still get 2 entities returned
+ * @param $entity
*/
public function testEntitiesGetCoreACLLimitingHookNoCheck($entity) {
$this->setupCoreACL();
/**
* @dataProvider entities
* confirm that with check permissions we don't get entities
+ * @param $entity
+ * @throws \PHPUnit_Framework_IncompleteTestError
*/
public function testEntitiesGetCoreACLLimitingCheck($entity) {
$this->markTestIncomplete('this does not work in 4.4 but can be enabled in 4.5 or a security release of 4.4 including the important security fix CRM-14877');
/**
* @dataProvider entities
* Function tests that an empty where hook returns no results
+ * @param $entity
+ * @throws \PHPUnit_Framework_IncompleteTestError
*/
public function testEntityGetNoResultsHook($entity) {
$this->markTestIncomplete('hook acls only work with contacts so far');
/**
* Create 2 entities
+ * @param $entity
*/
public function setUpEntities($entity) {
$baoObj = new CRM_Core_DAO();
/**
* No results returned
+ * @param $type
+ * @param $tables
+ * @param $whereTables
+ * @param $contactID
+ * @param $where
*/
public function aclWhereHookNoResults($type, &$tables, &$whereTables, &$contactID, &$where) {
}
/**
* All results returned
* @implements CRM_Utils_Hook::aclWhereClause
+ * @param $type
+ * @param $tables
+ * @param $whereTables
+ * @param $contactID
+ * @param $where
*/
public function aclWhereHookAllResults($type, &$tables, &$whereTables, &$contactID, &$where) {
$where = " (1) ";
/**
* Full results returned
* @implements CRM_Utils_Hook::aclWhereClause
+ * @param $type
+ * @param $tables
+ * @param $whereTables
+ * @param $contactID
+ * @param $where
*/
public function aclWhereOnlySecond($type, &$tables, &$whereTables, &$contactID, &$where) {
$where = " contact_a.id > 1";
/**
* Simple name based constructor
+ * @param string $theClass
+ * @param string $name
*/
function __construct($theClass = '', $name = '') {
parent::__construct($theClass, $name);
/**
* This function does a GET & compares the result against the $params
* Use as a double check on Creates
+ * @param $params
+ * @param $id
+ * @param int $delete
*/
public function contributionGetnCheck($params, $id, $delete = 1) {
/**
* Create relationship type.
+ * @param null $params
+ * @return mixed
*/
public function _relationshipTypeCreate($params = NULL) {
if (!is_array($params) || empty($params)) {
/**
* @dataProvider getReportTemplates
+ * @param $reportID
+ * @throws \PHPUnit_Framework_IncompleteTestError
*/
public function testReportTemplateGetRowsAllReports($reportID) {
if (stristr($reportID, 'has existing issues')) {
/**
* @dataProvider getReportTemplates
+ * @param $reportID
+ * @throws \PHPUnit_Framework_IncompleteTestError
*/
public function testReportTemplateGetStatisticsAllReports($reportID) {
if (stristr($reportID, 'has existing issues')) {
/**
* At this stage exclude the ones that don't pass & add them as we can troubleshoot them
+ * @param bool $sequential
+ * @return array
*/
public static function toBeSkipped_updatesingle($sequential = FALSE) {
$entitiesWithout = array(
/**
* @dataProvider toBeSkipped_get
entities that don't need a get action
+ * @param $Entity
*/
public function testNotImplemented_get($Entity) {
$result = civicrm_api($Entity, 'Get', array('version' => 3));
/**
* @dataProvider entities
* @expectedException PHPUnit_Framework_Error
+ * @param $Entity
*/
public function testWithoutParam_get($Entity) {
// should get php complaining that a param is missing
/**
* @dataProvider entities
+ * @param $Entity
*/
public function testGetFields($Entity) {
if (in_array($Entity, $this->deprecatedAPI) || $Entity == 'Entity' || $Entity == 'CustomValue') {
/**
* @dataProvider entities_get
+ * @param $Entity
*/
public function testEmptyParam_get($Entity) {
/**
* @dataProvider entities_get
+ * @param $Entity
*/
public function testEmptyParam_getString($Entity) {
/**
* @dataProvider entities_get
* @Xdepends testEmptyParam_get // no need to test the simple if the empty doesn't work/is skipped. doesn't seem to work
+ * @param $Entity
*/
public function testSimple_get($Entity) {
// $this->markTestSkipped("test gives core error on test server (but not on our locals). Skip until we can get server to pass");
/**
* @dataProvider custom_data_entities_get
+ * @param $entityName
*/
public function testCustomDataGet($entityName) {
$this->createLoggedInUser();// so subsidiary activities are created
/**
* @dataProvider entities_get
+ * @param $Entity
*/
public function testAcceptsOnlyID_get($Entity) {
// big random number. fun fact: if you multiply it by pi^e, the result is another random number, but bigger ;)
* limitations include the problem with avoiding loops when creating test objects -
* hence FKs only set by createTestObject when required. e.g parent_id on campaign is not being followed through
* Currency - only seems to support US
+ * @param $entityName
*/
public function testByID_get($entityName) {
if (in_array($entityName, self::toBeSkipped_automock(TRUE))) {
* limitations include the problem with avoiding loops when creating test objects -
* hence FKs only set by createTestObject when required. e.g parent_id on campaign is not being followed through
* Currency - only seems to support US
+ * @param $entityName
+ * @throws \PHPUnit_Framework_IncompleteTestError
*/
public function testByIDAlias_get($entityName) {
if (in_array($entityName, self::toBeSkipped_automock(TRUE))) {
/**
* @dataProvider entities_get
+ * @param $Entity
*/
public function testNonExistantID_get($Entity) {
// cf testAcceptsOnlyID_get
/**
* @dataProvider toBeSkipped_create
entities that don't need a create action
+ * @param $Entity
*/
public function testNotImplemented_create($Entity) {
$result = civicrm_api($Entity, 'Create', array('version' => 3));
/**
* @dataProvider entities
* @expectedException PHPUnit_Framework_Error
+ * @param $Entity
*/
public function testWithoutParam_create($Entity) {
// should create php complaining that a param is missing
/**
* @dataProvider entities_create
+ * @param $Entity
+ * @throws \PHPUnit_Framework_IncompleteTestError
*/
public function testEmptyParam_create($Entity) {
$this->markTestIncomplete("fixing this test to test the api functions fails on numberous tests
* @dataProvider entities_create
*
* Check that create doesn't work with an invalid
+ * @param $Entity
+ * @throws \PHPUnit_Framework_IncompleteTestError
*/
public function testInvalidID_create($Entity) {
// turn test off for noew
* limitations include the problem with avoiding loops when creating test objects -
* hence FKs only set by createTestObject when required. e.g parent_id on campaign is not being followed through
* Currency - only seems to support US
+ * @param $entityName
*/
public function testCreateSingleValueAlter($entityName) {
if (in_array($entityName, $this->toBeImplemented['create'])) {
/**
* @dataProvider toBeSkipped_delete
entities that don't need a delete action
+ * @param $Entity
*/
public function testNotImplemented_delete($Entity) {
$nonExistantID = 151416349;
/**
* @dataProvider entities
* @expectedException PHPUnit_Framework_Error
+ * @param $Entity
*/
public function testWithoutParam_delete($Entity) {
// should delete php complaining that a param is missing
/**
* @dataProvider entities_delete
+ * @param $Entity
*/
public function testEmptyParam_delete($Entity) {
if (in_array($Entity, $this->toBeImplemented['delete'])) {
/**
* @dataProvider entities_delete
+ * @param $Entity
+ * @throws \PHPUnit_Framework_IncompleteTestError
*/
public function testInvalidID_delete($Entity) {
// turn test off for now
* limitations include the problem with avoiding loops when creating test objects -
* hence FKs only set by createTestObject when required. e.g parent_id on campaign is not being followed through
* Currency - only seems to support US
+ * @param $entityName
+ * @throws \PHPUnit_Framework_IncompleteTestError
*/
public function testByID_delete($entityName) {
// turn test off for noew
* Create two entities and make sure delete action only deletes one!
*
* @dataProvider entities_getfields
+ * @param $entity
*/
public function testGetfieldsHasTitle($entity) {
$entities = $this->getEntitiesSupportingCustomFields();