From: eileen Date: Thu, 25 Mar 2021 09:58:22 +0000 (+1300) Subject: [PHPunit8] cleanup on tearDown functions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=faba14574defd1a42ee8b8859821764bf1535c1f;p=civicrm-core.git [PHPunit8] cleanup on tearDown functions --- diff --git a/tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php b/tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php index 82506da86e..69bfc6a5ce 100644 --- a/tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php +++ b/tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php @@ -19,15 +19,6 @@ class CRM_Contact_BAO_SavedSearchTest extends CiviUnitTestCase { use CRMTraits_Custom_CustomDataTrait; - /** - * 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. * diff --git a/tests/phpunit/CRM/Contact/Form/Task/DeleteTest.php b/tests/phpunit/CRM/Contact/Form/Task/DeleteTest.php index 1dca40edfa..07e48e9cf1 100644 --- a/tests/phpunit/CRM/Contact/Form/Task/DeleteTest.php +++ b/tests/phpunit/CRM/Contact/Form/Task/DeleteTest.php @@ -20,7 +20,7 @@ class CRM_Contact_Form_Task_DeleteTest extends CiviUnitTestCase { */ protected $deleted_contact_id; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->deleted_contact_id = $this->individualCreate([ 'first_name' => 'Delete', diff --git a/tests/phpunit/CRM/Contact/Form/Task/EmailCommonTest.php b/tests/phpunit/CRM/Contact/Form/Task/EmailCommonTest.php index 1533229d38..30e498db1b 100644 --- a/tests/phpunit/CRM/Contact/Form/Task/EmailCommonTest.php +++ b/tests/phpunit/CRM/Contact/Form/Task/EmailCommonTest.php @@ -22,7 +22,7 @@ class CRM_Contact_Form_Task_EmailCommonTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->_contactIds = [ $this->individualCreate(['first_name' => 'Antonia', 'last_name' => 'D`souza']), diff --git a/tests/phpunit/CRM/Contact/Form/Task/PrintDocumentTest.php b/tests/phpunit/CRM/Contact/Form/Task/PrintDocumentTest.php index b8a1e274ef..6bc73a8323 100644 --- a/tests/phpunit/CRM/Contact/Form/Task/PrintDocumentTest.php +++ b/tests/phpunit/CRM/Contact/Form/Task/PrintDocumentTest.php @@ -19,7 +19,7 @@ class CRM_Contact_Form_Task_PrintDocumentTest extends CiviUnitTestCase { protected $_contactIds = NULL; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->_contactIds = [ $this->individualCreate(['first_name' => 'Antonia', 'last_name' => 'D`souza']), diff --git a/tests/phpunit/CRM/Contact/Form/Task/PrintMailingLabelTest.php b/tests/phpunit/CRM/Contact/Form/Task/PrintMailingLabelTest.php index 414fc6bf7b..ec01cae8b1 100644 --- a/tests/phpunit/CRM/Contact/Form/Task/PrintMailingLabelTest.php +++ b/tests/phpunit/CRM/Contact/Form/Task/PrintMailingLabelTest.php @@ -17,7 +17,7 @@ class CRM_Contact_Form_Task_PrintMailingLabelTest extends CiviUnitTestCase { protected $_contactIds; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->_contactIds = [ $this->individualCreate(['first_name' => 'Antonia', 'last_name' => 'D`souza']), diff --git a/tests/phpunit/CRM/Contact/Form/Task/SMSCommonTest.php b/tests/phpunit/CRM/Contact/Form/Task/SMSCommonTest.php index edf9058b05..d475141f05 100644 --- a/tests/phpunit/CRM/Contact/Form/Task/SMSCommonTest.php +++ b/tests/phpunit/CRM/Contact/Form/Task/SMSCommonTest.php @@ -22,7 +22,7 @@ class CRM_Contact_Form_Task_SMSCommonTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $mobile_type_id = CRM_Core_PseudoConstant::getKey('CRM_Core_DAO_Phone', 'phone_type_id', 'Mobile'); $phone_type_id = CRM_Core_PseudoConstant::getKey('CRM_Core_DAO_Phone', 'phone_type_id', 'Phone'); diff --git a/tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php b/tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php index 1378e4f6bd..7417b45df6 100644 --- a/tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php +++ b/tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php @@ -30,13 +30,6 @@ class CRM_Contact_Import_Parser_ContactTest extends CiviUnitTestCase { */ protected $entity = 'Contact'; - /** - * Setup function. - */ - public function setUp() { - parent::setUp(); - } - /** * Tear down after test. * diff --git a/tests/phpunit/CRM/Contact/Page/AjaxTest.php b/tests/phpunit/CRM/Contact/Page/AjaxTest.php index e7e700ac22..6c6ce05fc0 100644 --- a/tests/phpunit/CRM/Contact/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Contact/Page/AjaxTest.php @@ -14,7 +14,7 @@ class CRM_Contact_Page_AjaxTest extends CiviUnitTestCase { */ protected $originalRequest = []; - public function setUp() { + public function setUp(): void { $this->useTransaction(TRUE); parent::setUp(); $this->originalRequest = $_REQUEST; diff --git a/tests/phpunit/CRM/Contact/Page/DedupeExceptionTest.php b/tests/phpunit/CRM/Contact/Page/DedupeExceptionTest.php index 537a4ed163..1e9fd053e6 100644 --- a/tests/phpunit/CRM/Contact/Page/DedupeExceptionTest.php +++ b/tests/phpunit/CRM/Contact/Page/DedupeExceptionTest.php @@ -17,23 +17,6 @@ */ class CRM_Contact_Page_DedupeExceptionTest 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(): void { - parent::tearDown(); - } - public function testGetDedupeExceptions() { $contact1 = $this->individualCreate(); $contact2 = $this->individualCreate(); diff --git a/tests/phpunit/CRM/Contact/Page/View/NoteTest.php b/tests/phpunit/CRM/Contact/Page/View/NoteTest.php index 3ce4e7ee1a..c8bb6bc5ff 100644 --- a/tests/phpunit/CRM/Contact/Page/View/NoteTest.php +++ b/tests/phpunit/CRM/Contact/Page/View/NoteTest.php @@ -18,23 +18,6 @@ */ class CRM_Contact_Page_View_NoteTest 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(): void { - parent::tearDown(); - } - public function testNoContactIdNote() { $contactId = $this->individualCreate(); foreach ([1, 2, 3, 4, 5] as $noteID) { diff --git a/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php b/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php index dc5e8260fd..9d0abd2433 100644 --- a/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php +++ b/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php @@ -36,7 +36,7 @@ class CRM_Contact_Page_View_UserDashBoardTest extends CiviUnitTestCase { /** * Prepare for test */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->contactID = $this->createLoggedInUser(); $this->listenForPageContent(); diff --git a/tests/phpunit/CRM/Contact/Page/View/UserDashboard/GroupContactTest.php b/tests/phpunit/CRM/Contact/Page/View/UserDashboard/GroupContactTest.php index 0132c80925..8ecacf1908 100644 --- a/tests/phpunit/CRM/Contact/Page/View/UserDashboard/GroupContactTest.php +++ b/tests/phpunit/CRM/Contact/Page/View/UserDashboard/GroupContactTest.php @@ -17,23 +17,6 @@ */ class CRM_Contact_Page_View_UserDashboard_GroupContactTest 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(): void { - parent::tearDown(); - } - /** * Test that the list of the contact's joined groups, on the Contact Dashboard, * contains the correct groups. diff --git a/tests/phpunit/CRM/Contribute/Form/AdditionalPaymentTest.php b/tests/phpunit/CRM/Contribute/Form/AdditionalPaymentTest.php index e6d705aa91..229317008a 100644 --- a/tests/phpunit/CRM/Contribute/Form/AdditionalPaymentTest.php +++ b/tests/phpunit/CRM/Contribute/Form/AdditionalPaymentTest.php @@ -73,7 +73,7 @@ class CRM_Contribute_Form_AdditionalPaymentTest extends CiviUnitTestCase { * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->createLoggedInUser(); diff --git a/tests/phpunit/CRM/Contribute/Form/ContributionPageTranslationTest.php b/tests/phpunit/CRM/Contribute/Form/ContributionPageTranslationTest.php index 08df74f310..8bd9015a1d 100644 --- a/tests/phpunit/CRM/Contribute/Form/ContributionPageTranslationTest.php +++ b/tests/phpunit/CRM/Contribute/Form/ContributionPageTranslationTest.php @@ -16,7 +16,7 @@ */ class CRM_Contribute_Form_ContributionPageTranslationTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_financialTypeID = 1; $this->enableMultilingual(); diff --git a/tests/phpunit/CRM/Contribute/Form/ContributionTest.php b/tests/phpunit/CRM/Contribute/Form/ContributionTest.php index 3d66b71ec7..b8b4fdee76 100644 --- a/tests/phpunit/CRM/Contribute/Form/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/Form/ContributionTest.php @@ -76,7 +76,7 @@ class CRM_Contribute_Form_ContributionTest extends CiviUnitTestCase { * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public function setUp() { + public function setUp(): void { $this->_apiversion = 3; parent::setUp(); $this->_userId = $this->createLoggedInUser(); diff --git a/tests/phpunit/CRM/Contribute/Form/SearchTest.php b/tests/phpunit/CRM/Contribute/Form/SearchTest.php index dd1291a7e2..efcf948ef2 100644 --- a/tests/phpunit/CRM/Contribute/Form/SearchTest.php +++ b/tests/phpunit/CRM/Contribute/Form/SearchTest.php @@ -23,7 +23,7 @@ class CRM_Contribute_Form_SearchTest extends CiviUnitTestCase { protected $_individual; protected $_tablesToTruncate = ['civicrm_contribution', 'civicrm_line_item']; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_individual = $this->individualCreate(); $this->ids['Contact']['contactID1'] = $this->individualCreate([], 1); diff --git a/tests/phpunit/CRM/Contribute/Page/AjaxTest.php b/tests/phpunit/CRM/Contribute/Page/AjaxTest.php index 8f75accb32..a02caed346 100644 --- a/tests/phpunit/CRM/Contribute/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Contribute/Page/AjaxTest.php @@ -17,7 +17,7 @@ class CRM_Contribute_Page_AjaxTest extends CiviUnitTestCase { protected $_params = []; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_fields = ['amount', 'sct_label']; diff --git a/tests/phpunit/CRM/Core/BAO/AddressTest.php b/tests/phpunit/CRM/Core/BAO/AddressTest.php index 5dbf73569a..9e83ad065f 100644 --- a/tests/phpunit/CRM/Core/BAO/AddressTest.php +++ b/tests/phpunit/CRM/Core/BAO/AddressTest.php @@ -17,7 +17,7 @@ class CRM_Core_BAO_AddressTest extends CiviUnitTestCase { use CRMTraits_Custom_CustomDataTrait; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->quickCleanup(['civicrm_contact', 'civicrm_address']); diff --git a/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php b/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php index 7ca1f454c3..6fe0155876 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php @@ -15,10 +15,6 @@ */ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - /** * Test getTree(). */ diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTableMultipleTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTableMultipleTest.php index bd60364d02..21a283af9a 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTableMultipleTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTableMultipleTest.php @@ -6,11 +6,7 @@ */ class CRM_Core_BAO_CustomValueTableMultipleTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - - public function testCustomGroupMultipleSingle() { + public function testCustomGroupMultipleSingle(): void { $contactID = $this->individualCreate(); $customGroup = $this->customGroupCreate(['is_multiple' => 1]); $fields = [ diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php index cd04a2e05a..ace9d63b42 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php @@ -6,10 +6,6 @@ */ class CRM_Core_BAO_CustomValueTableSetGetTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - /** * Test setValues() and GetValues() methods with custom Date field * diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php index a4d51bdc0f..c27ac83d87 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php @@ -6,10 +6,6 @@ */ class CRM_Core_BAO_CustomValueTableTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - /** * Test store function for country. */ diff --git a/tests/phpunit/CRM/Core/BAO/EmailTest.php b/tests/phpunit/CRM/Core/BAO/EmailTest.php index 3c0f4f6182..2647007c64 100644 --- a/tests/phpunit/CRM/Core/BAO/EmailTest.php +++ b/tests/phpunit/CRM/Core/BAO/EmailTest.php @@ -11,7 +11,7 @@ class CRM_Core_BAO_EmailTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->quickCleanup(['civicrm_contact', 'civicrm_email']); } diff --git a/tests/phpunit/CRM/Core/BAO/FinancialTrxnTest.php b/tests/phpunit/CRM/Core/BAO/FinancialTrxnTest.php index 3c414a6315..178a46dba5 100644 --- a/tests/phpunit/CRM/Core/BAO/FinancialTrxnTest.php +++ b/tests/phpunit/CRM/Core/BAO/FinancialTrxnTest.php @@ -15,10 +15,6 @@ */ class CRM_Core_BAO_FinancialTrxnTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - /** * Check method create(). * diff --git a/tests/phpunit/CRM/Core/BAO/IMTest.php b/tests/phpunit/CRM/Core/BAO/IMTest.php index 5847ab1b5d..9b56f1568f 100644 --- a/tests/phpunit/CRM/Core/BAO/IMTest.php +++ b/tests/phpunit/CRM/Core/BAO/IMTest.php @@ -8,10 +8,6 @@ use Civi\Api4\IM; */ class CRM_Core_BAO_IMTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - /** * Create() method (create and update modes) */ diff --git a/tests/phpunit/CRM/Core/BAO/LocationTest.php b/tests/phpunit/CRM/Core/BAO/LocationTest.php index 26cceaa8f6..292d398a36 100644 --- a/tests/phpunit/CRM/Core/BAO/LocationTest.php +++ b/tests/phpunit/CRM/Core/BAO/LocationTest.php @@ -21,7 +21,7 @@ */ class CRM_Core_BAO_LocationTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->quickCleanup([ diff --git a/tests/phpunit/CRM/Core/BAO/NavigationTest.php b/tests/phpunit/CRM/Core/BAO/NavigationTest.php index 5b16491b17..86eb651744 100644 --- a/tests/phpunit/CRM/Core/BAO/NavigationTest.php +++ b/tests/phpunit/CRM/Core/BAO/NavigationTest.php @@ -11,7 +11,7 @@ class CRM_Core_BAO_NavigationTest extends CiviUnitTestCase { * * Here we ensure we are starting from a default report navigation. */ - public function setUp() { + public function setUp(): void { parent::setUp(); CRM_Core_BAO_Navigation::rebuildReportsNavigation(CRM_Core_Config::domainID()); } diff --git a/tests/phpunit/CRM/Core/BAO/OptionGroupTest.php b/tests/phpunit/CRM/Core/BAO/OptionGroupTest.php index ee2d706b81..ef9d7d5d52 100644 --- a/tests/phpunit/CRM/Core/BAO/OptionGroupTest.php +++ b/tests/phpunit/CRM/Core/BAO/OptionGroupTest.php @@ -21,7 +21,7 @@ class CRM_Core_BAO_OptionGroupTest extends CiviUnitTestCase { /** * Test setup for every test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); } diff --git a/tests/phpunit/CRM/Core/BAO/OptionValueTest.php b/tests/phpunit/CRM/Core/BAO/OptionValueTest.php index ab81de61de..2123167af9 100644 --- a/tests/phpunit/CRM/Core/BAO/OptionValueTest.php +++ b/tests/phpunit/CRM/Core/BAO/OptionValueTest.php @@ -21,7 +21,7 @@ class CRM_Core_BAO_OptionValueTest extends CiviUnitTestCase { /** * Test setup for every test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); } diff --git a/tests/phpunit/CRM/Core/BAO/PhoneTest.php b/tests/phpunit/CRM/Core/BAO/PhoneTest.php index bd6beca1e7..8f0c37d9aa 100644 --- a/tests/phpunit/CRM/Core/BAO/PhoneTest.php +++ b/tests/phpunit/CRM/Core/BAO/PhoneTest.php @@ -15,10 +15,6 @@ */ class CRM_Core_BAO_PhoneTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - /** * Add() method (create and update modes) */ diff --git a/tests/phpunit/CRM/Core/BAO/PreferencesTest.php b/tests/phpunit/CRM/Core/BAO/PreferencesTest.php index 0e804e37a2..56ed1cf814 100644 --- a/tests/phpunit/CRM/Core/BAO/PreferencesTest.php +++ b/tests/phpunit/CRM/Core/BAO/PreferencesTest.php @@ -15,10 +15,6 @@ */ class CRM_Core_BAO_PreferencesTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - public function testValueOptions() { $addressOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, diff --git a/tests/phpunit/CRM/Core/BAO/SettingTest.php b/tests/phpunit/CRM/Core/BAO/SettingTest.php index 27e3820238..33162f5b5e 100644 --- a/tests/phpunit/CRM/Core/BAO/SettingTest.php +++ b/tests/phpunit/CRM/Core/BAO/SettingTest.php @@ -21,7 +21,7 @@ class CRM_Core_BAO_SettingTest extends CiviUnitTestCase { */ private $origSetting; - public function setUp() { + public function setUp(): void { parent::setUp(); global $civicrm_setting; $this->origSetting = $civicrm_setting; diff --git a/tests/phpunit/CRM/Core/BAO/UFFieldTest.php b/tests/phpunit/CRM/Core/BAO/UFFieldTest.php index 1cafb95c0e..61814f004e 100644 --- a/tests/phpunit/CRM/Core/BAO/UFFieldTest.php +++ b/tests/phpunit/CRM/Core/BAO/UFFieldTest.php @@ -6,7 +6,7 @@ */ class CRM_Core_BAO_UFFieldTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->quickCleanup(['civicrm_uf_group', 'civicrm_uf_field']); diff --git a/tests/phpunit/CRM/Core/CommunityMessagesTest.php b/tests/phpunit/CRM/Core/CommunityMessagesTest.php index 8edeed810e..58af475f17 100644 --- a/tests/phpunit/CRM/Core/CommunityMessagesTest.php +++ b/tests/phpunit/CRM/Core/CommunityMessagesTest.php @@ -123,7 +123,7 @@ class CRM_Core_CommunityMessagesTest extends CiviUnitTestCase { return self::$webResponses; } - public function setUp() { + public function setUp(): void { parent::setUp(); $this->cache = new CRM_Utils_Cache_Arraycache([]); self::initWebResponses(); diff --git a/tests/phpunit/CRM/Core/Config/MailerTest.php b/tests/phpunit/CRM/Core/Config/MailerTest.php index 43c819117c..9f24e4ae32 100644 --- a/tests/phpunit/CRM/Core/Config/MailerTest.php +++ b/tests/phpunit/CRM/Core/Config/MailerTest.php @@ -30,7 +30,7 @@ class CRM_Core_Config_MailerTest extends CiviUnitTestCase { */ public $calls; - public function setUp() { + public function setUp(): void { $this->calls = [ 'civicrm_alterMailer' => 0, 'send' => 0, diff --git a/tests/phpunit/CRM/Core/ErrorTest.php b/tests/phpunit/CRM/Core/ErrorTest.php index c744470213..9b79e319f0 100644 --- a/tests/phpunit/CRM/Core/ErrorTest.php +++ b/tests/phpunit/CRM/Core/ErrorTest.php @@ -15,7 +15,7 @@ */ class CRM_Core_ErrorTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $config = CRM_Core_Config::singleton(); $this->oldConfigAndLogDir = $config->configAndLogDir; diff --git a/tests/phpunit/CRM/Core/FieldOptionsTest.php b/tests/phpunit/CRM/Core/FieldOptionsTest.php index f8d4c4009e..32b80f46fb 100644 --- a/tests/phpunit/CRM/Core/FieldOptionsTest.php +++ b/tests/phpunit/CRM/Core/FieldOptionsTest.php @@ -30,7 +30,7 @@ class CRM_Core_FieldOptionsTest extends CiviUnitTestCase { */ public $targetField; - public function setUp() { + public function setUp(): void { parent::setUp(); CRM_Utils_Hook::singleton()->setHook('civicrm_fieldOptions', [$this, 'hook_civicrm_fieldOptions']); } diff --git a/tests/phpunit/CRM/Core/I18n/SchemaTest.php b/tests/phpunit/CRM/Core/I18n/SchemaTest.php index d7d7b8c5cd..aea4383b16 100644 --- a/tests/phpunit/CRM/Core/I18n/SchemaTest.php +++ b/tests/phpunit/CRM/Core/I18n/SchemaTest.php @@ -26,7 +26,7 @@ class CRM_Core_I18n_SchemaTest extends CiviUnitTestCase { return $tables; } - public function setUp() { + public function setUp(): void { parent::setUp(); } diff --git a/tests/phpunit/CRM/Core/JobManagerTest.php b/tests/phpunit/CRM/Core/JobManagerTest.php index f2d8077b5d..d8f910e836 100644 --- a/tests/phpunit/CRM/Core/JobManagerTest.php +++ b/tests/phpunit/CRM/Core/JobManagerTest.php @@ -15,10 +15,6 @@ */ class CRM_Core_JobManagerTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - public function testHookCron() { $hook = $this->getMockBuilder(stdClass::class) ->setMethods(['civicrm_cron']) diff --git a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php index 8468b8fae2..2a0b640efa 100644 --- a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php +++ b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php @@ -22,7 +22,7 @@ class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase { protected $fixtures; - public function setUp() { + public function setUp(): void { $this->useTransaction(TRUE); parent::setUp(); $this->modules = [ diff --git a/tests/phpunit/CRM/Core/OptionGroupTest.php b/tests/phpunit/CRM/Core/OptionGroupTest.php index 81778ef2d7..5c3295b626 100644 --- a/tests/phpunit/CRM/Core/OptionGroupTest.php +++ b/tests/phpunit/CRM/Core/OptionGroupTest.php @@ -18,7 +18,7 @@ class CRM_Core_OptionGroupTest extends CiviUnitTestCase { /** * Test setup for every test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); } diff --git a/tests/phpunit/CRM/Core/Page/HookTest.php b/tests/phpunit/CRM/Core/Page/HookTest.php index d6168763a1..5c0e548e4e 100644 --- a/tests/phpunit/CRM/Core/Page/HookTest.php +++ b/tests/phpunit/CRM/Core/Page/HookTest.php @@ -47,7 +47,7 @@ class CRM_Core_Page_HookTest extends CiviUnitTestCase { /** * Set up the list of pages to evaluate by going through the menu. */ - public function setUp() { + public function setUp(): void { // Get all of the menu items in CiviCRM. $items = CRM_Core_Menu::items(TRUE); // Check if they extend the class we care about; test if needed. diff --git a/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php b/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php index ed1bfcf702..1c074d9f5e 100644 --- a/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php @@ -22,7 +22,7 @@ class CRM_Core_Payment_AuthorizeNetIPNTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_paymentProcessorID = $this->paymentProcessorAuthorizeNetCreate(['is_test' => 0]); $this->_contactID = $this->individualCreate(); diff --git a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php index 94ec92778f..488ee868d0 100644 --- a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php +++ b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php @@ -19,7 +19,7 @@ class CRM_Core_Payment_AuthorizeNetTest extends CiviUnitTestCase { use CRM_Core_Payment_AuthorizeNetTrait; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_paymentProcessorID = $this->paymentProcessorAuthorizeNetCreate(); diff --git a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php index 6ea7622e3f..48c4997556 100644 --- a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php @@ -61,7 +61,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { /** * Setup function. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_processorId = $this->paymentProcessorAuthorizeNetCreate(['is_test' => 0]); $this->input = $this->ids = $this->objects = []; diff --git a/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php b/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php index d5ee6ce621..57d9e4d209 100644 --- a/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php @@ -31,7 +31,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { /** * Set up function. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_paymentProcessorID = $this->paymentProcessorCreate(['is_test' => 0]); $this->_contactID = $this->individualCreate(); diff --git a/tests/phpunit/CRM/Core/Payment/PaypalProTest.php b/tests/phpunit/CRM/Core/Payment/PaypalProTest.php index f4be1f1275..94e3196ff5 100644 --- a/tests/phpunit/CRM/Core/Payment/PaypalProTest.php +++ b/tests/phpunit/CRM/Core/Payment/PaypalProTest.php @@ -20,7 +20,7 @@ class CRM_Core_Payment_PaypalProTest extends CiviUnitTestCase { /** * @throws \CiviCRM_API3_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->createPaypalProProcessor(); diff --git a/tests/phpunit/CRM/Core/Payment/PaypalStdTest.php b/tests/phpunit/CRM/Core/Payment/PaypalStdTest.php index 7b9335590a..1f2689bace 100644 --- a/tests/phpunit/CRM/Core/Payment/PaypalStdTest.php +++ b/tests/phpunit/CRM/Core/Payment/PaypalStdTest.php @@ -23,7 +23,7 @@ class CRM_Core_Payment_PaypalStdTest extends CiviUnitTestCase { /** * @throws \CiviCRM_API3_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $processorID = $this->processorCreate([ 'payment_processor_type_id' => 'PayPal_Standard', diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index 36a1dc33b7..ff58d66412 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -15,7 +15,7 @@ */ class CRM_Core_PseudoConstantTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->loadAllFixtures(); diff --git a/tests/phpunit/CRM/Core/RegionTest.php b/tests/phpunit/CRM/Core/RegionTest.php index 9f1d628317..e11dc213c5 100644 --- a/tests/phpunit/CRM/Core/RegionTest.php +++ b/tests/phpunit/CRM/Core/RegionTest.php @@ -7,7 +7,7 @@ */ class CRM_Core_RegionTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); // Templates injected into regions should normally be file names, but for unit-testing it's handy to use "string:" notation diff --git a/tests/phpunit/CRM/Core/SessionTest.php b/tests/phpunit/CRM/Core/SessionTest.php index 16588876aa..60c165417d 100644 --- a/tests/phpunit/CRM/Core/SessionTest.php +++ b/tests/phpunit/CRM/Core/SessionTest.php @@ -6,7 +6,7 @@ */ class CRM_Core_SessionTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { CRM_Core_Smarty::singleton()->clearTemplateVars(); } diff --git a/tests/phpunit/CRM/Core/Smarty/plugins/CrmMoneyTest.php b/tests/phpunit/CRM/Core/Smarty/plugins/CrmMoneyTest.php index e2e2e6a40a..c170adcb55 100644 --- a/tests/phpunit/CRM/Core/Smarty/plugins/CrmMoneyTest.php +++ b/tests/phpunit/CRM/Core/Smarty/plugins/CrmMoneyTest.php @@ -6,7 +6,7 @@ */ class CRM_Core_Smarty_plugins_CrmMoneyTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); require_once 'CRM/Core/Smarty.php'; diff --git a/tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php b/tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php index e5da6d0ec3..40184d79d1 100644 --- a/tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php +++ b/tests/phpunit/CRM/Core/Smarty/plugins/CrmScopeTest.php @@ -6,7 +6,7 @@ */ class CRM_Core_Smarty_plugins_CrmScopeTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); require_once 'CRM/Core/Smarty.php'; diff --git a/tests/phpunit/CRM/Core/TransactionTest.php b/tests/phpunit/CRM/Core/TransactionTest.php index 069980a533..de41e640c3 100644 --- a/tests/phpunit/CRM/Core/TransactionTest.php +++ b/tests/phpunit/CRM/Core/TransactionTest.php @@ -19,7 +19,7 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase { */ private $cids; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->quickCleanup(['civicrm_contact', 'civicrm_activity']); $this->callbackLog = []; diff --git a/tests/phpunit/CRM/Custom/Form/FieldTest.php b/tests/phpunit/CRM/Custom/Form/FieldTest.php index c694ea6d57..a40d2038c1 100644 --- a/tests/phpunit/CRM/Custom/Form/FieldTest.php +++ b/tests/phpunit/CRM/Custom/Form/FieldTest.php @@ -6,7 +6,7 @@ */ class CRM_Custom_Form_FieldTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); } diff --git a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php index 4c172c23fb..ae19b6c2bd 100644 --- a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php +++ b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php @@ -28,7 +28,7 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->contactID = $this->individualCreate(); $event = $this->eventCreate(); diff --git a/tests/phpunit/CRM/Event/BAO/ChangeFeeSelectionTest.php b/tests/phpunit/CRM/Event/BAO/ChangeFeeSelectionTest.php index a92d7cd7f5..85524bd91b 100644 --- a/tests/phpunit/CRM/Event/BAO/ChangeFeeSelectionTest.php +++ b/tests/phpunit/CRM/Event/BAO/ChangeFeeSelectionTest.php @@ -63,7 +63,7 @@ class CRM_Event_BAO_ChangeFeeSelectionTest extends CiviUnitTestCase { * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_contactId = $this->individualCreate(); $event = $this->eventCreate(['is_monetary' => 1]); diff --git a/tests/phpunit/CRM/Event/BAO/EventPermissionsTest.php b/tests/phpunit/CRM/Event/BAO/EventPermissionsTest.php index 3fc3e5f255..8179347aa6 100644 --- a/tests/phpunit/CRM/Event/BAO/EventPermissionsTest.php +++ b/tests/phpunit/CRM/Event/BAO/EventPermissionsTest.php @@ -17,7 +17,7 @@ class CRM_Event_BAO_EventPermissionsTest extends CiviUnitTestCase { use CRMTraits_ACL_PermissionTrait; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_contactId = $this->createLoggedInUser(); $this->createOwnEvent(); diff --git a/tests/phpunit/CRM/Event/BAO/ParticipantTest.php b/tests/phpunit/CRM/Event/BAO/ParticipantTest.php index c274e941c6..42f9a3b7a8 100644 --- a/tests/phpunit/CRM/Event/BAO/ParticipantTest.php +++ b/tests/phpunit/CRM/Event/BAO/ParticipantTest.php @@ -16,7 +16,7 @@ */ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_contactId = $this->individualCreate(); $event = $this->eventCreate(); diff --git a/tests/phpunit/CRM/Event/BAO/QueryTest.php b/tests/phpunit/CRM/Event/BAO/QueryTest.php index 84c31e0eaf..0e1e087188 100644 --- a/tests/phpunit/CRM/Event/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Event/BAO/QueryTest.php @@ -5,7 +5,7 @@ */ class CRM_Event_BAO_QueryTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); } diff --git a/tests/phpunit/CRM/Event/Form/ParticipantTest.php b/tests/phpunit/CRM/Event/Form/ParticipantTest.php index be2c61ffca..d817ddeb11 100644 --- a/tests/phpunit/CRM/Event/Form/ParticipantTest.php +++ b/tests/phpunit/CRM/Event/Form/ParticipantTest.php @@ -15,7 +15,7 @@ class CRM_Event_Form_ParticipantTest extends CiviUnitTestCase { */ protected $fromEmailAddressOptions = []; - public function setUp() { + public function setUp(): void { $this->useTransaction(TRUE); parent::setUp(); } diff --git a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php index 0411a6da6b..6267e1e851 100644 --- a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php +++ b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php @@ -10,7 +10,7 @@ class CRM_Event_Form_Registration_ConfirmTest extends CiviUnitTestCase { use CRMTraits_Profile_ProfileTrait; - public function setUp() { + public function setUp(): void { $this->useTransaction(TRUE); parent::setUp(); } diff --git a/tests/phpunit/CRM/Event/Form/SearchTest.php b/tests/phpunit/CRM/Event/Form/SearchTest.php index 7899cf2ff1..3685cb9dc1 100644 --- a/tests/phpunit/CRM/Event/Form/SearchTest.php +++ b/tests/phpunit/CRM/Event/Form/SearchTest.php @@ -5,7 +5,7 @@ */ class CRM_Event_Form_SearchTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->individualID = $this->individualCreate(); $this->event = $this->eventCreate(); diff --git a/tests/phpunit/CRM/Extension/InfoTest.php b/tests/phpunit/CRM/Extension/InfoTest.php index 75e082a73b..73e577fad8 100644 --- a/tests/phpunit/CRM/Extension/InfoTest.php +++ b/tests/phpunit/CRM/Extension/InfoTest.php @@ -6,7 +6,7 @@ */ class CRM_Extension_InfoTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->file = NULL; } diff --git a/tests/phpunit/CRM/Extension/Manager/PaymentTest.php b/tests/phpunit/CRM/Extension/Manager/PaymentTest.php index d6bffc10e0..79d71fdd24 100644 --- a/tests/phpunit/CRM/Extension/Manager/PaymentTest.php +++ b/tests/phpunit/CRM/Extension/Manager/PaymentTest.php @@ -15,7 +15,7 @@ */ class CRM_Extension_Manager_PaymentTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); if (class_exists('test_extension_manager_paymenttest')) { test_extension_manager_paymenttest::$counts = []; diff --git a/tests/phpunit/CRM/Extension/Manager/SearchTest.php b/tests/phpunit/CRM/Extension/Manager/SearchTest.php index ee4ec46433..d37ada35f6 100644 --- a/tests/phpunit/CRM/Extension/Manager/SearchTest.php +++ b/tests/phpunit/CRM/Extension/Manager/SearchTest.php @@ -6,7 +6,7 @@ */ class CRM_Extension_Manager_SearchTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); //if (class_exists('test_extension_manager_searchtest')) { // test_extension_manager_searchtest::$counts = array(); diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php index e673b00c0a..208f5ea274 100644 --- a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php @@ -18,7 +18,7 @@ use Civi\Api4\FinancialType; */ class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { $this->useTransaction(TRUE); parent::setUp(); $this->organizationCreate(); diff --git a/tests/phpunit/CRM/Logging/LoggingTest.php b/tests/phpunit/CRM/Logging/LoggingTest.php index c2623dd7e1..cd1d64c750 100644 --- a/tests/phpunit/CRM/Logging/LoggingTest.php +++ b/tests/phpunit/CRM/Logging/LoggingTest.php @@ -6,10 +6,6 @@ */ class CRM_Logging_LoggingTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - public function tearDown(): void { CRM_Core_I18n_Schema::makeSinglelingual('en_US'); $logging = new CRM_Logging_Schema();