/**
* The setup() method is executed before the test is executed (optional).
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
CRM_Core_Config::singleton()->userPermissionTemp = new CRM_Core_Permission_Temp();
CRM_Core_Config::singleton()->userPermissionTemp->grant('administer CiviCRM');
}
- /**
- * The tearDown() method is executed after the test was executed (optional)
- * This can be used for cleanup.
- */
- public function tearDown() {
- parent::tearDown();
- }
-
}
/**
* Set up function.
*/
- public function setUp() {
+ public function setUp(): void {
parent::setUp();
$this->_paymentProcessorID = $this->paymentProcessorCreate(['is_test' => 0, 'payment_processor_type_id' => 'PayPal_Standard']);
$this->_contactID = $this->individualCreate();
/**
* Tear down function.
*/
- public function tearDown() {
+ public function tearDown(): void {
$this->quickCleanUpFinancialEntities();
parent::tearDown();
}
*/
class CRM_Event_BAO_ParticipantStatusTest 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() {
- }
-
/**
* create() and deleteParticipantStatusType() method
*/
*/
class CRM_Utils_versionCheckTest extends CiviUnitTestCase {
- public function setUp() {
- parent::setUp();
- }
-
/**
* @var array
*/
],
];
- public function tearDown() {
+ public function tearDown(): void {
parent::tearDown();
$vc = new CRM_Utils_VersionCheck();
if (file_exists($vc->cacheFile)) {
$this->mandates = [];
}
- public function tearDown() {
+ public function tearDown(): void {
$GLOBALS['civicrm_setting'] = $this->origSetting;
parent::tearDown();
}
class GenericHookEventTest extends \CiviUnitTestCase {
- public function tearDown() {
+ public function tearDown(): void {
\CRM_Utils_Hook::singleton()->reset();
parent::tearDown();
}
$this->mandates = [];
}
- public function tearDown() {
+ public function tearDown(): void {
$GLOBALS['civicrm_setting'] = $this->origSetting;
parent::tearDown();
}
];
}
- public function tearDown() {
+ public function tearDown(): void {
$GLOBALS['civicrm_setting'] = $this->origSetting;
parent::tearDown();
}
class SettingsStackTest extends \CiviUnitTestCase {
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->useTransaction(TRUE);
}
- public function tearDown() {
- parent::tearDown();
- }
-
/**
* Temporarily modify -- then restore -- settings.
*/
return \Civi\Test::headless()->apply();
}
- protected function setUp() {
+ protected function setUp(): void {
$this->contact = \CRM_Core_DAO::createTestObject('CRM_Contact_DAO_Contact', [
'contact_type' => 'Individual',
]);
$session->set('userID', $this->contact->id);
}
- protected function tearDown() {
+ protected function tearDown(): void {
$this->contact->delete();
}
return \Civi\Test::headless()->apply();
}
- protected function setUp() {
+ protected function setUp(): void {
/** @var \CRM_Contact_DAO_Contact $contact */
$contact = \CRM_Core_DAO::createTestObject('CRM_Contact_DAO_Contact', [
'contact_type' => 'Individual',
$this->assertTrue((bool) $dao->find());
}
- public function tearDown() {
- }
-
/**
* Both testDummy1 and testDummy2 have been created at some point (as part of the test runs),
* but all the data was rolled-back
*/
class ChainTest extends UnitTestCase {
- public function tearDown() {
- $result = CustomField::delete()
+ public function tearDown(): void {
+ CustomField::delete()
->setCheckPermissions(FALSE)
->addWhere('name', '=', 'FavPerson')
->addChain('group', CustomGroup::delete()->addWhere('name', '=', 'TestActCus'))
return parent::setUpHeadless();
}
- public function tearDown() {
+ public function tearDown(): void {
$relatedTables = [
'civicrm_activity',
'civicrm_phone',
$this->optionValueMaxId = \CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_option_value');
}
- public function tearDown() {
+ public function tearDown(): void {
if ($this->optionValueMaxId) {
\CRM_Core_DAO::executeQuery('DELETE FROM civicrm_option_value WHERE id > ' . $this->optionValueMaxId);
}
return \Civi\Test::headless()->apply();
}
- /**
- * Tears down the fixture, for example, closes a network connection.
- *
- * This method is called after a test is executed.
- */
- public function tearDown() {
- parent::tearDown();
- }
-
/**
* Quick clean by emptying tables created for the test.
*