/**
* Set up function.
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
// $this->quickCleanup(array('civicrm_acl_contact_cache'), TRUE);
$this->useTransaction(TRUE);
*
* @throws \CiviCRM_API3_Exception
*/
- public function setUp() {
+ public function setUp():void {
parent::setUp();
$this->prepareForACLs();
CRM_Core_Config::singleton()->userPermissionClass->permissions = ['view all contacts', 'access CiviCRM'];
*/
class CRM_Activity_Form_ActivityTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp():void {
parent::setUp();
$this->assignee1 = $this->individualCreate([
'first_name' => 'testassignee1',
*/
class CRM_Activity_Form_SearchTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->individualID = $this->individualCreate();
$this->contributionCreate([
*/
class CRM_Activity_Page_AJAXTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->loadAllFixtures();
*/
protected $_contactID4 = NULL;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$params = [
*/
class CRM_Case_BAO_CaseTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->tablesToTruncate = [
*/
class CRM_Case_BAO_CaseTypeForkTest extends CiviCaseTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
CRM_Core_ManagedEntities::singleton(TRUE)->reconcile();
}
protected $custom_group;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->custom_group = $this->customGroupCreate(['extends' => 'Case']);
$this->custom_group = $this->custom_group['values'][$this->custom_group['id']];
*/
class CRM_Case_Form_SearchTest extends CiviCaseTestCase {
- public function setUp() {
+ public function setUp():void {
parent::setUp();
$this->quickCleanup(['civicrm_case_contact', 'civicrm_case', 'civicrm_contact']);
}
*/
class CRM_Case_XMLProcessor_ProcessTest extends CiviCaseTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->defaultAssigneeOptionsValues = [];
*/
class CRM_Case_XMLProcessor_ReportTest extends CiviCaseTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->simplifyCaseTypeDefinition();
*/
class CRM_Case_XMLProcessorTest extends CiviCaseTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->processor = new CRM_Case_XMLProcessor();
class CRM_Case_XMLRepositoryTest extends CiviUnitTestCase {
protected $fixtures = [];
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->fixtures['CaseTypeWithSingleActivityType'] = '
<CaseType>
* Connect to the database, truncate the tables that will be used
* and redirect stdin to a temporary file
*/
- public function setUp() {
+ public function setUp(): void {
// Connect to the database
parent::setUp();
*/
class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
- /**
- * Set up function.
- */
- public function setUp() {
- parent::setUp();
- }
-
/**
* Test case for add( ).
*
*/
class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$students = 'indivi_student' . substr(sha1(rand()), 0, 7);
$params = [
*/
class CRM_Contact_BAO_ContactType_ContactTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$params = [
*/
class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$params = [
'label' => 'sub1_individual',
*/
class CRM_Contact_BAO_ContactType_RelationshipTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
//create contact subtypes
*/
private $_testObjects;
- /**
- * Sets up the fixture, for example, opens a network connection.
- *
- * This method is called before a test is executed.
- */
- protected function setUp() {
- $this->_testObjects = [];
- parent::setUp();
- }
-
/**
* Tears down the fixture, for example, closes a network connection.
*
*/
class CRM_Contact_BAO_GroupTest extends CiviUnitTestCase {
- /**
- * Sets up the fixture, for example, opens a network connection.
- *
- * This method is called before a test is executed.
- */
- protected function setUp() {
- parent::setUp();
- }
-
/**
* Tears down the fixture, for example, closes a network connection.
*
return new CRM_Contact_BAO_QueryTestDataProvider();
}
- public function setUp() {
- parent::setUp();
- }
-
/**
* Clean up after test.
*
*/
class CRM_Contact_BAO_RelationshipCacheTest extends CiviUnitTestCase {
- protected function setUp() {
+ protected function setUp(): void {
$this->useTransaction(TRUE);
parent::setUp();
}
*/
class CRM_Contact_BAO_RelationshipTest extends CiviUnitTestCase {
- /**
- * Sets up the fixture, for example, opens a network connection.
- *
- * This method is called before a test is executed.
- */
- protected function setUp() {
- parent::setUp();
- }
-
/**
* Tears down the fixture, for example, closes a network connection.
*
*/
class CRM_Contribute_BAO_ContributionTypeTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->organizationCreate();
}
*/
class CRM_Contribute_BAO_ProductTest extends CiviUnitTestCase {
- public function setUp() {
- parent::setUp();
- }
-
/**
* Check method add()
*/
*/
class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp():void {
parent::setUp();
// $query = "INSERT INTO civicrm_domain ( name, version ) VALUES ( 'domain', 3 )";
// $result = CRM_Core_DAO::executeQuery($query);
*/
class CRM_Extension_Manager_ReportTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
//if (class_exists('test_extension_manager_reporttest')) {
// test_extension_manager_reporttest::$counts = array();
]);
}
- public function tearDown() {
- parent::tearDown();
- }
-
/**
* Install an extension with a valid type name.
*/
const TESTING_TYPE = 'report';
const OTHER_TESTING_TYPE = 'module';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
list ($this->basedir, $this->container) = $this->_createContainer();
$this->mapper = new CRM_Extension_Mapper($this->container);
}
- public function tearDown() {
- parent::tearDown();
- }
-
/**
* Install an extension with an invalid type name.
*
*/
protected $mapperWithSlash;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
list ($this->basedir, $this->container) = $this->_createContainer();
$this->mapper = new CRM_Extension_Mapper($this->container);
$this->mapperWithSlash = new CRM_Extension_Mapper($this->containerWithSlash);
}
- public function tearDown() {
- parent::tearDown();
- }
-
public function testClassToKey() {
$this->assertEquals("test.foo.bar", $this->mapper->classToKey('test_foo_bar'));
}
/**
* Setup function.
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->createLoggedInUser();
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$contributionPage = $this->contributionPageCreate();
$this->_contributionPageId = $contributionPage['id'];
}
- /**
- * Tears down the fixture, for example, closes a network connection.
- * This method is called after a test is executed.
- */
- protected function tearDown() {
- }
-
/**
* create() and deletepledgeblock() method
*/
*/
class CRM_Pledge_BAO_PledgePaymentTest extends CiviUnitTestCase {
- /**
- * Sets up the fixture, for example, opens a network connection.
- * This method is called before a test is executed.
- */
- protected function setUp() {
- parent::setUp();
- }
-
- /**
- * Tears down the fixture, for example, closes a network connection.
- * This method is called after a test is executed.
- */
- protected function tearDown() {
- }
-
/**
* Test for Add/Update Pledge Payment.
*/
*
* @throws \CiviCRM_API3_Exception
*/
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->ids['Contact'][0] = $this->individualCreate();
$this->_params = [
];
}
- /**
- * Tears down the fixture, for example, closes a network connection.
- * This method is called after a test is executed.
- */
- protected function tearDown() {
- }
-
/**
* Test for Add/Update Pledge.
*
*/
class CRM_Price_BAO_PriceFieldValueTest extends CiviUnitTestCase {
- /**
- * Sets up the fixtures.
- */
- protected function setUp() {
- parent::setUp();
- }
-
- /**
- * Tears down the fixture.
- */
- protected function tearDown() {
- }
-
/**
* Verifies visibility field exists and is configured as a pseudoconstant
* referencing the 'visibility' option group.
*/
class CRM_Price_BAO_PriceSetTest extends CiviUnitTestCase {
- /**
- * Sets up the fixtures.
- */
- protected function setUp() {
- parent::setUp();
- }
-
- /**
- * Tears down the fixture.
- */
- protected function tearDown() {
- }
-
/**
* Test the correct amount level is returned for an event which is not presented as a price set event.
*
'civicrm_address',
];
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->quickCleanup($this->_tablesToTruncate);
}
- public function tearDown() {
- parent::tearDown();
- }
-
/**
* Ensure the new Odd/Event street number sort column works correctly
*/
*/
class CRM_Report_FormTest extends CiviUnitTestCase {
- public function setUp() {
- // There are only unit tests here at present, we can skip database loading.
- return TRUE;
- }
-
- public function tearDown() {
- // There are only unit tests here at present, we can skip database loading.
- return TRUE;
- }
-
/**
* Used by testGetFromTo
*/
*/
class CRM_Upgrade_Incremental_php_FiveTwentyTest extends CiviCaseTestCase {
- public function setUp() {
- parent::setUp();
- }
-
/**
* Test that the upgrade task changes the direction but only
* for bidirectional relationship types that are b_a.
*/
class CRM_Utils_Cache_SqlGroupTest extends CiviUnitTestCase {
- public function setUp() {
- parent::setUp();
- }
-
- public function tearDown() {
- parent::tearDown();
- }
-
/**
* Add and remove two items from the same cache instance.
*/
*/
class CRM_Utils_DateTest extends CiviUnitTestCase {
- public function setUp() {
- // There are only unit tests here at present, we can skip database loading.
- return TRUE;
- }
-
- public function tearDown() {
- // There are only unit tests here at present, we can skip database loading.
- return TRUE;
- }
-
/**
* Used by testGetFromTo
*/
* @group headless
*/
class CRM_Utils_Migrate_ImportExportTest extends CiviUnitTestCase {
- protected $_apiversion;
-
- public function setUp() {
- $this->_apiversion = 3;
- parent::setUp();
- }
public function tearDown(): void {
$tablesToTruncate = [
*/
class SequenceListenerTest extends \CiviCaseTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->_params = [
'case_type' => $this->caseType,
protected $_loggedInUser;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
// CRM-9404 - set-up is a bit cumbersome but had to put something in place to set up activity types & case types
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
- public function tearDown() {
+ public function tearDown(): void {
$this->quickCleanup($this->tablesToTruncate, TRUE);
$this->customDirectories(array('template_path' => FALSE));
CRM_Case_XMLRepository::singleton(TRUE);
*/
class CiviReportTestCase extends CiviUnitTestCase {
- public function setUp() {
- parent::setUp();
- $this->_sethtmlGlobals();
- }
-
- public function tearDown() {
+ public function tearDown(): void {
// TODO Figure out how to automatically drop all temporary tables.
// Note that MySQL doesn't provide a way to list them, so we would need
// to keep track ourselves (eg CRM_Core_TemporaryTableManager) or reset
/**
* Common teardown functions for all unit tests.
*/
- protected function tearDown() {
+ protected function tearDown(): void {
$this->_apiversion = 3;
$this->resetLabels();
*/
protected $b;
- protected function tearDown() {
+ protected function tearDown(): void {
if (function_exists('timecop_return')) {
timecop_return();
}
$this->a = $this->b = NULL;
}
- protected function tearDown() {
+ protected function tearDown(): void {
parent::tearDown();
if ($this->a) {
$this->a->clear();
);
}
- protected function tearDown() {
+ protected function tearDown(): void {
\Civi::service('prevnext')->deleteItem(NULL, $this->cacheKey);
\Civi::service('prevnext')->deleteItem(NULL, $this->cacheKeyB);
}
*/
class E2E_Extern_CliRunnerTest extends CiviEndToEndTestCase {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
foreach (['CIVI_CORE', 'CMS_ROOT', 'CMS_URL'] as $var) {
}
}
- protected function tearDown() {
- parent::tearDown();
- }
-
/**
* @return array
* Each case gives a name (eg "cv") and template for executing the command
//$this->assertEquals($cmpvar, $apiResult['is_error'], $prefix . print_r($apiResult, TRUE));
}
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
if (empty($GLOBALS['_CV']['CIVI_SITE_KEY'])) {
->getUrl('civicrm', 'extern/rest.php');
}
- protected function tearDown() {
+ protected function tearDown(): void {
if (!empty($this->old_api_keys)) {
foreach ($this->old_api_keys as $cid => $apiKey) {
civicrm_api3('Contact', 'create', array(
*/
protected $footer;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction();
// DGW
public $DBResetRequired = FALSE;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
public $DBResetRequired = FALSE;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
protected $_membershipStatusID;
protected $_contribution = [];
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
protected $_apiversion = 3;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->_contactID = $this->individualCreate();
$this->_membershipTypeID = $this->membershipTypeCreate(['member_of_contact_id' => $this->_contactID]);
/**
* Set up for tests.
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->_contactID = $this->individualCreate();
$this->_membershipTypeID = $this->membershipTypeCreate(['member_of_contact_id' => $this->_contactID]);
/**
* Set up for tests.
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
$this->_contactID = $this->organizationCreate();
protected $entity = 'MessageTemplate';
protected $params;
- public function setUp() {
+ public function setUp(): void {
$this->_apiversion = 3;
parent::setUp();
$this->useTransaction(TRUE);
*
* This method is called before a test is executed.
*/
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
}
protected $_noteID;
protected $_note;
- public function setUp() {
+ public function setUp(): void {
// Connect to the database.
parent::setUp();
public $DBResetRequired = FALSE;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction();
protected $_entity = 'OptionGroup';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
$this->_params = [
class api_v3_OptionValueTest extends CiviUnitTestCase {
protected $_apiversion = 3;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
}
*
* @throws \CRM_Core_Exception
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->_apiversion = 3;
/**
* Set up for tests.
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
$event = $this->eventCreate(NULL);
public $DBResetRequired = FALSE;
- public function setUp() {
+ public function setUp(): void {
$this->_apiversion = 3;
$this->params = [
'name' => 'test status',
protected $_individualId;
protected $_params;
- public function setUp() {
+ public function setUp(): void {
$this->_apiversion = 3;
parent::setUp();
$this->_entity = 'participant';
*
* @throws \CRM_Core_Exception
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
// Create dummy processor
class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase {
protected $_ppTypeID;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
*
* @throws \CRM_Core_Exception
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->_apiversion = 3;
public $DBResetRequired = FALSE;
- public function setUp() {
+ public function setUp(): void {
$this->_apiversion = 3;
$this->useTransaction(TRUE);
parent::setUp();
protected $entity = 'Pcp';
public $DBResetRequired = TRUE;
- public function setUp() {
+ public function setUp(): void {
$this->params = [
'title' => "Pcp title",
'contact_id' => 1,
*/
protected $isLocationTypesOnPostAssert = TRUE;
- public function setUp() {
+ public function setUp(): void {
$this->_entity = 'Phone';
parent::setUp();
$this->useTransaction();
*
* @throws \CRM_Core_Exception
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->_individualId = $this->individualCreate();
$this->_pledgeID = $this->pledgeCreate(['contact_id' => $this->_individualId]);
/**
* @throws \CRM_Core_Exception
*/
- public function setUp() {
+ public function setUp(): void {
$this->_apiversion = 3;
parent::setUp();
$this->quickCleanup(['civicrm_pledge', 'civicrm_pledge_payment']);
*
* @throws \CRM_Core_Exception
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$priceSetparams = [
'name' => 'default_goat_priceset',
/**
* Setup function.
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
// Put stuff here that should happen before all tests in this unit.
$priceSetParams = [
/**
* Set up for class.
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->_params = [
'name' => 'default_goat_priceset',
protected $_entity = 'Product';
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction();
$this->_params = [
/**
* Set up for test.
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$config = CRM_Core_Config::singleton();
$countryLimit = $config->countryLimit;
/**
* Set up function.
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->_cId_a = $this->individualCreate();
$this->_cId_a_2 = $this->individualCreate([
protected $_relTypeID;
protected $_apiversion = 3;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->_cId_a = $this->individualCreate();
private $hookEntity;
private $hookCondition = [];
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
CRM_Utils_Hook::singleton()->setHook('civicrm_selectWhereClause', [$this, 'hook_civicrm_selectWhereClause']);
protected $_domainID2;
protected $_domainID3;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$params = [
'name' => __CLASS__ . 'Second Domain',
class api_v3_StateProvinceTest extends CiviUnitTestCase {
protected $_params;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
$this->_params = [
protected $_locationType;
protected $_params;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
$this->_params = [
protected $_apiversion = 3;
protected $params;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
$phoneBankActivity = $this->callAPISuccess('Option_value', 'Get', ['label' => 'PhoneBank', 'sequential' => 1]);
protected $entity = 'survey';
public $DBResetRequired = FALSE;
- public function setUp() {
+ public function setUp(): void {
$phoneBankActivityTypeID = $this->callAPISuccessGetValue('Option_value', [
'label' => 'PhoneBank',
'return' => 'value',
* and that will never exist (eg an obsoleted Entity
* they need to be returned by the function toBeSkipped_{$action} (because it has to be a static method and therefore couldn't access a this->toBeSkipped)
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->enableCiviCampaign();
$this->toBeImplemented['get'] = [
*/
class api_v3_SystemCheckTest extends CiviUnitTestCase {
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
}
*
* This method is called before a test is executed.
*/
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
}
protected $tagID;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
$this->tag = $this->tagCreate();
protected $halfFinancialAccId;
protected $halfFinancialTypeId;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->_individualId = $this->individualCreate();
$this->_orgId = $this->organizationCreate(NULL);
*
* @throws \Exception
*/
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->quickCleanup(
[
protected $_groupId;
protected $params;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->_groupId = $this->groupCreate();
$this->_contactId = $this->individualCreate();
protected $_ufFieldId;
protected $_contactId = 69;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
// Truncate the tables
$this->quickCleanup(
protected $_contactId;
protected $_params = [];
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->quickCleanup(
[
public $DBResetRequired = FALSE;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->contactID = $this->createLoggedInUser();
$this->params = [
*
* This method is called before a test is executed.
*/
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
}
/**
* This method is called before a test is executed.
*/
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
}
public $DBResetRequired = FALSE;
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->useTransaction();