[PHPUNIT 8 ] Add void to more teardowns
authoreileen <emcnaughton@wikimedia.org>
Thu, 25 Mar 2021 02:17:49 +0000 (15:17 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 25 Mar 2021 02:17:49 +0000 (15:17 +1300)
41 files changed:
tests/phpunit/CRM/Extension/InfoTest.php
tests/phpunit/CRM/Extension/Manager/ModuleTest.php
tests/phpunit/CRM/Extension/Manager/PaymentTest.php
tests/phpunit/CRM/Extension/Manager/SearchTest.php
tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php
tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php
tests/phpunit/CRM/Financial/Form/PaymentEditTest.php
tests/phpunit/CRM/Group/Page/AjaxTest.php
tests/phpunit/CRM/Logging/LoggingTest.php
tests/phpunit/CRM/Logging/SchemaTest.php
tests/phpunit/CRM/Mailing/BAO/MailingTest.php
tests/phpunit/CRM/Mailing/BAO/QueryTest.php
tests/phpunit/CRM/Mailing/BAO/SpoolTest.php
tests/phpunit/CRM/Mailing/BaseMailingSystemTest.php
tests/phpunit/CRM/Mailing/MailStoreTest.php
tests/phpunit/CRM/Mailing/MailingSystemTest.php
tests/phpunit/CRM/Member/BAO/MembershipLogTest.php
tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php
tests/phpunit/CRM/Member/BAO/MembershipTest.php
tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php
tests/phpunit/CRM/Member/Form/MembershipTest.php
tests/phpunit/CRM/Member/Form/Task/BatchTest.php
tests/phpunit/CRM/Member/Form/Task/PDFLetterCommonTest.php
tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php
tests/phpunit/CRM/PCP/BAO/PCPTest.php
tests/phpunit/CRM/Pledge/Form/SearchTest.php
tests/phpunit/CRM/Queue/Queue/SqlTest.php
tests/phpunit/CRM/Queue/QueueTest.php
tests/phpunit/CRM/Queue/RunnerTest.php
tests/phpunit/CRM/Report/Form/ActivityTest.php
tests/phpunit/CRM/SMS/BAO/ProviderTest.php
tests/phpunit/CRM/SMS/PreviewTest.php
tests/phpunit/CRM/SMS/ProviderTest.php
tests/phpunit/CRM/Upgrade/Incremental/BaseTest.php
tests/phpunit/CRM/Utils/API/MatchOptionTest.php
tests/phpunit/CRM/Utils/HookTest.php
tests/phpunit/CRM/Utils/HttpClientTest.php
tests/phpunit/CRM/Utils/Mail/EmailProcessorInboundTest.php
tests/phpunit/CRM/Utils/Mail/EmailProcessorTest.php
tests/phpunit/CRM/Utils/Migrate/ImportExportTest.php
tests/phpunit/CRM/Utils/ZipTest.php

index 77b46076aca5b5a13dcb8c87e0239b481476e283..a6d0e9b44d506b24033e47bcd4ab7d9ff91ed72e 100644 (file)
@@ -11,7 +11,7 @@ class CRM_Extension_InfoTest extends CiviUnitTestCase {
     $this->file = NULL;
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     if ($this->file) {
       unlink($this->file);
     }
index f9a587d806b28edca952bdc4f0ff696ecb58ab7a..847337cdde154478ea2e80b076dd27dcb1269f0e 100644 (file)
@@ -20,7 +20,7 @@ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase {
     $this->setExtensionSystem($this->system);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     parent::tearDown();
     $this->system = NULL;
   }
index a4b7d947d2d81a9e5cb885a952b0445930d2958d..d6bffc10e002b5296f28245c0d4a7acda436f15d 100644 (file)
@@ -27,7 +27,7 @@ class CRM_Extension_Manager_PaymentTest extends CiviUnitTestCase {
     $this->quickCleanup(['civicrm_payment_processor']);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     parent::tearDown();
     $this->system = NULL;
     $this->quickCleanup(['civicrm_payment_processor']);
index 1f4e5964c8154a76883473d8b10fa303961195d0..ee4ec46433983366eedee6304807c64c9f5dff6a 100644 (file)
@@ -17,7 +17,7 @@ class CRM_Extension_Manager_SearchTest extends CiviUnitTestCase {
     ]);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     parent::tearDown();
     $this->system = NULL;
   }
index 7be8734bbbcd84237cfcfbdb4a6f7f56445b59f4..0d016f900714e18dafc1cffbaaa6125d3a5595d9 100644 (file)
@@ -22,7 +22,7 @@ class CRM_Financial_BAO_FinancialItemTest extends CiviUnitTestCase {
   /**
    * Clean up after each test.
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $this->quickCleanUpFinancialEntities();
     parent::tearDown();
   }
index 5bb226dff488feb8c86928d95cc3043e9efdeb05..a2d0b4a451a462c8a73f8533aac90e1c65b3c539 100644 (file)
@@ -20,7 +20,7 @@ class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase {
     $this->_orgContactID = $this->organizationCreate();
   }
 
-  public function teardown() {
+  public function tearDown(): void {
     global $dbLocale;
     if ($dbLocale) {
       CRM_Core_I18n_Schema::makeSinglelingual('en_US');
index c300732d54fb3e0936ee797dc0b83bf56d60ff9c..39042cfb40cc691ee20e5e93be31f6c33a55af89 100644 (file)
@@ -31,7 +31,7 @@ class CRM_Financial_Form_PaymentEditTest extends CiviUnitTestCase {
    *
    * @throws \CRM_Core_Exception
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $this->quickCleanUpFinancialEntities();
     $this->quickCleanup(['civicrm_note', 'civicrm_uf_match', 'civicrm_address']);
   }
index 6eb09d8bb125671efa024ece393a6fdda906a0aa..5237cf2bfc5ce48235349c897d3948c175fcc15d 100644 (file)
@@ -51,7 +51,7 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase {
     $this->groupCreate(['title' => 'not-me-active', 'is_active' => 1, 'name' => 'not-me-active']);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     CRM_Utils_Hook::singleton()->reset();
     $this->quickCleanup(['civicrm_group']);
     $config = CRM_Core_Config::singleton();
index 562450aaa4d96dfcbe5539ea3428422f2bc6e638..c2623dd7e113223c1f12c038a744898e42693265 100644 (file)
@@ -10,7 +10,7 @@ class CRM_Logging_LoggingTest extends CiviUnitTestCase {
     parent::setUp();
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     CRM_Core_I18n_Schema::makeSinglelingual('en_US');
     $logging = new CRM_Logging_Schema();
     $logging->dropAllLogTables();
index 5b4c3ebe4cdf76ccb45265ee52d2e6d93b1b64af..110c6ffcc2a01b6e7fedb46cece679e61110c5f9 100644 (file)
@@ -18,7 +18,7 @@ class CRM_Logging_SchemaTest extends CiviUnitTestCase {
    *
    * @throws \CRM_Core_Exception
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $schema = new CRM_Logging_Schema();
     $schema->disableLogging();
     $this->databaseVersion = NULL;
index acf200c46615a092b0311d7bac98c0006936e8ff..69b039002d77eaa298ebec632b8b5ce5c1bba4c0 100644 (file)
@@ -20,7 +20,7 @@ class CRM_Mailing_BAO_MailingTest extends CiviUnitTestCase {
     parent::setUp();
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     global $dbLocale;
     if ($dbLocale) {
       CRM_Core_I18n_Schema::makeSinglelingual('en_US');
index f5fcd8292cc26298def1f4cc84762e89f67137e2..218753b795d541c75f5dc4845447472d14c5af04 100644 (file)
@@ -17,7 +17,7 @@ class CRM_Mailing_BAO_QueryTest extends CiviUnitTestCase {
     parent::setUp();
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     $tablesToTruncate = [
       'civicrm_mailing_event_bounce',
       'civicrm_mailing_event_delivered',
index b23abe5aef05e15bef1183d247caae7d9c3e3f29..ae5be6bf09ce6f5cf4264bdd1e4e0cd02b3680a6 100644 (file)
@@ -19,7 +19,7 @@ class CRM_Mailing_BAO_SpoolTest extends CiviUnitTestCase {
     $this->_mut = new CiviMailUtils($this, TRUE);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     $this->_mut->stop();
     parent::tearDown();
   }
index 87670df9ff48505d3d7d8bee8493c0714f7fbaa3..f83d444e48d8c60148664c633edbef01ac617dd7 100644 (file)
@@ -57,7 +57,7 @@ abstract class CRM_Mailing_BaseMailingSystemTest extends CiviUnitTestCase {
 
   /**
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $this->_mut->stop();
     CRM_Utils_Hook::singleton()->reset();
     // DGW
index ba982b9d3542f526d3a532ced6dcd17e3f91591b..e4a549ff8ca68959b596549d1b7724d97ff80904 100644 (file)
@@ -14,7 +14,7 @@ class CRM_Mailing_MailStoreTest extends \CiviUnitTestCase {
     @unlink($this->workDir);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     parent::tearDown();
     if (is_dir($this->workDir)) {
       CRM_Utils_File::cleanDir($this->workDir);
index b1846cee7eea0c572106079a4e193aa39d5852ab..d80982020ec50ae0c12acddb7042079abfcad5fb 100644 (file)
@@ -55,7 +55,7 @@ class CRM_Mailing_MailingSystemTest extends CRM_Mailing_BaseMailingSystemTest {
     $this->assertEquals('civimail', $context);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     global $dbLocale;
     if ($dbLocale) {
       CRM_Core_I18n_Schema::makeSinglelingual('en_US');
index 9322190ad90f174e05c939f91012fc8f05ff42e1..541b1d0cf45f37cede11d68a6ecb6880bfd1228d 100644 (file)
@@ -101,7 +101,7 @@ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase {
    *
    * @throws \CRM_Core_Exception
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $this->relationshipTypeDelete($this->relationshipTypeID);
     $this->quickCleanUpFinancialEntities();
     $this->restoreMembershipTypes();
index f413ffd22b7c4dba4b5078cda9b6cd1795bdfcd6..156b40ed7d74e7eb060cd40fda4528984ea6eb5c 100644 (file)
@@ -15,7 +15,7 @@
  */
 class CRM_Member_BAO_MembershipStatusTest extends CiviUnitTestCase {
 
-  protected function tearDown() {
+  protected function tearDown(): void {
     foreach ($this->ids as $entity => $ids) {
       foreach ($ids as $id) {
         $this->callAPISuccess($entity, 'Delete', ['id' => $id]);
index 83c6bbbc3d95fe31ea75cc3cd23b83547b0ab0bd..ad5c9a1b0961f73cd98f4c12a18e501db9b64974 100644 (file)
@@ -34,7 +34,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
    *
    * @throws \CRM_Core_Exception
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $this->membershipTypeDelete(['id' => $this->_membershipTypeID]);
     $this->membershipStatusDelete($this->_membershipStatusID);
     $this->contactDelete($this->_contactID);
index c7d855562d4ecddef2452f6621bdeeb957e10b17..0193316765d44168fdce6ee1660d71b4b1c7e914 100644 (file)
@@ -40,7 +40,7 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase {
    * Tears down the fixture, for example, closes a network connection.
    * This method is called after a test is executed.
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $this->relationshipTypeDelete($this->_relationshipTypeId);
     $this->membershipStatusDelete($this->_membershipStatusID);
     $this->contactDelete($this->_orgContactID);
index bf80c7d6ada9775966a7ee3c76792bd61296d9a6..c85d66598e4fb96157854b0eb42f52c029184c95 100644 (file)
@@ -157,7 +157,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
    *
    * @throws \CRM_Core_Exception
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $this->quickCleanUpFinancialEntities();
     $this->quickCleanup(
       [
index ce464ce4973dc546c45548c51c54e8c2d8e525c0..6a867170f8aee6197d321603d71f4bba8a7cf50a 100644 (file)
@@ -23,7 +23,7 @@ class CRM_Member_Form_Task_BatchTest extends CiviUnitTestCase {
    *
    * @throws \CRM_Core_Exception
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $this->validateAllContributions();
     $this->validateAllPayments();
     $this->quickCleanUpFinancialEntities();
index cd9e2ee6e5dd540b0ace1c627bcd266e0cb54737..a2d14a194217a5dddcaf21941508eace7df457da 100644 (file)
@@ -19,7 +19,7 @@ class CRM_Member_Form_Task_PDFLetterCommonTest extends CiviUnitTestCase {
   /**
    * Clean up after each test.
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $this->quickCleanUpFinancialEntities();
     CRM_Utils_Hook::singleton()->reset();
   }
index 59de09c1ce9f2f2847ed6f25939f4cc4d51d0536..8fd040a7b464a20fa9c4c17d813906f55d57dfb4 100644 (file)
@@ -96,7 +96,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase {
    *
    * @throws \CRM_Core_Exception
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $tablesToTruncate = [
       'civicrm_membership',
       'civicrm_membership_log',
index 267b33d5db133676eebae0fa3bd779968d27d795..798647f46723fab45d0630d2c3bc696fb8a43f2e 100644 (file)
@@ -24,7 +24,7 @@ class CRM_PCP_BAO_PCPTest extends CiviUnitTestCase {
    *
    * @throws \CRM_Core_Exception
    */
-  public function tearDown() {
+  public function tearDown(): void {
     $this->quickCleanUpFinancialEntities();
     parent::tearDown();
   }
index d8bba2d71ce46ff514d366fe41746aad804e69c8..0ff0e7750ebd55e4b84f3d6b8b7192094ec8c73c 100644 (file)
@@ -12,7 +12,7 @@ class CRM_Pledge_Form_SearchTest extends CiviUnitTestCase {
     $this->pledgeCreate(['contact_id' => $this->individualID]);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     parent::tearDown();
     $tablesToTruncate = [
       'civicrm_activity',
index 559f2b5b997b0b04f31a454485c01b9422a60810..c7a4dccad490f65cb94c62177eabd9f934abb58e 100644 (file)
@@ -44,7 +44,7 @@ class CRM_Queue_Queue_SqlTest extends CiviUnitTestCase {
     $this->queueService = CRM_Queue_Service::singleton(TRUE);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     CRM_Utils_Time::resetTime();
 
     $tablesToTruncate = ['civicrm_queue_item'];
index 6578645299aca9c54dac94c81889922d05d78699..8b114d402caf07217c4d5476fb9d959357d0a2fb 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Queue_QueueTest extends CiviUnitTestCase {
     $this->queueService = CRM_Queue_Service::singleton(TRUE);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     CRM_Utils_Time::resetTime();
 
     $tablesToTruncate = ['civicrm_queue_item'];
index f82d2c79c86b3c00dde5aafbf97a2cb9fde8eb66..f8dde4382ee83ee90aa04d4de4bde7baf0899264 100644 (file)
@@ -25,7 +25,7 @@ class CRM_Queue_RunnerTest extends CiviUnitTestCase {
     self::$_recordedValues = [];
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     unset($this->queue);
     unset($this->queueService);
 
index ae2ba0119ed95fea7ba3b82ee4572c6facc1f06e..97848fa4e1c0801002fda26e2cbc457451e386a3 100644 (file)
@@ -28,7 +28,7 @@ class CRM_Report_Form_ActivityTest extends CiviReportTestCase {
     $this->quickCleanup($this->_tablesToTruncate);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     parent::tearDown();
     CRM_Core_DAO::executeQuery('DROP TEMPORARY TABLE IF EXISTS civireport_activity_temp_target');
   }
index 17a61c2feadbd8cd7861ac52d19cd4197e01c4f5..105193a2909b6990d3d0ff2832c3ff077f2dd3bc 100644 (file)
@@ -30,7 +30,7 @@ class CRM_SMS_BAO_ProviderTest extends CiviUnitTestCase {
   /**
    * Clean up after each test.
    */
-  public function tearDown() {
+  public function tearDown(): void {
     parent::tearDown();
     $this->callAPISuccess('option_value', 'delete', ['id' => $this->option_value]);
   }
index dfe82711c3f427e2dc13226473a1eeb246ef493e..ce45dfa728a2a0f261f389ef3e170e9f77cb36ce 100644 (file)
@@ -19,7 +19,7 @@ class CRM_SMS_PreviewTest extends CiviUnitTestCase {
   /**
    * Clean up after each test.
    */
-  public function tearDown() {
+  public function tearDown(): void {
     parent::tearDown();
     $this->callAPISuccess('option_value', 'delete', ['id' => $this->option_value]);
   }
index 877b2f9a4918e60ed3d6b6daf5a08a180e3ff89f..a1921f330b90a8208282478d0a783398785d45ad 100644 (file)
@@ -32,7 +32,7 @@ class CRM_SMS_ProviderTest extends CiviUnitTestCase {
   /**
    * Clean up after each test.
    */
-  public function tearDown() {
+  public function tearDown(): void {
     parent::tearDown();
     $this->quickCleanup(['civicrm_email', 'civicrm_phone', 'civicrm_activity', 'civicrm_activity_contact']);
     $this->callAPISuccess('option_value', 'delete', ['id' => $this->option_value]);
index c9a030bbd51654205970bc6bf39f731e68826240..4eb202e778581a4968dfebab54891b127fb431ec 100644 (file)
@@ -7,7 +7,7 @@
 class CRM_Upgrade_Incremental_BaseTest extends CiviUnitTestCase {
   use CRMTraits_Custom_CustomDataTrait;
 
-  public function tearDown() {
+  public function tearDown(): void {
     $this->quickCleanup(['civicrm_saved_search']);
   }
 
index aa4282606573192e50cbb834e5508515513ef14e..be36950452a1c2574b0ae9cb526c355d77a84b43 100644 (file)
@@ -27,7 +27,7 @@ class CRM_Utils_API_MatchOptionTest extends CiviUnitTestCase {
     ]);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     $noise = $this->callAPISuccess('Contact', 'get', [
       'id' => $this->noise['individual'],
       'return' => ['email'],
index 6924840b6c74b13c61352eec008166f3d96d2ae8..97419e2511b353bc4b1504141733ff6f809cddfd 100644 (file)
@@ -27,7 +27,7 @@ class CRM_Utils_HookTest extends CiviUnitTestCase {
     self::$activeTest = $this;
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     self::$activeTest = $this;
     parent::tearDown();
   }
index 39ca92d8cb6a1a39edcdcf31c9e075255e82a74b..1ec1a6eadedc9fde2d3a1863b809cb6b75f925c8 100644 (file)
@@ -37,7 +37,7 @@ class CRM_Utils_HttpClientTest extends CiviUnitTestCase {
     $this->client = new CRM_Utils_HttpClient();
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     CRM_Core_DAO::executeQuery("DELETE FROM civicrm_setting WHERE name = 'verifySSL'");
     CRM_Core_Config::singleton(TRUE);
     parent::tearDown();
index c461e0543df7046f61b3146a44f728508da36c42..b845c3620fdafd754cca7c01d3c9065cd42a2aef 100644 (file)
@@ -30,7 +30,7 @@ class CRM_Utils_Mail_EmailProcessorInboundTest extends CiviUnitTestCase {
     ])['id'];
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     CRM_Utils_File::cleanDir(__DIR__ . '/data/mail');
     $this->callAPISuccess('MailSettings', 'delete', [
       'id' => $this->mailSettingsId,
index b675125b75616d2285dd4f4d6250b6e50766d48b..e0468acf305d715adf0fee2c647b9c3fe0c9c3f8 100644 (file)
@@ -34,7 +34,7 @@ class CRM_Utils_Mail_EmailProcessorTest extends CiviUnitTestCase {
     ]);
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     CRM_Utils_File::cleanDir(__DIR__ . '/data/mail');
     parent::tearDown();
     $this->quickCleanup([
index 423aa365256c9d7bdc1d292cbf935012f2731583..0e3e7c7009ba721d4bf5b3416b8309d4a3317974 100644 (file)
@@ -12,7 +12,7 @@ class CRM_Utils_Migrate_ImportExportTest extends CiviUnitTestCase {
     parent::setUp();
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     $tablesToTruncate = [
       'civicrm_custom_group',
       'civicrm_custom_field',
index b32d64e5bdb49d25eb872a9e967f6557b65e030a..eb41fbfb771a0c9ab410ea27f3b0e8817dba146b 100644 (file)
@@ -20,7 +20,7 @@ class CRM_Utils_ZipTest extends CiviUnitTestCase {
     $this->file = FALSE;
   }
 
-  public function tearDown() {
+  public function tearDown(): void {
     parent::tearDown();
     if ($this->file) {
       unlink($this->file);