From 11ba3ace33fc2030556788ba5a856c625f53a4dc Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 25 Mar 2021 14:51:27 +1300 Subject: [PATCH] Add :void return type to tearDown on a bunch of unit tests --- tests/phpunit/api/v3/ACLCachingTest.php | 2 +- tests/phpunit/api/v3/ACLPermissionTest.php | 2 +- tests/phpunit/api/v3/APIWrapperTest.php | 10 +--------- tests/phpunit/api/v3/ActivityTest.php | 4 ++-- tests/phpunit/api/v3/AddressTest.php | 2 +- tests/phpunit/api/v3/AttachmentTest.php | 2 +- tests/phpunit/api/v3/CRM11793Test.php | 2 +- tests/phpunit/api/v3/CaseTest.php | 2 +- tests/phpunit/api/v3/CaseTypeTest.php | 2 +- tests/phpunit/api/v3/ContributionPageTest.php | 2 +- tests/phpunit/api/v3/ContributionTest.php | 2 +- tests/phpunit/api/v3/CustomApiTest.php | 2 +- tests/phpunit/api/v3/CustomFieldTest.php | 2 +- tests/phpunit/api/v3/CustomGroupTest.php | 2 +- tests/phpunit/api/v3/CustomValueContactTypeTest.php | 2 +- tests/phpunit/api/v3/CustomValueTest.php | 2 +- tests/phpunit/api/v3/EventTest.php | 2 +- tests/phpunit/api/v3/ExtensionTest.php | 2 +- tests/phpunit/api/v3/FinancialTypeACLTest.php | 2 +- tests/phpunit/api/v3/GrantTest.php | 2 +- tests/phpunit/api/v3/GroupNestingTest.php | 2 +- tests/phpunit/api/v3/GroupTest.php | 4 ++-- tests/phpunit/api/v3/JobProcessMailingTest.php | 2 +- tests/phpunit/api/v3/JobProcessMembershipTest.php | 2 +- tests/phpunit/api/v3/JobTestCustomDataTest.php | 2 +- tests/phpunit/api/v3/LoggingTest.php | 2 +- tests/phpunit/api/v3/MailingContactTest.php | 2 +- tests/phpunit/api/v3/MailingTest.php | 2 +- tests/phpunit/api/v3/MembershipStatusTest.php | 2 +- tests/phpunit/api/v3/MembershipTest.php | 2 +- tests/phpunit/api/v3/MessageTemplateTest.php | 2 +- tests/phpunit/api/v3/MultilingualTest.php | 2 +- tests/phpunit/api/v3/OrderTest.php | 2 +- tests/phpunit/api/v3/ParticipantTest.php | 2 +- tests/phpunit/api/v3/PaymentProcessorTypeTest.php | 2 +- tests/phpunit/api/v3/PaymentTest.php | 2 +- tests/phpunit/api/v3/PledgePaymentTest.php | 2 +- tests/phpunit/api/v3/PledgeTest.php | 2 +- tests/phpunit/api/v3/PriceFieldTest.php | 2 +- tests/phpunit/api/v3/PriceFieldValueTest.php | 2 +- tests/phpunit/api/v3/ProfileTest.php | 2 +- tests/phpunit/api/v3/RelationshipTest.php | 2 +- tests/phpunit/api/v3/RelationshipTypeTest.php | 2 +- tests/phpunit/api/v3/ReportTemplateTest.php | 2 +- tests/phpunit/api/v3/SettingTest.php | 2 +- tests/phpunit/api/v3/SyntaxConformanceTest.php | 2 +- tests/phpunit/api/v3/TaxContributionPageTest.php | 2 +- tests/phpunit/api/v3/UFFieldTest.php | 2 +- tests/phpunit/api/v3/UFGroupTest.php | 2 +- tests/phpunit/api/v3/UFJoinTest.php | 2 +- tests/phpunit/api/v3/UFMatchTest.php | 2 +- 51 files changed, 53 insertions(+), 61 deletions(-) diff --git a/tests/phpunit/api/v3/ACLCachingTest.php b/tests/phpunit/api/v3/ACLCachingTest.php index be4674a0c0..5c0bc7f5d3 100644 --- a/tests/phpunit/api/v3/ACLCachingTest.php +++ b/tests/phpunit/api/v3/ACLCachingTest.php @@ -29,7 +29,7 @@ class api_v3_ACLCachingTest extends CiviUnitTestCase { * (non-PHPdoc) * @see CiviUnitTestCase::tearDown() */ - public function tearDown() { + public function tearDown(): void { $tablesToTruncate = [ 'civicrm_activity', ]; diff --git a/tests/phpunit/api/v3/ACLPermissionTest.php b/tests/phpunit/api/v3/ACLPermissionTest.php index f587ad13f9..b31278c940 100644 --- a/tests/phpunit/api/v3/ACLPermissionTest.php +++ b/tests/phpunit/api/v3/ACLPermissionTest.php @@ -39,7 +39,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { * (non-PHPdoc) * @see CiviUnitTestCase::tearDown() */ - public function tearDown() { + public function tearDown(): void { $this->cleanUpAfterACLs(); $tablesToTruncate = [ 'civicrm_contact', diff --git a/tests/phpunit/api/v3/APIWrapperTest.php b/tests/phpunit/api/v3/APIWrapperTest.php index 0d18b52106..2c0734927c 100644 --- a/tests/phpunit/api/v3/APIWrapperTest.php +++ b/tests/phpunit/api/v3/APIWrapperTest.php @@ -27,20 +27,12 @@ class api_v3_APIWrapperTest extends CiviUnitTestCase { * 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(); $this->useTransaction(TRUE); CRM_Utils_Hook_UnitTests::singleton()->setHook('civicrm_apiWrappers', [$this, 'onApiWrappers']); } - /** - * Tears down the fixture, for example, closes a network connection. - * This method is called after a test is executed. - */ - protected function tearDown() { - parent::tearDown(); - } - /** * @param $apiWrappers * @param $apiRequest diff --git a/tests/phpunit/api/v3/ActivityTest.php b/tests/phpunit/api/v3/ActivityTest.php index 2ab72b6b38..082f142714 100644 --- a/tests/phpunit/api/v3/ActivityTest.php +++ b/tests/phpunit/api/v3/ActivityTest.php @@ -59,7 +59,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * 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(); @@ -104,7 +104,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { * * This method is called after a test is executed. */ - public function tearDown() { + public function tearDown(): void { $tablesToTruncate = [ 'civicrm_contact', 'civicrm_activity', diff --git a/tests/phpunit/api/v3/AddressTest.php b/tests/phpunit/api/v3/AddressTest.php index 5e5e89c61a..83646351d8 100644 --- a/tests/phpunit/api/v3/AddressTest.php +++ b/tests/phpunit/api/v3/AddressTest.php @@ -48,7 +48,7 @@ class api_v3_AddressTest extends CiviUnitTestCase { ]; } - public function tearDown() { + public function tearDown(): void { $this->locationTypeDelete($this->_locationTypeID); $this->contactDelete($this->_contactID); $this->quickCleanup(['civicrm_address', 'civicrm_relationship']); diff --git a/tests/phpunit/api/v3/AttachmentTest.php b/tests/phpunit/api/v3/AttachmentTest.php index 346debc655..b13295dd25 100644 --- a/tests/phpunit/api/v3/AttachmentTest.php +++ b/tests/phpunit/api/v3/AttachmentTest.php @@ -53,7 +53,7 @@ class api_v3_AttachmentTest extends CiviUnitTestCase { file_put_contents($this->tmpFile('mytest.txt'), 'This comes from a file'); } - protected function tearDown() { + protected function tearDown(): void { parent::tearDown(); $this->cleanupFiles(); \Civi::reset(); diff --git a/tests/phpunit/api/v3/CRM11793Test.php b/tests/phpunit/api/v3/CRM11793Test.php index b83fcfaba0..f5bbbdda47 100644 --- a/tests/phpunit/api/v3/CRM11793Test.php +++ b/tests/phpunit/api/v3/CRM11793Test.php @@ -26,7 +26,7 @@ class api_v3_CRM11793Test extends CiviUnitTestCase { $this->organizationCreate(); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); } diff --git a/tests/phpunit/api/v3/CaseTest.php b/tests/phpunit/api/v3/CaseTest.php index 9b5bb920d2..edeb4739d5 100644 --- a/tests/phpunit/api/v3/CaseTest.php +++ b/tests/phpunit/api/v3/CaseTest.php @@ -80,7 +80,7 @@ class api_v3_CaseTest extends CiviCaseTestCase { $this->settingsStack = new \Civi\Core\SettingsStack(); } - public function tearDown() { + public function tearDown(): void { $this->settingsStack->popAll(); parent::tearDown(); } diff --git a/tests/phpunit/api/v3/CaseTypeTest.php b/tests/phpunit/api/v3/CaseTypeTest.php index 6039285761..5dfac71056 100644 --- a/tests/phpunit/api/v3/CaseTypeTest.php +++ b/tests/phpunit/api/v3/CaseTypeTest.php @@ -53,7 +53,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase { * * This method is called after a test is executed. */ - public function tearDown() { + public function tearDown(): void { parent::tearDown(); $this->quickCleanup(['civicrm_case_type', 'civicrm_uf_match']); } diff --git a/tests/phpunit/api/v3/ContributionPageTest.php b/tests/phpunit/api/v3/ContributionPageTest.php index c9f7317acb..f4b4562ef1 100644 --- a/tests/phpunit/api/v3/ContributionPageTest.php +++ b/tests/phpunit/api/v3/ContributionPageTest.php @@ -83,7 +83,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function tearDown() { + public function tearDown(): void { foreach ($this->contactIds as $id) { $this->callAPISuccess('contact', 'delete', ['id' => $id]); } diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index c3f95ad348..3a01ca7820 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -108,7 +108,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function tearDown() { + public function tearDown(): void { $this->quickCleanUpFinancialEntities(); $this->quickCleanup(['civicrm_uf_match'], TRUE); $financialAccounts = $this->callAPISuccess('FinancialAccount', 'get', []); diff --git a/tests/phpunit/api/v3/CustomApiTest.php b/tests/phpunit/api/v3/CustomApiTest.php index 2c78250848..6a2849b766 100644 --- a/tests/phpunit/api/v3/CustomApiTest.php +++ b/tests/phpunit/api/v3/CustomApiTest.php @@ -24,7 +24,7 @@ class api_v3_CustomApiTest extends CiviUnitTestCase { $this->installApi(); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); CRM_Core_DAO::executeQuery('DROP TABLE civicrm_mailing_provider_data'); } diff --git a/tests/phpunit/api/v3/CustomFieldTest.php b/tests/phpunit/api/v3/CustomFieldTest.php index 6ec1b9cee3..303a91d7c8 100644 --- a/tests/phpunit/api/v3/CustomFieldTest.php +++ b/tests/phpunit/api/v3/CustomFieldTest.php @@ -22,7 +22,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function tearDown() { + public function tearDown(): void { $this->quickCleanup([ 'civicrm_contact', 'civicrm_file', diff --git a/tests/phpunit/api/v3/CustomGroupTest.php b/tests/phpunit/api/v3/CustomGroupTest.php index e891f28eb0..03cb6a85d0 100644 --- a/tests/phpunit/api/v3/CustomGroupTest.php +++ b/tests/phpunit/api/v3/CustomGroupTest.php @@ -39,7 +39,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { parent::setUp(); } - public function tearDown() { + public function tearDown(): void { $tablesToTruncate = ['civicrm_custom_group', 'civicrm_custom_field']; // true tells quickCleanup to drop any tables that might have been created in the test $this->quickCleanup($tablesToTruncate, TRUE); diff --git a/tests/phpunit/api/v3/CustomValueContactTypeTest.php b/tests/phpunit/api/v3/CustomValueContactTypeTest.php index ac35bec145..2f012d9585 100644 --- a/tests/phpunit/api/v3/CustomValueContactTypeTest.php +++ b/tests/phpunit/api/v3/CustomValueContactTypeTest.php @@ -90,7 +90,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { CRM_Core_BAO_CustomField::getTableColumnGroup($this->IndiStudentField['id'], TRUE); } - public function tearDown() { + public function tearDown(): void { $tablesToTruncate = ['civicrm_contact', 'civicrm_cache']; $this->quickCleanup($tablesToTruncate, TRUE); } diff --git a/tests/phpunit/api/v3/CustomValueTest.php b/tests/phpunit/api/v3/CustomValueTest.php index 96ce2e42c0..6e54accb50 100644 --- a/tests/phpunit/api/v3/CustomValueTest.php +++ b/tests/phpunit/api/v3/CustomValueTest.php @@ -64,7 +64,7 @@ class api_v3_CustomValueTest extends CiviUnitTestCase { } - public function tearDown() { + public function tearDown(): void { $tablesToTruncate = [ 'civicrm_email', 'civicrm_custom_field', diff --git a/tests/phpunit/api/v3/EventTest.php b/tests/phpunit/api/v3/EventTest.php index abebea1d53..b52d3a693e 100644 --- a/tests/phpunit/api/v3/EventTest.php +++ b/tests/phpunit/api/v3/EventTest.php @@ -81,7 +81,7 @@ class api_v3_EventTest extends CiviUnitTestCase { } } - public function tearDown() { + public function tearDown(): void { foreach ($this->eventIds as $eventId) { $this->eventDelete($eventId); } diff --git a/tests/phpunit/api/v3/ExtensionTest.php b/tests/phpunit/api/v3/ExtensionTest.php index bcfc8f9f4b..18b371ff29 100644 --- a/tests/phpunit/api/v3/ExtensionTest.php +++ b/tests/phpunit/api/v3/ExtensionTest.php @@ -27,7 +27,7 @@ class api_v3_ExtensionTest extends CiviUnitTestCase { Civi::settings()->set('ext_repo_url', $url); } - public function tearDown() { + public function tearDown(): void { Civi::settings()->revert('ext_repo_url'); } diff --git a/tests/phpunit/api/v3/FinancialTypeACLTest.php b/tests/phpunit/api/v3/FinancialTypeACLTest.php index e78f9fe5cb..8ed31ec8cf 100644 --- a/tests/phpunit/api/v3/FinancialTypeACLTest.php +++ b/tests/phpunit/api/v3/FinancialTypeACLTest.php @@ -91,7 +91,7 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { * * @throws \Exception */ - public function tearDown() { + public function tearDown(): void { $this->quickCleanUpFinancialEntities(); $this->quickCleanup(['civicrm_uf_match']); $this->disableFinancialACLs(); diff --git a/tests/phpunit/api/v3/GrantTest.php b/tests/phpunit/api/v3/GrantTest.php index d0c3707606..5415759a48 100644 --- a/tests/phpunit/api/v3/GrantTest.php +++ b/tests/phpunit/api/v3/GrantTest.php @@ -44,7 +44,7 @@ class api_v3_GrantTest extends CiviUnitTestCase { * * @throws \Exception */ - public function tearDown() { + public function tearDown(): void { foreach ($this->ids as $entity => $entities) { foreach ($entities as $id) { $this->callAPISuccess($entity, 'delete', ['id' => $id]); diff --git a/tests/phpunit/api/v3/GroupNestingTest.php b/tests/phpunit/api/v3/GroupNestingTest.php index b3a9514648..08c5f9fbbd 100644 --- a/tests/phpunit/api/v3/GroupNestingTest.php +++ b/tests/phpunit/api/v3/GroupNestingTest.php @@ -55,7 +55,7 @@ class api_v3_GroupNestingTest extends CiviUnitTestCase { * * @throws \Exception */ - protected function tearDown() { + protected function tearDown(): void { $this->quickCleanup( [ 'civicrm_group', diff --git a/tests/phpunit/api/v3/GroupTest.php b/tests/phpunit/api/v3/GroupTest.php index f6edd05bc3..4a9f8aa211 100644 --- a/tests/phpunit/api/v3/GroupTest.php +++ b/tests/phpunit/api/v3/GroupTest.php @@ -22,7 +22,7 @@ class api_v3_GroupTest extends CiviUnitTestCase { /** * Set up for tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_groupID = $this->groupCreate(); $config = CRM_Core_Config::singleton(); @@ -34,7 +34,7 @@ class api_v3_GroupTest extends CiviUnitTestCase { * * @throws \Exception */ - public function tearDown() { + public function tearDown(): void { CRM_Utils_Hook::singleton()->reset(); $config = CRM_Core_Config::singleton(); unset($config->userPermissionClass->permissions); diff --git a/tests/phpunit/api/v3/JobProcessMailingTest.php b/tests/phpunit/api/v3/JobProcessMailingTest.php index 163ef35b21..5fb1a37479 100644 --- a/tests/phpunit/api/v3/JobProcessMailingTest.php +++ b/tests/phpunit/api/v3/JobProcessMailingTest.php @@ -80,7 +80,7 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { /** */ - public function tearDown() { + public function tearDown(): void { $this->_mut->stop(); CRM_Utils_Hook::singleton()->reset(); $this->cleanupMailingTest(); diff --git a/tests/phpunit/api/v3/JobProcessMembershipTest.php b/tests/phpunit/api/v3/JobProcessMembershipTest.php index e0eaccbd54..1d172816c1 100644 --- a/tests/phpunit/api/v3/JobProcessMembershipTest.php +++ b/tests/phpunit/api/v3/JobProcessMembershipTest.php @@ -95,7 +95,7 @@ class api_v3_JobProcessMembershipTest extends CiviUnitTestCase { $this->_tomorrow = date('Y-m-d', time() + 60 * 60 * 24); } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); // For each case, the `old` membershipt type must start as diff --git a/tests/phpunit/api/v3/JobTestCustomDataTest.php b/tests/phpunit/api/v3/JobTestCustomDataTest.php index 33062c5848..2a971eb634 100644 --- a/tests/phpunit/api/v3/JobTestCustomDataTest.php +++ b/tests/phpunit/api/v3/JobTestCustomDataTest.php @@ -111,7 +111,7 @@ class api_v3_JobTestCustomDataTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function tearDown() { + public function tearDown(): void { $this->quickCleanup(['civicrm_contact'], TRUE); parent::tearDown(); } diff --git a/tests/phpunit/api/v3/LoggingTest.php b/tests/phpunit/api/v3/LoggingTest.php index e2f6cbd5e2..0e6867edbb 100644 --- a/tests/phpunit/api/v3/LoggingTest.php +++ b/tests/phpunit/api/v3/LoggingTest.php @@ -30,7 +30,7 @@ class api_v3_LoggingTest extends CiviUnitTestCase { /** * Clean up log tables. */ - protected function tearDown() { + protected function tearDown(): void { $this->quickCleanup(['civicrm_email', 'civicrm_address']); parent::tearDown(); $this->callAPISuccess('Setting', 'create', ['logging' => FALSE]); diff --git a/tests/phpunit/api/v3/MailingContactTest.php b/tests/phpunit/api/v3/MailingContactTest.php index 0000fcf4fd..5d71833467 100644 --- a/tests/phpunit/api/v3/MailingContactTest.php +++ b/tests/phpunit/api/v3/MailingContactTest.php @@ -36,7 +36,7 @@ class api_v3_MailingContactTest extends CiviUnitTestCase { $this->_contact = $this->callAPISuccess("contact", "create", $params); } - public function tearDown() { + public function tearDown(): void { $this->callAPISuccess("contact", "delete", ['id' => $this->_contact['id']]); parent::tearDown(); } diff --git a/tests/phpunit/api/v3/MailingTest.php b/tests/phpunit/api/v3/MailingTest.php index bbf99310ab..163747c60e 100644 --- a/tests/phpunit/api/v3/MailingTest.php +++ b/tests/phpunit/api/v3/MailingTest.php @@ -70,7 +70,7 @@ class api_v3_MailingTest extends CiviUnitTestCase { ]); } - public function tearDown() { + public function tearDown(): void { // DGW CRM_Mailing_BAO_MailingJob::$mailsProcessed = 0; parent::tearDown(); diff --git a/tests/phpunit/api/v3/MembershipStatusTest.php b/tests/phpunit/api/v3/MembershipStatusTest.php index fbdf71a43e..f04553c573 100644 --- a/tests/phpunit/api/v3/MembershipStatusTest.php +++ b/tests/phpunit/api/v3/MembershipStatusTest.php @@ -36,7 +36,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function tearDown() { + public function tearDown(): void { $this->membershipStatusDelete($this->_membershipStatusID); $this->membershipTypeDelete(['id' => $this->_membershipTypeID]); $this->contactDelete($this->_contactID); diff --git a/tests/phpunit/api/v3/MembershipTest.php b/tests/phpunit/api/v3/MembershipTest.php index 4550d1eff1..ac6622bf5b 100644 --- a/tests/phpunit/api/v3/MembershipTest.php +++ b/tests/phpunit/api/v3/MembershipTest.php @@ -76,7 +76,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { * * @throws \Exception */ - public function tearDown() { + public function tearDown(): void { $this->quickCleanUpFinancialEntities(); $this->quickCleanup(['civicrm_uf_match'], TRUE); $this->contactDelete($this->_contactID); diff --git a/tests/phpunit/api/v3/MessageTemplateTest.php b/tests/phpunit/api/v3/MessageTemplateTest.php index 34e10d86bc..a1f77690cd 100644 --- a/tests/phpunit/api/v3/MessageTemplateTest.php +++ b/tests/phpunit/api/v3/MessageTemplateTest.php @@ -36,7 +36,7 @@ class api_v3_MessageTemplateTest extends CiviUnitTestCase { ]; } - public function tearDown() { + public function tearDown(): void { parent::tearDown(); unset(CRM_Core_Config::singleton()->userPermissionClass->permissions); } diff --git a/tests/phpunit/api/v3/MultilingualTest.php b/tests/phpunit/api/v3/MultilingualTest.php index 7c23093bd6..5690cc8662 100644 --- a/tests/phpunit/api/v3/MultilingualTest.php +++ b/tests/phpunit/api/v3/MultilingualTest.php @@ -29,7 +29,7 @@ class api_v3_MultilingualTest extends CiviUnitTestCase { $this->useTransaction(TRUE); } - public function tearDown() { + public function tearDown(): void { CRM_Core_I18n_Schema::makeSinglelingual('en_US'); parent::tearDown(); } diff --git a/tests/phpunit/api/v3/OrderTest.php b/tests/phpunit/api/v3/OrderTest.php index 55856dd122..d51e1c732e 100644 --- a/tests/phpunit/api/v3/OrderTest.php +++ b/tests/phpunit/api/v3/OrderTest.php @@ -39,7 +39,7 @@ class api_v3_OrderTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function tearDown() { + public function tearDown(): void { $this->quickCleanUpFinancialEntities(); $this->quickCleanup(['civicrm_uf_match']); } diff --git a/tests/phpunit/api/v3/ParticipantTest.php b/tests/phpunit/api/v3/ParticipantTest.php index 6c485116b4..8d09b7603b 100644 --- a/tests/phpunit/api/v3/ParticipantTest.php +++ b/tests/phpunit/api/v3/ParticipantTest.php @@ -68,7 +68,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { ]; } - public function tearDown() { + public function tearDown(): void { $this->eventDelete($this->_eventID); $tablesToTruncate = [ 'civicrm_custom_group', diff --git a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php index cd5760a5ac..a97e61ce4c 100644 --- a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php +++ b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php @@ -23,7 +23,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { $this->useTransaction(TRUE); } - // function tearDown() { + // function tearDown(): void { // // $tablesToTruncate = array( // 'civicrm_payment_processor_type', diff --git a/tests/phpunit/api/v3/PaymentTest.php b/tests/phpunit/api/v3/PaymentTest.php index ad9f744763..659e33d82a 100644 --- a/tests/phpunit/api/v3/PaymentTest.php +++ b/tests/phpunit/api/v3/PaymentTest.php @@ -40,7 +40,7 @@ class api_v3_PaymentTest extends CiviUnitTestCase { * * @throws \Exception */ - public function tearDown() { + public function tearDown(): void { $this->quickCleanUpFinancialEntities(); $this->quickCleanup(['civicrm_uf_match']); unset(CRM_Core_Config::singleton()->userPermissionClass->permissions); diff --git a/tests/phpunit/api/v3/PledgePaymentTest.php b/tests/phpunit/api/v3/PledgePaymentTest.php index f3a374335b..1bd7016e0b 100644 --- a/tests/phpunit/api/v3/PledgePaymentTest.php +++ b/tests/phpunit/api/v3/PledgePaymentTest.php @@ -39,7 +39,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { * Clean up after function. * @throws \CRM_Core_Exception */ - public function tearDown() { + public function tearDown(): void { $tablesToTruncate = [ 'civicrm_contribution', 'civicrm_contact', diff --git a/tests/phpunit/api/v3/PledgeTest.php b/tests/phpunit/api/v3/PledgeTest.php index f624c6ba09..426c2987eb 100644 --- a/tests/phpunit/api/v3/PledgeTest.php +++ b/tests/phpunit/api/v3/PledgeTest.php @@ -52,7 +52,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { ]; } - public function tearDown() { + public function tearDown(): void { $this->contactDelete($this->_individualId); } diff --git a/tests/phpunit/api/v3/PriceFieldTest.php b/tests/phpunit/api/v3/PriceFieldTest.php index c4c6ec7f44..bfde926bc4 100644 --- a/tests/phpunit/api/v3/PriceFieldTest.php +++ b/tests/phpunit/api/v3/PriceFieldTest.php @@ -56,7 +56,7 @@ class api_v3_PriceFieldTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function tearDown() { + public function tearDown(): void { $tablesToTruncate = [ 'civicrm_contact', 'civicrm_contribution', diff --git a/tests/phpunit/api/v3/PriceFieldValueTest.php b/tests/phpunit/api/v3/PriceFieldValueTest.php index dca3b97ab2..4f11b37639 100644 --- a/tests/phpunit/api/v3/PriceFieldValueTest.php +++ b/tests/phpunit/api/v3/PriceFieldValueTest.php @@ -96,7 +96,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase { * * @throws \Exception */ - public function tearDown() { + public function tearDown(): void { $tablesToTruncate = [ 'civicrm_contact', 'civicrm_contribution', diff --git a/tests/phpunit/api/v3/ProfileTest.php b/tests/phpunit/api/v3/ProfileTest.php index 094bfcb7ad..0d5d3a4e03 100644 --- a/tests/phpunit/api/v3/ProfileTest.php +++ b/tests/phpunit/api/v3/ProfileTest.php @@ -43,7 +43,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { * * @throws \Exception */ - public function tearDown() { + public function tearDown(): void { $this->quickCleanup([ 'civicrm_contact', diff --git a/tests/phpunit/api/v3/RelationshipTest.php b/tests/phpunit/api/v3/RelationshipTest.php index 94b2899a04..64a3c98134 100644 --- a/tests/phpunit/api/v3/RelationshipTest.php +++ b/tests/phpunit/api/v3/RelationshipTest.php @@ -79,7 +79,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { * * @throws \Exception */ - public function tearDown() { + public function tearDown(): void { $this->contactDelete($this->_cId_a); $this->contactDelete($this->_cId_a_2); $this->contactDelete($this->_cId_b); diff --git a/tests/phpunit/api/v3/RelationshipTypeTest.php b/tests/phpunit/api/v3/RelationshipTypeTest.php index b9b4f6706a..88334e050f 100644 --- a/tests/phpunit/api/v3/RelationshipTypeTest.php +++ b/tests/phpunit/api/v3/RelationshipTypeTest.php @@ -27,7 +27,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { $this->_cId_b = $this->organizationCreate(); } - public function tearDown() { + public function tearDown(): void { $tablesToTruncate = [ 'civicrm_contact', diff --git a/tests/phpunit/api/v3/ReportTemplateTest.php b/tests/phpunit/api/v3/ReportTemplateTest.php index 5335a8eb53..2076fd3ee1 100644 --- a/tests/phpunit/api/v3/ReportTemplateTest.php +++ b/tests/phpunit/api/v3/ReportTemplateTest.php @@ -29,7 +29,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { * * @throws \Exception */ - public function tearDown() { + public function tearDown(): void { $this->quickCleanUpFinancialEntities(); $this->quickCleanup(['civicrm_group', 'civicrm_saved_search', 'civicrm_group_contact', 'civicrm_group_contact_cache', 'civicrm_group'], TRUE); parent::tearDown(); diff --git a/tests/phpunit/api/v3/SettingTest.php b/tests/phpunit/api/v3/SettingTest.php index f75f46207a..427b2f1cee 100644 --- a/tests/phpunit/api/v3/SettingTest.php +++ b/tests/phpunit/api/v3/SettingTest.php @@ -50,7 +50,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { $this->hookClass = CRM_Utils_Hook::singleton(); } - public function tearDown() { + public function tearDown(): void { CRM_Utils_Hook::singleton()->reset(); parent::tearDown(); $this->callAPISuccess('system', 'flush', []); diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index afffa613bf..a1d2e656fe 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -132,7 +132,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { $this->deletableTestObjects = []; } - public function tearDown() { + public function tearDown(): void { foreach ($this->deletableTestObjects as $entityName => $entities) { foreach ($entities as $entityID) { CRM_Core_DAO::deleteTestObjects($entityName, ['id' => $entityID]); diff --git a/tests/phpunit/api/v3/TaxContributionPageTest.php b/tests/phpunit/api/v3/TaxContributionPageTest.php index 2e040467de..0010e84542 100644 --- a/tests/phpunit/api/v3/TaxContributionPageTest.php +++ b/tests/phpunit/api/v3/TaxContributionPageTest.php @@ -128,7 +128,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { /** * Cleanup after function. */ - public function tearDown() { + public function tearDown(): void { $this->quickCleanUpFinancialEntities(); parent::tearDown(); } diff --git a/tests/phpunit/api/v3/UFFieldTest.php b/tests/phpunit/api/v3/UFFieldTest.php index 15ef6ec1be..3e667cce4f 100644 --- a/tests/phpunit/api/v3/UFFieldTest.php +++ b/tests/phpunit/api/v3/UFFieldTest.php @@ -73,7 +73,7 @@ class api_v3_UFFieldTest extends CiviUnitTestCase { * * @throws \Exception */ - public function tearDown() { + public function tearDown(): void { $this->quickCleanup( [ 'civicrm_group', diff --git a/tests/phpunit/api/v3/UFGroupTest.php b/tests/phpunit/api/v3/UFGroupTest.php index be06e412fe..f6a52f25f9 100644 --- a/tests/phpunit/api/v3/UFGroupTest.php +++ b/tests/phpunit/api/v3/UFGroupTest.php @@ -68,7 +68,7 @@ class api_v3_UFGroupTest extends CiviUnitTestCase { ]; } - public function tearDown() { + public function tearDown(): void { // Truncate the tables $this->quickCleanup( [ diff --git a/tests/phpunit/api/v3/UFJoinTest.php b/tests/phpunit/api/v3/UFJoinTest.php index 71f04a1bd1..a82392a761 100644 --- a/tests/phpunit/api/v3/UFJoinTest.php +++ b/tests/phpunit/api/v3/UFJoinTest.php @@ -40,7 +40,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { $this->loadXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml'); } - public function tearDown() { + public function tearDown(): void { // Truncate the tables $this->quickCleanup( [ diff --git a/tests/phpunit/api/v3/UFMatchTest.php b/tests/phpunit/api/v3/UFMatchTest.php index 2e1d50901e..8bb74325f8 100644 --- a/tests/phpunit/api/v3/UFMatchTest.php +++ b/tests/phpunit/api/v3/UFMatchTest.php @@ -48,7 +48,7 @@ class api_v3_UFMatchTest extends CiviUnitTestCase { ]; } - public function tearDown() { + public function tearDown(): void { // Truncate the tables $this->quickCleanup( [ -- 2.25.1