From 0b49aa04156bc88a6dd11c70a8b3d83af00d18f4 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 28 Mar 2021 08:22:16 +1300 Subject: [PATCH] PHPUNIT 8 - add void to setup functions --- tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php | 2 +- tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php | 2 +- tests/phpunit/CRM/Group/Page/AjaxTest.php | 2 +- tests/phpunit/CRM/Logging/SchemaTest.php | 2 +- tests/phpunit/CRM/Mailing/BAO/SpoolTest.php | 2 +- tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php | 2 +- tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php | 2 +- tests/phpunit/CRM/Mailing/MailStoreTest.php | 2 +- tests/phpunit/CRM/Mailing/MailingSystemTest.php | 2 +- tests/phpunit/CRM/Mailing/TokensTest.php | 2 +- tests/phpunit/CRM/Member/BAO/MembershipLogTest.php | 2 +- tests/phpunit/CRM/Member/BAO/MembershipTest.php | 2 +- tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php | 2 +- tests/phpunit/CRM/Member/BAO/QueryTest.php | 2 +- tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php | 2 +- tests/phpunit/CRM/Pledge/Form/SearchTest.php | 2 +- tests/phpunit/CRM/Price/Form/FieldTest.php | 2 +- tests/phpunit/CRM/Price/Form/OptionTest.php | 2 +- tests/phpunit/CRM/Queue/Queue/SqlTest.php | 2 +- tests/phpunit/CRM/Queue/QueueTest.php | 2 +- tests/phpunit/CRM/Queue/RunnerTest.php | 2 +- tests/phpunit/CRM/Report/Form/ActivityTest.php | 2 +- tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php | 2 +- tests/phpunit/CRM/Report/Form/Member/DetailTest.php | 2 +- tests/phpunit/CRM/Report/Form/TestCaseTest.php | 2 +- tests/phpunit/CRM/SMS/BAO/ProviderTest.php | 2 +- tests/phpunit/CRM/SMS/PreviewTest.php | 2 +- tests/phpunit/CRM/SMS/ProviderTest.php | 2 +- tests/phpunit/CRM/Utils/API/MatchOptionTest.php | 2 +- tests/phpunit/CRM/Utils/API/ReloadOptionTest.php | 2 +- tests/phpunit/CRM/Utils/AutoCleanTest.php | 2 +- tests/phpunit/CRM/Utils/EnglishNumberTest.php | 2 +- tests/phpunit/CRM/Utils/HookTest.php | 2 +- tests/phpunit/CRM/Utils/HttpClientTest.php | 2 +- tests/phpunit/CRM/Utils/Mail/EmailProcessorInboundTest.php | 2 +- tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php | 2 +- tests/phpunit/CRM/Utils/MoneyTest.php | 4 ---- tests/phpunit/CRM/Utils/ZipTest.php | 2 +- tests/phpunit/Civi/API/Event/PrepareEventTest.php | 2 +- tests/phpunit/Civi/API/KernelTest.php | 2 +- tests/phpunit/Civi/ActionSchedule/AbstractMappingTest.php | 2 +- tests/phpunit/Civi/Angular/LoaderTest.php | 2 +- tests/phpunit/Civi/Angular/ManagerTest.php | 2 +- tests/phpunit/Civi/Angular/PartialSyntaxTest.php | 2 +- tests/phpunit/Civi/Core/CiviFacadeTest.php | 2 +- tests/phpunit/Civi/Core/ResolverTest.php | 2 +- tests/phpunit/Civi/Core/SettingsBagTest.php | 2 +- tests/phpunit/Civi/Core/SettingsManagerTest.php | 2 +- tests/phpunit/Civi/Core/ThemesTest.php | 2 +- tests/phpunit/Civi/Crypto/CryptoJwtTest.php | 2 +- tests/phpunit/Civi/Crypto/CryptoRegistryTest.php | 2 +- tests/phpunit/Civi/Crypto/CryptoTokenTest.php | 2 +- tests/phpunit/Civi/Token/TokenProcessorTest.php | 2 +- tests/phpunit/E2E/Cache/TwoInstancesTest.php | 2 +- tests/phpunit/E2E/Core/AssetBuilderTest.php | 2 +- tests/phpunit/E2E/Core/PrevNextTest.php | 2 +- tests/phpunit/E2E/Extern/SoapTest.php | 2 +- tests/phpunit/HelloTest.php | 2 +- tests/phpunit/api/v4/Action/BaseCustomValueTest.php | 2 +- tests/phpunit/api/v4/Action/CreateWithOptionGroupTest.php | 2 +- tests/phpunit/api/v4/Action/ReplaceTest.php | 2 +- tests/phpunit/api/v4/Entity/ConformanceTest.php | 2 +- tests/phpunit/api/v4/Entity/ParticipantTest.php | 2 +- tests/phpunit/api/v4/Entity/SystemRotateKeyTest.php | 2 +- tests/phpunit/api/v4/Traits/OptionCleanupTrait.php | 2 +- 65 files changed, 64 insertions(+), 68 deletions(-) diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php index 7ce8437099..4bb6d3b077 100644 --- a/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php @@ -15,7 +15,7 @@ */ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->organizationCreate(); } diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php index a2d0b4a451..0258437bd5 100644 --- a/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php @@ -15,7 +15,7 @@ */ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_orgContactID = $this->organizationCreate(); } diff --git a/tests/phpunit/CRM/Group/Page/AjaxTest.php b/tests/phpunit/CRM/Group/Page/AjaxTest.php index 5237cf2bfc..71931a9f4a 100644 --- a/tests/phpunit/CRM/Group/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Group/Page/AjaxTest.php @@ -25,7 +25,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { protected $_params = []; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_params = [ 'page' => 1, diff --git a/tests/phpunit/CRM/Logging/SchemaTest.php b/tests/phpunit/CRM/Logging/SchemaTest.php index 110c6ffcc2..e27089bfd6 100644 --- a/tests/phpunit/CRM/Logging/SchemaTest.php +++ b/tests/phpunit/CRM/Logging/SchemaTest.php @@ -8,7 +8,7 @@ class CRM_Logging_SchemaTest extends CiviUnitTestCase { protected $databaseVersion; - public function setUp() { + public function setUp(): void { $this->databaseVersion = CRM_Utils_SQL::getDatabaseVersion(); parent::setUp(); } diff --git a/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php b/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php index ae5be6bf09..449e104b44 100644 --- a/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php +++ b/tests/phpunit/CRM/Mailing/BAO/SpoolTest.php @@ -14,7 +14,7 @@ class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase { protected static $bodytext = 'Unit tests keep children safe.'; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_mut = new CiviMailUtils($this, TRUE); } diff --git a/tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php b/tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php index f83d444e48..7d927cdda1 100644 --- a/tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php +++ b/tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php @@ -36,7 +36,7 @@ abstract class CRM_Mailing_BaseMailingSystemTest extends CiviUnitTestCase { */ private $_mut; - public function setUp() { + public function setUp(): void { $this->useTransaction(); parent::setUp(); CRM_Mailing_BAO_MailingJob::$mailsProcessed = 0; diff --git a/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php b/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php index c579c87d26..fb11da8bf1 100644 --- a/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php +++ b/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php @@ -17,7 +17,7 @@ class CRM_Mailing_Form_Task_AdhocMailingTest extends CiviUnitTestCase { /** * @throws \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/Mailing/MailStoreTest.php b/tests/phpunit/CRM/Mailing/MailStoreTest.php index e4a549ff8c..ae164f2b1c 100644 --- a/tests/phpunit/CRM/Mailing/MailStoreTest.php +++ b/tests/phpunit/CRM/Mailing/MailStoreTest.php @@ -7,7 +7,7 @@ class CRM_Mailing_MailStoreTest extends \CiviUnitTestCase { protected $workDir; - public function setUp() { + public function setUp(): void { $this->useTransaction(TRUE); parent::setUp(); $this->workDir = tempnam(sys_get_temp_dir(), 'mailstoretest'); diff --git a/tests/phpunit/CRM/Mailing/MailingSystemTest.php b/tests/phpunit/CRM/Mailing/MailingSystemTest.php index b52dcc9fcc..21dc496d09 100644 --- a/tests/phpunit/CRM/Mailing/MailingSystemTest.php +++ b/tests/phpunit/CRM/Mailing/MailingSystemTest.php @@ -38,7 +38,7 @@ class CRM_Mailing_MailingSystemTest extends CRM_Mailing_BaseMailingSystemTest { private $counts; - public function setUp() { + public function setUp(): void { parent::setUp(); // If we happen to execute with flexmailer active, use BAO mode. // There is a parallel FlexMailerSystemTest which runs in flexmailer mode. diff --git a/tests/phpunit/CRM/Mailing/TokensTest.php b/tests/phpunit/CRM/Mailing/TokensTest.php index c0ac6a74e8..4a5bdb7f4c 100644 --- a/tests/phpunit/CRM/Mailing/TokensTest.php +++ b/tests/phpunit/CRM/Mailing/TokensTest.php @@ -5,7 +5,7 @@ */ class CRM_Mailing_TokensTest extends \CiviUnitTestCase { - protected function setUp() { + protected function setUp(): void { $this->useTransaction(); parent::setUp(); $this->callAPISuccess('mail_settings', 'get', diff --git a/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php b/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php index 541b1d0cf4..ea638a3bf7 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php @@ -63,7 +63,7 @@ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase { * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $params = [ diff --git a/tests/phpunit/CRM/Member/BAO/MembershipTest.php b/tests/phpunit/CRM/Member/BAO/MembershipTest.php index ad5c9a1b09..0358ea0d6e 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipTest.php @@ -19,7 +19,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { private $_membershipStatusID; private $_membershipTypeID; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_contactID = $this->organizationCreate(); diff --git a/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php b/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php index 0193316765..6af848e4db 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php @@ -17,7 +17,7 @@ use Civi\Api4\MembershipType; */ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); //create relationship diff --git a/tests/phpunit/CRM/Member/BAO/QueryTest.php b/tests/phpunit/CRM/Member/BAO/QueryTest.php index 98a563abf3..460cb6ac4d 100644 --- a/tests/phpunit/CRM/Member/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Member/BAO/QueryTest.php @@ -11,7 +11,7 @@ class CRM_Member_BAO_QueryTest extends CiviUnitTestCase { * * Ensure CiviCase is enabled. */ - public function setUp() { + public function setUp(): void { parent::setUp(); CRM_Core_BAO_ConfigSetting::enableComponent('CiviCase'); } diff --git a/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php b/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php index 8fd040a7b4..c166ca43b7 100644 --- a/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php @@ -53,7 +53,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase { * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $params = [ diff --git a/tests/phpunit/CRM/Pledge/Form/SearchTest.php b/tests/phpunit/CRM/Pledge/Form/SearchTest.php index 0ff0e7750e..c5692825ae 100644 --- a/tests/phpunit/CRM/Pledge/Form/SearchTest.php +++ b/tests/phpunit/CRM/Pledge/Form/SearchTest.php @@ -6,7 +6,7 @@ */ class CRM_Pledge_Form_SearchTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->individualID = $this->individualCreate(); $this->pledgeCreate(['contact_id' => $this->individualID]); diff --git a/tests/phpunit/CRM/Price/Form/FieldTest.php b/tests/phpunit/CRM/Price/Form/FieldTest.php index a7ecdafb36..b05af373af 100644 --- a/tests/phpunit/CRM/Price/Form/FieldTest.php +++ b/tests/phpunit/CRM/Price/Form/FieldTest.php @@ -8,7 +8,7 @@ class CRM_Price_Form_FieldTest extends CiviUnitTestCase { protected $publicFieldParams; protected $adminFieldParams; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->visibilityOptionsKeys = CRM_Core_PseudoConstant::get('CRM_Price_BAO_PriceFieldValue', 'visibility_id', [ diff --git a/tests/phpunit/CRM/Price/Form/OptionTest.php b/tests/phpunit/CRM/Price/Form/OptionTest.php index f9ac7ed7b7..829d44fcae 100644 --- a/tests/phpunit/CRM/Price/Form/OptionTest.php +++ b/tests/phpunit/CRM/Price/Form/OptionTest.php @@ -12,7 +12,7 @@ class CRM_Price_Form_OptionTest extends CiviUnitTestCase { protected $adminValue; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->visibilityOptions = CRM_Core_PseudoConstant::get('CRM_Price_BAO_PriceFieldValue', 'visibility_id', [ diff --git a/tests/phpunit/CRM/Queue/Queue/SqlTest.php b/tests/phpunit/CRM/Queue/Queue/SqlTest.php index c7a4dccad4..6f544387b0 100644 --- a/tests/phpunit/CRM/Queue/Queue/SqlTest.php +++ b/tests/phpunit/CRM/Queue/Queue/SqlTest.php @@ -39,7 +39,7 @@ class CRM_Queue_Queue_SqlTest extends CiviUnitTestCase { * Per-provider tests * */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->queueService = CRM_Queue_Service::singleton(TRUE); } diff --git a/tests/phpunit/CRM/Queue/QueueTest.php b/tests/phpunit/CRM/Queue/QueueTest.php index 8b114d402c..a79f30a717 100644 --- a/tests/phpunit/CRM/Queue/QueueTest.php +++ b/tests/phpunit/CRM/Queue/QueueTest.php @@ -42,7 +42,7 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase { /** * Per-provider tests */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->queueService = CRM_Queue_Service::singleton(TRUE); } diff --git a/tests/phpunit/CRM/Queue/RunnerTest.php b/tests/phpunit/CRM/Queue/RunnerTest.php index f8dde4382e..ed1799a5b2 100644 --- a/tests/phpunit/CRM/Queue/RunnerTest.php +++ b/tests/phpunit/CRM/Queue/RunnerTest.php @@ -15,7 +15,7 @@ */ class CRM_Queue_RunnerTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->queueService = CRM_Queue_Service::singleton(TRUE); $this->queue = $this->queueService->create([ diff --git a/tests/phpunit/CRM/Report/Form/ActivityTest.php b/tests/phpunit/CRM/Report/Form/ActivityTest.php index 97848fa4e1..688e05a2b7 100644 --- a/tests/phpunit/CRM/Report/Form/ActivityTest.php +++ b/tests/phpunit/CRM/Report/Form/ActivityTest.php @@ -23,7 +23,7 @@ class CRM_Report_Form_ActivityTest extends CiviReportTestCase { 'civicrm_contribution', ]; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->quickCleanup($this->_tablesToTruncate); } diff --git a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php index c384ff17f5..7e1b519638 100644 --- a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php +++ b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php @@ -49,7 +49,7 @@ class CRM_Report_Form_Contribute_DetailTest extends CiviReportTestCase { ]; } - public function setUp() { + public function setUp(): void { parent::setUp(); $this->quickCleanup($this->_tablesToTruncate); } diff --git a/tests/phpunit/CRM/Report/Form/Member/DetailTest.php b/tests/phpunit/CRM/Report/Form/Member/DetailTest.php index 9c7bedcc90..2f1755bc0c 100644 --- a/tests/phpunit/CRM/Report/Form/Member/DetailTest.php +++ b/tests/phpunit/CRM/Report/Form/Member/DetailTest.php @@ -16,7 +16,7 @@ */ class CRM_Report_Form_Member_DetailTest extends CiviReportTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_orgContactID = $this->organizationCreate(); diff --git a/tests/phpunit/CRM/Report/Form/TestCaseTest.php b/tests/phpunit/CRM/Report/Form/TestCaseTest.php index 17c6a84379..419ce4cb16 100644 --- a/tests/phpunit/CRM/Report/Form/TestCaseTest.php +++ b/tests/phpunit/CRM/Report/Form/TestCaseTest.php @@ -115,7 +115,7 @@ class CRM_Report_Form_TestCaseTest extends CiviReportTestCase { ]; } - public function setUp() { + public function setUp(): void { parent::setUp(); $this->quickCleanup($this->_tablesToTruncate); } diff --git a/tests/phpunit/CRM/SMS/BAO/ProviderTest.php b/tests/phpunit/CRM/SMS/BAO/ProviderTest.php index 105193a290..9ca1c34217 100644 --- a/tests/phpunit/CRM/SMS/BAO/ProviderTest.php +++ b/tests/phpunit/CRM/SMS/BAO/ProviderTest.php @@ -21,7 +21,7 @@ class CRM_SMS_BAO_ProviderTest extends CiviUnitTestCase { /** * Set Up Funtion */ - public function setUp() { + public function setUp(): void { parent::setUp(); $option = $this->callAPISuccess('option_value', 'create', ['option_group_id' => 'sms_provider_name', 'name' => 'test_provider_name', 'label' => 'test_provider_name', 'value' => 1]); $this->option_value = $option['id']; diff --git a/tests/phpunit/CRM/SMS/PreviewTest.php b/tests/phpunit/CRM/SMS/PreviewTest.php index ce45dfa728..fa81cecad3 100644 --- a/tests/phpunit/CRM/SMS/PreviewTest.php +++ b/tests/phpunit/CRM/SMS/PreviewTest.php @@ -10,7 +10,7 @@ class CRM_SMS_PreviewTest extends CiviUnitTestCase { /** * Set Up Function */ - public function setUp() { + public function setUp(): void { parent::setUp(); $option = $this->callAPISuccess('option_value', 'create', ['option_group_id' => 'sms_provider_name', 'name' => 'test_provider_name', 'label' => 'Test Provider Label', 'value' => 1]); $this->option_value = $option['id']; diff --git a/tests/phpunit/CRM/SMS/ProviderTest.php b/tests/phpunit/CRM/SMS/ProviderTest.php index a1921f330b..9bf2993bb6 100644 --- a/tests/phpunit/CRM/SMS/ProviderTest.php +++ b/tests/phpunit/CRM/SMS/ProviderTest.php @@ -23,7 +23,7 @@ class CRM_SMS_ProviderTest extends CiviUnitTestCase { /** * Set Up Funtion */ - public function setUp() { + public function setUp(): void { parent::setUp(); $option = $this->callAPISuccess('option_value', 'create', ['option_group_id' => 'sms_provider_name', 'name' => 'test_provider_name', 'label' => 'test_provider_name', 'value' => 1]); $this->option_value = $option['id']; diff --git a/tests/phpunit/CRM/Utils/API/MatchOptionTest.php b/tests/phpunit/CRM/Utils/API/MatchOptionTest.php index be36950452..f6b610812a 100644 --- a/tests/phpunit/CRM/Utils/API/MatchOptionTest.php +++ b/tests/phpunit/CRM/Utils/API/MatchOptionTest.php @@ -11,7 +11,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase { */ public $noise; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->assertDBQuery(0, "SELECT count(*) FROM civicrm_contact WHERE first_name='Jeffrey' and last_name='Lebowski'"); diff --git a/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php b/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php index 44491e8ce0..01ece92d7c 100644 --- a/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php +++ b/tests/phpunit/CRM/Utils/API/ReloadOptionTest.php @@ -11,7 +11,7 @@ */ class CRM_Utils_API_ReloadOptionTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); CRM_Utils_Hook_UnitTests::singleton()->setHook('civicrm_post', [$this, 'onPost']); } diff --git a/tests/phpunit/CRM/Utils/AutoCleanTest.php b/tests/phpunit/CRM/Utils/AutoCleanTest.php index a48d0192bb..6cfc20f62d 100644 --- a/tests/phpunit/CRM/Utils/AutoCleanTest.php +++ b/tests/phpunit/CRM/Utils/AutoCleanTest.php @@ -8,7 +8,7 @@ class CRM_Utils_AutoCleanTest extends CiviUnitTestCase { public $foo; - protected function setUp() { + protected function setUp(): void { $this->useTransaction(); parent::setUp(); } diff --git a/tests/phpunit/CRM/Utils/EnglishNumberTest.php b/tests/phpunit/CRM/Utils/EnglishNumberTest.php index 24a301040c..eba51d29c0 100644 --- a/tests/phpunit/CRM/Utils/EnglishNumberTest.php +++ b/tests/phpunit/CRM/Utils/EnglishNumberTest.php @@ -7,7 +7,7 @@ */ class CRM_Utils_EnglishNumberTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(); } diff --git a/tests/phpunit/CRM/Utils/HookTest.php b/tests/phpunit/CRM/Utils/HookTest.php index 97419e2511..4ec39cce8c 100644 --- a/tests/phpunit/CRM/Utils/HookTest.php +++ b/tests/phpunit/CRM/Utils/HookTest.php @@ -12,7 +12,7 @@ class CRM_Utils_HookTest extends CiviUnitTestCase { public $log; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->fakeModules = [ 'hooktesta', diff --git a/tests/phpunit/CRM/Utils/HttpClientTest.php b/tests/phpunit/CRM/Utils/HttpClientTest.php index 1ec1a6eade..599bc6d153 100644 --- a/tests/phpunit/CRM/Utils/HttpClientTest.php +++ b/tests/phpunit/CRM/Utils/HttpClientTest.php @@ -24,7 +24,7 @@ class CRM_Utils_HttpClientTest extends CiviUnitTestCase { */ protected $client; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->tmpFile = $this->createTempDir() . '/example.txt'; diff --git a/tests/phpunit/CRM/Utils/Mail/EmailProcessorInboundTest.php b/tests/phpunit/CRM/Utils/Mail/EmailProcessorInboundTest.php index b845c3620f..44355f7656 100644 --- a/tests/phpunit/CRM/Utils/Mail/EmailProcessorInboundTest.php +++ b/tests/phpunit/CRM/Utils/Mail/EmailProcessorInboundTest.php @@ -13,7 +13,7 @@ class CRM_Utils_Mail_EmailProcessorInboundTest extends CiviUnitTestCase { */ protected $mailSettingsId; - public function setUp() { + public function setUp(): void { parent::setUp(); CRM_Utils_File::cleanDir(__DIR__ . '/data/mail'); mkdir(__DIR__ . '/data/mail'); diff --git a/tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php b/tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php index e0468acf30..92500f1bd6 100644 --- a/tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php +++ b/tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php @@ -20,7 +20,7 @@ class CRM_Utils_Mail_EmailProcessorTest extends CiviUnitTestCase { */ protected $contactID; - public function setUp() { + public function setUp(): void { parent::setUp(); CRM_Utils_File::cleanDir(__DIR__ . '/data/mail'); mkdir(__DIR__ . '/data/mail'); diff --git a/tests/phpunit/CRM/Utils/MoneyTest.php b/tests/phpunit/CRM/Utils/MoneyTest.php index 8deb5818c3..f4cb5718ee 100644 --- a/tests/phpunit/CRM/Utils/MoneyTest.php +++ b/tests/phpunit/CRM/Utils/MoneyTest.php @@ -6,10 +6,6 @@ */ class CRM_Utils_MoneyTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - /** * @dataProvider subtractCurrenciesDataProvider * @param string $leftOp diff --git a/tests/phpunit/CRM/Utils/ZipTest.php b/tests/phpunit/CRM/Utils/ZipTest.php index eb41fbfb77..9cb51eec2b 100644 --- a/tests/phpunit/CRM/Utils/ZipTest.php +++ b/tests/phpunit/CRM/Utils/ZipTest.php @@ -15,7 +15,7 @@ */ class CRM_Utils_ZipTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->file = FALSE; } diff --git a/tests/phpunit/Civi/API/Event/PrepareEventTest.php b/tests/phpunit/Civi/API/Event/PrepareEventTest.php index ce5516c98b..1eb9b82493 100644 --- a/tests/phpunit/Civi/API/Event/PrepareEventTest.php +++ b/tests/phpunit/Civi/API/Event/PrepareEventTest.php @@ -19,7 +19,7 @@ class PrepareEventTest extends \CiviUnitTestCase { */ public $kernel; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->dispatcher = new EventDispatcher(); $this->kernel = new Kernel($this->dispatcher); diff --git a/tests/phpunit/Civi/API/KernelTest.php b/tests/phpunit/Civi/API/KernelTest.php index 32ef294712..0831247f7d 100644 --- a/tests/phpunit/Civi/API/KernelTest.php +++ b/tests/phpunit/Civi/API/KernelTest.php @@ -24,7 +24,7 @@ class KernelTest extends \CiviUnitTestCase { */ public $kernel; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->actualEventSequence = []; $this->dispatcher = new EventDispatcher(); diff --git a/tests/phpunit/Civi/ActionSchedule/AbstractMappingTest.php b/tests/phpunit/Civi/ActionSchedule/AbstractMappingTest.php index 79a8019d9a..dc9bbf1b7b 100644 --- a/tests/phpunit/Civi/ActionSchedule/AbstractMappingTest.php +++ b/tests/phpunit/Civi/ActionSchedule/AbstractMappingTest.php @@ -184,7 +184,7 @@ abstract class AbstractMappingTest extends \CiviUnitTestCase { /** * Setup an empty schedule and some contacts. */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->useTransaction(); diff --git a/tests/phpunit/Civi/Angular/LoaderTest.php b/tests/phpunit/Civi/Angular/LoaderTest.php index c6c144b6a2..e1fe0e0948 100644 --- a/tests/phpunit/Civi/Angular/LoaderTest.php +++ b/tests/phpunit/Civi/Angular/LoaderTest.php @@ -19,7 +19,7 @@ class LoaderTest extends \CiviUnitTestCase { public static $dummy_setting_count = 0; public static $dummy_callback_count = 0; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->hookClass->setHook('civicrm_angularModules', [$this, 'hook_angularModules']); self::$dummy_setting_count = 0; diff --git a/tests/phpunit/Civi/Angular/ManagerTest.php b/tests/phpunit/Civi/Angular/ManagerTest.php index 937a62db85..7d82c5bb1e 100644 --- a/tests/phpunit/Civi/Angular/ManagerTest.php +++ b/tests/phpunit/Civi/Angular/ManagerTest.php @@ -29,7 +29,7 @@ class ManagerTest extends \CiviUnitTestCase { /** * @inheritDoc */ - protected function setUp() { + protected function setUp(): void { $this->useTransaction(TRUE); parent::setUp(); $this->createLoggedInUser(); diff --git a/tests/phpunit/Civi/Angular/PartialSyntaxTest.php b/tests/phpunit/Civi/Angular/PartialSyntaxTest.php index 40dacc6db4..81ff60477e 100644 --- a/tests/phpunit/Civi/Angular/PartialSyntaxTest.php +++ b/tests/phpunit/Civi/Angular/PartialSyntaxTest.php @@ -29,7 +29,7 @@ class PartialSyntaxTest extends \CiviUnitTestCase { /** * @inheritDoc */ - protected function setUp() { + protected function setUp(): void { $this->useTransaction(TRUE); parent::setUp(); $this->createLoggedInUser(); diff --git a/tests/phpunit/Civi/Core/CiviFacadeTest.php b/tests/phpunit/Civi/Core/CiviFacadeTest.php index 1fcae645d3..04503b7412 100644 --- a/tests/phpunit/Civi/Core/CiviFacadeTest.php +++ b/tests/phpunit/Civi/Core/CiviFacadeTest.php @@ -5,7 +5,7 @@ class CiviFacadeTest extends \CiviUnitTestCase { protected $origSetting; - protected function setUp() { + protected function setUp(): void { $this->origSetting = $GLOBALS['civicrm_setting']; parent::setUp(); diff --git a/tests/phpunit/Civi/Core/ResolverTest.php b/tests/phpunit/Civi/Core/ResolverTest.php index cecc16ca0b..67a7ef5da4 100644 --- a/tests/phpunit/Civi/Core/ResolverTest.php +++ b/tests/phpunit/Civi/Core/ResolverTest.php @@ -16,7 +16,7 @@ namespace Civi\Core { /** * Test setup. */ - protected function setUp() { + protected function setUp(): void { // TODO: Change the autogenerated stub parent::setUp(); $this->resolver = new Resolver(); diff --git a/tests/phpunit/Civi/Core/SettingsBagTest.php b/tests/phpunit/Civi/Core/SettingsBagTest.php index e68ac6f29e..85ca76ffe8 100644 --- a/tests/phpunit/Civi/Core/SettingsBagTest.php +++ b/tests/phpunit/Civi/Core/SettingsBagTest.php @@ -5,7 +5,7 @@ class SettingsBagTest extends \CiviUnitTestCase { protected $origSetting; - protected function setUp() { + protected function setUp(): void { $this->origSetting = $GLOBALS['civicrm_setting']; parent::setUp(); diff --git a/tests/phpunit/Civi/Core/SettingsManagerTest.php b/tests/phpunit/Civi/Core/SettingsManagerTest.php index 77b99ad115..69ea7f4a96 100644 --- a/tests/phpunit/Civi/Core/SettingsManagerTest.php +++ b/tests/phpunit/Civi/Core/SettingsManagerTest.php @@ -8,7 +8,7 @@ class SettingsManagerTest extends \CiviUnitTestCase { protected $mandates; protected $origSetting; - protected function setUp() { + protected function setUp(): void { $this->origSetting = $GLOBALS['civicrm_setting']; parent::setUp(); diff --git a/tests/phpunit/Civi/Core/ThemesTest.php b/tests/phpunit/Civi/Core/ThemesTest.php index f252078921..3abb4f7d22 100644 --- a/tests/phpunit/Civi/Core/ThemesTest.php +++ b/tests/phpunit/Civi/Core/ThemesTest.php @@ -9,7 +9,7 @@ namespace Civi\Core; */ class ThemesTest extends \CiviUnitTestCase { - protected function setUp() { + protected function setUp(): void { $this->useTransaction(); parent::setUp(); } diff --git a/tests/phpunit/Civi/Crypto/CryptoJwtTest.php b/tests/phpunit/Civi/Crypto/CryptoJwtTest.php index 67611ebe39..43711e8602 100644 --- a/tests/phpunit/Civi/Crypto/CryptoJwtTest.php +++ b/tests/phpunit/Civi/Crypto/CryptoJwtTest.php @@ -22,7 +22,7 @@ class CryptoJwtTest extends \CiviUnitTestCase { use CryptoTestTrait; - protected function setUp() { + protected function setUp(): void { parent::setUp(); \CRM_Utils_Hook::singleton()->setHook('civicrm_crypto', [$this, 'registerExampleKeys']); JWT::$timestamp = NULL; diff --git a/tests/phpunit/Civi/Crypto/CryptoRegistryTest.php b/tests/phpunit/Civi/Crypto/CryptoRegistryTest.php index 259c9e60ab..bad98388d9 100644 --- a/tests/phpunit/Civi/Crypto/CryptoRegistryTest.php +++ b/tests/phpunit/Civi/Crypto/CryptoRegistryTest.php @@ -20,7 +20,7 @@ class CryptoRegistryTest extends \CiviUnitTestCase { use CryptoTestTrait; - protected function setUp() { + protected function setUp(): void { parent::setUp(); \CRM_Utils_Hook::singleton()->setHook('civicrm_crypto', [$this, 'registerExampleKeys']); } diff --git a/tests/phpunit/Civi/Crypto/CryptoTokenTest.php b/tests/phpunit/Civi/Crypto/CryptoTokenTest.php index ccd27dcd76..c17696846d 100644 --- a/tests/phpunit/Civi/Crypto/CryptoTokenTest.php +++ b/tests/phpunit/Civi/Crypto/CryptoTokenTest.php @@ -20,7 +20,7 @@ class CryptoTokenTest extends \CiviUnitTestCase { use CryptoTestTrait; - protected function setUp() { + protected function setUp(): void { parent::setUp(); \CRM_Utils_Hook::singleton()->setHook('civicrm_crypto', [$this, 'registerExampleKeys']); } diff --git a/tests/phpunit/Civi/Token/TokenProcessorTest.php b/tests/phpunit/Civi/Token/TokenProcessorTest.php index f4e667a166..cd8dba1cf2 100644 --- a/tests/phpunit/Civi/Token/TokenProcessorTest.php +++ b/tests/phpunit/Civi/Token/TokenProcessorTest.php @@ -18,7 +18,7 @@ class TokenProcessorTest extends \CiviUnitTestCase { */ protected $counts; - protected function setUp() { + protected function setUp(): void { $this->useTransaction(TRUE); parent::setUp(); $this->dispatcher = new EventDispatcher(); diff --git a/tests/phpunit/E2E/Cache/TwoInstancesTest.php b/tests/phpunit/E2E/Cache/TwoInstancesTest.php index 73e9f554df..2c8760a7f2 100644 --- a/tests/phpunit/E2E/Cache/TwoInstancesTest.php +++ b/tests/phpunit/E2E/Cache/TwoInstancesTest.php @@ -26,7 +26,7 @@ class E2E_Cache_TwoInstancesTest extends CiviEndToEndTestCase { */ protected $b; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->a = $this->b = NULL; } diff --git a/tests/phpunit/E2E/Core/AssetBuilderTest.php b/tests/phpunit/E2E/Core/AssetBuilderTest.php index aa282d6b66..90faf2d6c3 100644 --- a/tests/phpunit/E2E/Core/AssetBuilderTest.php +++ b/tests/phpunit/E2E/Core/AssetBuilderTest.php @@ -17,7 +17,7 @@ class AssetBuilderTest extends \CiviEndToEndTestCase { /** * @inheritDoc */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); \Civi::service('asset_builder')->clear(); diff --git a/tests/phpunit/E2E/Core/PrevNextTest.php b/tests/phpunit/E2E/Core/PrevNextTest.php index fb598f6e7e..13cf2f1703 100644 --- a/tests/phpunit/E2E/Core/PrevNextTest.php +++ b/tests/phpunit/E2E/Core/PrevNextTest.php @@ -27,7 +27,7 @@ class PrevNextTest extends \CiviEndToEndTestCase { */ protected $prevNext; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->prevNext = \Civi::service('prevnext'); $this->cacheKey = 'PrevNextTest_' . \CRM_Utils_String::createRandom(16, \CRM_Utils_String::ALPHANUMERIC); diff --git a/tests/phpunit/E2E/Extern/SoapTest.php b/tests/phpunit/E2E/Extern/SoapTest.php index 530839337d..63a8c53553 100644 --- a/tests/phpunit/E2E/Extern/SoapTest.php +++ b/tests/phpunit/E2E/Extern/SoapTest.php @@ -30,7 +30,7 @@ class E2E_Extern_SoapTest extends CiviEndToEndTestCase { */ public $adminPass; - public function setUp() { + public function setUp(): void { CRM_Core_Config::singleton(1, 1); global $_CV; diff --git a/tests/phpunit/HelloTest.php b/tests/phpunit/HelloTest.php index 172d62f358..63c5eb344b 100644 --- a/tests/phpunit/HelloTest.php +++ b/tests/phpunit/HelloTest.php @@ -38,7 +38,7 @@ class HelloTest extends PHPUnit\Framework\TestCase { * this function is defined in PHPUnit_TestCase and overwritten * here */ - public function setUp() { + public function setUp(): void { // create a new instance of String with the // string 'abc' $this->abc = 'hello'; diff --git a/tests/phpunit/api/v4/Action/BaseCustomValueTest.php b/tests/phpunit/api/v4/Action/BaseCustomValueTest.php index fb58558be1..29adc87e37 100644 --- a/tests/phpunit/api/v4/Action/BaseCustomValueTest.php +++ b/tests/phpunit/api/v4/Action/BaseCustomValueTest.php @@ -32,7 +32,7 @@ abstract class BaseCustomValueTest extends UnitTestCase { /** * Set up baseline for testing */ - public function setUp() { + public function setUp(): void { $this->setUpOptionCleanup(); $cleanup_params = [ 'tablesToTruncate' => [ diff --git a/tests/phpunit/api/v4/Action/CreateWithOptionGroupTest.php b/tests/phpunit/api/v4/Action/CreateWithOptionGroupTest.php index 56cc775e35..11030b8f6e 100644 --- a/tests/phpunit/api/v4/Action/CreateWithOptionGroupTest.php +++ b/tests/phpunit/api/v4/Action/CreateWithOptionGroupTest.php @@ -31,7 +31,7 @@ class CreateWithOptionGroupTest extends BaseCustomValueTest { /** * Remove the custom tables */ - public function setUp() { + public function setUp(): void { $this->dropByPrefix('civicrm_value_financial'); $this->dropByPrefix('civicrm_value_favorite'); parent::setUp(); diff --git a/tests/phpunit/api/v4/Action/ReplaceTest.php b/tests/phpunit/api/v4/Action/ReplaceTest.php index 19883cddc4..1846cc5a74 100644 --- a/tests/phpunit/api/v4/Action/ReplaceTest.php +++ b/tests/phpunit/api/v4/Action/ReplaceTest.php @@ -36,7 +36,7 @@ class ReplaceTest extends UnitTestCase { /** * Set up baseline for testing */ - public function setUp() { + public function setUp(): void { $tablesToTruncate = [ 'civicrm_custom_group', 'civicrm_custom_field', diff --git a/tests/phpunit/api/v4/Entity/ConformanceTest.php b/tests/phpunit/api/v4/Entity/ConformanceTest.php index a0529cbd68..e9ec92d78e 100644 --- a/tests/phpunit/api/v4/Entity/ConformanceTest.php +++ b/tests/phpunit/api/v4/Entity/ConformanceTest.php @@ -41,7 +41,7 @@ class ConformanceTest extends UnitTestCase { /** * Set up baseline for testing */ - public function setUp() { + public function setUp(): void { $tablesToTruncate = [ 'civicrm_custom_group', 'civicrm_custom_field', diff --git a/tests/phpunit/api/v4/Entity/ParticipantTest.php b/tests/phpunit/api/v4/Entity/ParticipantTest.php index efc66ffe2b..76bbeda9a0 100644 --- a/tests/phpunit/api/v4/Entity/ParticipantTest.php +++ b/tests/phpunit/api/v4/Entity/ParticipantTest.php @@ -27,7 +27,7 @@ use api\v4\UnitTestCase; */ class ParticipantTest extends UnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $cleanup_params = [ 'tablesToTruncate' => [ diff --git a/tests/phpunit/api/v4/Entity/SystemRotateKeyTest.php b/tests/phpunit/api/v4/Entity/SystemRotateKeyTest.php index 5244fbd7fc..95785071a5 100644 --- a/tests/phpunit/api/v4/Entity/SystemRotateKeyTest.php +++ b/tests/phpunit/api/v4/Entity/SystemRotateKeyTest.php @@ -33,7 +33,7 @@ class RotateKeyTest extends UnitTestCase { /** * Set up baseline for testing */ - public function setUp() { + public function setUp(): void { parent::setUp(); \CRM_Utils_Hook::singleton()->setHook('civicrm_crypto', [$this, 'registerExampleKeys']); \CRM_Utils_Hook::singleton()->setHook('civicrm_cryptoRotateKey', [$this, 'onRotateKey']); diff --git a/tests/phpunit/api/v4/Traits/OptionCleanupTrait.php b/tests/phpunit/api/v4/Traits/OptionCleanupTrait.php index 52c012252d..4a29d0d7fb 100644 --- a/tests/phpunit/api/v4/Traits/OptionCleanupTrait.php +++ b/tests/phpunit/api/v4/Traits/OptionCleanupTrait.php @@ -30,7 +30,7 @@ trait OptionCleanupTrait { */ protected $optionValueMaxId; - public function setUp() { + public function setUp(): void { $this->optionGroupMaxId = \CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_option_group'); $this->optionValueMaxId = \CRM_Core_DAO::singleValueQuery('SELECT MAX(id) FROM civicrm_option_value'); } -- 2.25.1