diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php index 30c927b7f5b0..6e0a62a6abc7 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php @@ -17,7 +17,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { * * @throws \CiviCRM_API3_Exception */ - public function setUp() { + public function setUp():void { parent::setUp(); $this->prepareForACLs(); CRM_Core_Config::singleton()->userPermissionClass->permissions = ['view all contacts', 'access CiviCRM']; diff --git a/tests/phpunit/CRM/Activity/Form/ActivityTest.php b/tests/phpunit/CRM/Activity/Form/ActivityTest.php index 8e603a500dc2..23969a1216c9 100644 --- a/tests/phpunit/CRM/Activity/Form/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/Form/ActivityTest.php @@ -8,7 +8,7 @@ */ class CRM_Activity_Form_ActivityTest extends CiviUnitTestCase { - public function setUp() { + public function setUp():void { parent::setUp(); $this->assignee1 = $this->individualCreate([ 'first_name' => 'testassignee1', diff --git a/tests/phpunit/CRM/Case/BAO/CaseTypeForkTest.php b/tests/phpunit/CRM/Case/BAO/CaseTypeForkTest.php index 82455b571c1a..e77dbda7d466 100644 --- a/tests/phpunit/CRM/Case/BAO/CaseTypeForkTest.php +++ b/tests/phpunit/CRM/Case/BAO/CaseTypeForkTest.php @@ -7,7 +7,7 @@ */ class CRM_Case_BAO_CaseTypeForkTest extends CiviCaseTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); CRM_Core_ManagedEntities::singleton(TRUE)->reconcile(); } diff --git a/tests/phpunit/CRM/Case/Form/CustomDataTest.php b/tests/phpunit/CRM/Case/Form/CustomDataTest.php index 949964169388..1e276558ef38 100644 --- a/tests/phpunit/CRM/Case/Form/CustomDataTest.php +++ b/tests/phpunit/CRM/Case/Form/CustomDataTest.php @@ -9,7 +9,7 @@ class CRM_Case_Form_CustomDataTest extends CiviCaseTestCase { protected $custom_group; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->custom_group = $this->customGroupCreate(['extends' => 'Case']); $this->custom_group = $this->custom_group['values'][$this->custom_group['id']]; diff --git a/tests/phpunit/CRM/Case/Form/SearchTest.php b/tests/phpunit/CRM/Case/Form/SearchTest.php index 42c499d2aa5f..2266f1b3b156 100644 --- a/tests/phpunit/CRM/Case/Form/SearchTest.php +++ b/tests/phpunit/CRM/Case/Form/SearchTest.php @@ -7,7 +7,7 @@ */ class CRM_Case_Form_SearchTest extends CiviCaseTestCase { - public function setUp() { + public function setUp():void { parent::setUp(); $this->quickCleanup(['civicrm_case_contact', 'civicrm_case', 'civicrm_contact']); } diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php index 976e06cfcf21..aca4e92b5f44 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php @@ -15,7 +15,7 @@ */ class CRM_Contribute_BAO_ContributionTypeTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->organizationCreate(); } diff --git a/tests/phpunit/CRM/Contribute/BAO/ProductTest.php b/tests/phpunit/CRM/Contribute/BAO/ProductTest.php index 90d416a955ae..f242ed60858f 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ProductTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ProductTest.php @@ -15,10 +15,6 @@ */ class CRM_Contribute_BAO_ProductTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - /** * Check method add() */ diff --git a/tests/phpunit/CRM/Extension/Manager/ModuleTest.php b/tests/phpunit/CRM/Extension/Manager/ModuleTest.php index 847337cdde15..53e12840c40a 100644 --- a/tests/phpunit/CRM/Extension/Manager/ModuleTest.php +++ b/tests/phpunit/CRM/Extension/Manager/ModuleTest.php @@ -6,7 +6,7 @@ */ class CRM_Extension_Manager_ModuleTest extends CiviUnitTestCase { - public function setUp() { + public function setUp():void { parent::setUp(); // $query = "INSERT INTO civicrm_domain ( name, version ) VALUES ( 'domain', 3 )"; // $result = CRM_Core_DAO::executeQuery($query); diff --git a/tests/phpunit/CRM/Extension/Manager/ReportTest.php b/tests/phpunit/CRM/Extension/Manager/ReportTest.php index 110b505ce99b..be7029c65ff6 100644 --- a/tests/phpunit/CRM/Extension/Manager/ReportTest.php +++ b/tests/phpunit/CRM/Extension/Manager/ReportTest.php @@ -6,7 +6,7 @@ */ class CRM_Extension_Manager_ReportTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); //if (class_exists('test_extension_manager_reporttest')) { // test_extension_manager_reporttest::$counts = array(); @@ -17,10 +17,6 @@ public function setUp() { ]); } - public function tearDown() { - parent::tearDown(); - } - /** * Install an extension with a valid type name. */ diff --git a/tests/phpunit/CRM/Extension/ManagerTest.php b/tests/phpunit/CRM/Extension/ManagerTest.php index 52396f41ba57..ea1c71a53baa 100644 --- a/tests/phpunit/CRM/Extension/ManagerTest.php +++ b/tests/phpunit/CRM/Extension/ManagerTest.php @@ -17,16 +17,12 @@ class CRM_Extension_ManagerTest extends CiviUnitTestCase { const TESTING_TYPE = 'report'; const OTHER_TESTING_TYPE = 'module'; - public function setUp() { + public function setUp(): void { parent::setUp(); list ($this->basedir, $this->container) = $this->_createContainer(); $this->mapper = new CRM_Extension_Mapper($this->container); } - public function tearDown() { - parent::tearDown(); - } - /** * Install an extension with an invalid type name. * diff --git a/tests/phpunit/CRM/Extension/MapperTest.php b/tests/phpunit/CRM/Extension/MapperTest.php index da9ba2c61eaf..1f7a955c3e56 100644 --- a/tests/phpunit/CRM/Extension/MapperTest.php +++ b/tests/phpunit/CRM/Extension/MapperTest.php @@ -36,7 +36,7 @@ class CRM_Extension_MapperTest extends CiviUnitTestCase { */ protected $mapperWithSlash; - public function setUp() { + public function setUp(): void { parent::setUp(); list ($this->basedir, $this->container) = $this->_createContainer(); $this->mapper = new CRM_Extension_Mapper($this->container); @@ -45,10 +45,6 @@ public function setUp() { $this->mapperWithSlash = new CRM_Extension_Mapper($this->containerWithSlash); } - public function tearDown() { - parent::tearDown(); - } - public function testClassToKey() { $this->assertEquals("test.foo.bar", $this->mapper->classToKey('test_foo_bar')); } diff --git a/tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php b/tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php index 6832bb8965c2..6144b7558d81 100644 --- a/tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php +++ b/tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php @@ -21,19 +21,12 @@ class CRM_Pledge_BAO_PledgeBlockTest 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(); $contributionPage = $this->contributionPageCreate(); $this->_contributionPageId = $contributionPage['id']; } - /** - * Tears down the fixture, for example, closes a network connection. - * This method is called after a test is executed. - */ - protected function tearDown() { - } - /** * create() and deletepledgeblock() method */ diff --git a/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php b/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php index 811ae2614498..a5413a0288dd 100644 --- a/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php +++ b/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php @@ -17,21 +17,6 @@ */ class CRM_Pledge_BAO_PledgePaymentTest 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() { - } - /** * Test for Add/Update Pledge Payment. */ diff --git a/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php b/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php index 536f24afadf5..182ee91b7c2e 100644 --- a/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php +++ b/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php @@ -23,7 +23,7 @@ class CRM_Pledge_BAO_PledgeTest extends CiviUnitTestCase { * * @throws \CiviCRM_API3_Exception */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->ids['Contact'][0] = $this->individualCreate(); $this->_params = [ @@ -43,13 +43,6 @@ protected function setUp() { ]; } - /** - * Tears down the fixture, for example, closes a network connection. - * This method is called after a test is executed. - */ - protected function tearDown() { - } - /** * Test for Add/Update Pledge. * diff --git a/tests/phpunit/CRM/Price/BAO/PriceFieldValueTest.php b/tests/phpunit/CRM/Price/BAO/PriceFieldValueTest.php index 23261b4c66bf..d229b86a00a7 100644 --- a/tests/phpunit/CRM/Price/BAO/PriceFieldValueTest.php +++ b/tests/phpunit/CRM/Price/BAO/PriceFieldValueTest.php @@ -15,19 +15,6 @@ */ class CRM_Price_BAO_PriceFieldValueTest extends CiviUnitTestCase { - /** - * Sets up the fixtures. - */ - protected function setUp() { - parent::setUp(); - } - - /** - * Tears down the fixture. - */ - protected function tearDown() { - } - /** * Verifies visibility field exists and is configured as a pseudoconstant * referencing the 'visibility' option group. diff --git a/tests/phpunit/CRM/Price/BAO/PriceSetTest.php b/tests/phpunit/CRM/Price/BAO/PriceSetTest.php index 36e1e19285cc..c0c93e1aaa13 100644 --- a/tests/phpunit/CRM/Price/BAO/PriceSetTest.php +++ b/tests/phpunit/CRM/Price/BAO/PriceSetTest.php @@ -15,19 +15,6 @@ */ class CRM_Price_BAO_PriceSetTest extends CiviUnitTestCase { - /** - * Sets up the fixtures. - */ - protected function setUp() { - parent::setUp(); - } - - /** - * Tears down the fixture. - */ - protected function tearDown() { - } - /** * Test the correct amount level is returned for an event which is not presented as a price set event. * diff --git a/tests/phpunit/CRM/Report/Form/ContactSummaryTest.php b/tests/phpunit/CRM/Report/Form/ContactSummaryTest.php index 47f269e43b8b..83cc4cf686da 100644 --- a/tests/phpunit/CRM/Report/Form/ContactSummaryTest.php +++ b/tests/phpunit/CRM/Report/Form/ContactSummaryTest.php @@ -22,15 +22,11 @@ class CRM_Report_Form_ContactSummaryTest extends CiviReportTestCase { 'civicrm_address', ]; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->quickCleanup($this->_tablesToTruncate); } - public function tearDown() { - parent::tearDown(); - } - /** * Ensure the new Odd/Event street number sort column works correctly */ diff --git a/tests/phpunit/CRM/Report/FormTest.php b/tests/phpunit/CRM/Report/FormTest.php index 8ce39c5b99f6..a7712723d257 100644 --- a/tests/phpunit/CRM/Report/FormTest.php +++ b/tests/phpunit/CRM/Report/FormTest.php @@ -26,16 +26,6 @@ */ class CRM_Report_FormTest extends CiviUnitTestCase { - public function setUp() { - // There are only unit tests here at present, we can skip database loading. - return TRUE; - } - - public function tearDown() { - // There are only unit tests here at present, we can skip database loading. - return TRUE; - } - /** * Used by testGetFromTo */ diff --git a/tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php b/tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php index 68d1ac325032..2bfdcae2456e 100644 --- a/tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php +++ b/tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php @@ -6,14 +6,6 @@ */ class CRM_Utils_Cache_SqlGroupTest extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - } - - public function tearDown() { - parent::tearDown(); - } - /** * Add and remove two items from the same cache instance. */ diff --git a/tests/phpunit/CRM/Utils/DateTest.php b/tests/phpunit/CRM/Utils/DateTest.php index 65afb0384ae4..ac73ae3bb6ec 100644 --- a/tests/phpunit/CRM/Utils/DateTest.php +++ b/tests/phpunit/CRM/Utils/DateTest.php @@ -26,16 +26,6 @@ */ class CRM_Utils_DateTest extends CiviUnitTestCase { - public function setUp() { - // There are only unit tests here at present, we can skip database loading. - return TRUE; - } - - public function tearDown() { - // There are only unit tests here at present, we can skip database loading. - return TRUE; - } - /** * Used by testGetFromTo */ diff --git a/tests/phpunit/Civi/CCase/SequenceListenerTest.php b/tests/phpunit/Civi/CCase/SequenceListenerTest.php index 1d3afb246e08..88759ebc4562 100644 --- a/tests/phpunit/Civi/CCase/SequenceListenerTest.php +++ b/tests/phpunit/Civi/CCase/SequenceListenerTest.php @@ -9,7 +9,7 @@ */ class SequenceListenerTest extends \CiviCaseTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_params = [ 'case_type' => $this->caseType, diff --git a/tests/phpunit/CiviTest/CiviCaseTestCase.php b/tests/phpunit/CiviTest/CiviCaseTestCase.php index 44b03ad3170f..f13ee024d47b 100644 --- a/tests/phpunit/CiviTest/CiviCaseTestCase.php +++ b/tests/phpunit/CiviTest/CiviCaseTestCase.php @@ -28,7 +28,7 @@ class CiviCaseTestCase extends CiviUnitTestCase { protected $_loggedInUser; - public function setUp() { + public function setUp(): void { parent::setUp(); // CRM-9404 - set-up is a bit cumbersome but had to put something in place to set up activity types & case types @@ -110,7 +110,7 @@ public function setUp() { * 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->quickCleanup($this->tablesToTruncate, TRUE); $this->customDirectories(array('template_path' => FALSE)); CRM_Case_XMLRepository::singleton(TRUE); diff --git a/tests/phpunit/CiviTest/CiviReportTestCase.php b/tests/phpunit/CiviTest/CiviReportTestCase.php index fca4ea43ad7c..d3f1e4adfd6e 100644 --- a/tests/phpunit/CiviTest/CiviReportTestCase.php +++ b/tests/phpunit/CiviTest/CiviReportTestCase.php @@ -14,12 +14,7 @@ */ class CiviReportTestCase extends CiviUnitTestCase { - public function setUp() { - parent::setUp(); - $this->_sethtmlGlobals(); - } - - public function tearDown() { + public function tearDown(): void { // TODO Figure out how to automatically drop all temporary tables. // Note that MySQL doesn't provide a way to list them, so we would need // to keep track ourselves (eg CRM_Core_TemporaryTableManager) or reset diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 1792a1c22961..8a78474af552 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -462,7 +462,7 @@ public function createDomainContacts() { /** * Common teardown functions for all unit tests. */ - protected function tearDown() { + protected function tearDown(): void { $this->_apiversion = 3; $this->resetLabels(); diff --git a/tests/phpunit/E2E/Cache/TieredTest.php b/tests/phpunit/E2E/Cache/TieredTest.php index df3e8357b40b..a68900238ff3 100644 --- a/tests/phpunit/E2E/Cache/TieredTest.php +++ b/tests/phpunit/E2E/Cache/TieredTest.php @@ -27,7 +27,7 @@ class E2E_Cache_TieredTest extends E2E_Cache_CacheTestCase { */ protected $b; - protected function tearDown() { + protected function tearDown(): void { if (function_exists('timecop_return')) { timecop_return(); } diff --git a/tests/phpunit/E2E/Cache/TwoInstancesTest.php b/tests/phpunit/E2E/Cache/TwoInstancesTest.php index 875e692a0343..73e9f554df59 100644 --- a/tests/phpunit/E2E/Cache/TwoInstancesTest.php +++ b/tests/phpunit/E2E/Cache/TwoInstancesTest.php @@ -31,7 +31,7 @@ protected function setUp() { $this->a = $this->b = NULL; } - protected function tearDown() { + protected function tearDown(): void { parent::tearDown(); if ($this->a) { $this->a->clear(); diff --git a/tests/phpunit/E2E/Core/PrevNextTest.php b/tests/phpunit/E2E/Core/PrevNextTest.php index 7d0d944429e6..fb598f6e7eb3 100644 --- a/tests/phpunit/E2E/Core/PrevNextTest.php +++ b/tests/phpunit/E2E/Core/PrevNextTest.php @@ -38,7 +38,7 @@ protected function setUp() { ); } - protected function tearDown() { + protected function tearDown(): void { \Civi::service('prevnext')->deleteItem(NULL, $this->cacheKey); \Civi::service('prevnext')->deleteItem(NULL, $this->cacheKeyB); } diff --git a/tests/phpunit/E2E/Extern/CliRunnerTest.php b/tests/phpunit/E2E/Extern/CliRunnerTest.php index 011707364797..db1bf239cbcf 100644 --- a/tests/phpunit/E2E/Extern/CliRunnerTest.php +++ b/tests/phpunit/E2E/Extern/CliRunnerTest.php @@ -23,7 +23,7 @@ */ class E2E_Extern_CliRunnerTest extends CiviEndToEndTestCase { - protected function setUp() { + protected function setUp(): void { parent::setUp(); foreach (['CIVI_CORE', 'CMS_ROOT', 'CMS_URL'] as $var) { @@ -33,10 +33,6 @@ protected function setUp() { } } - protected function tearDown() { - parent::tearDown(); - } - /** * @return array * Each case gives a name (eg "cv") and template for executing the command diff --git a/tests/phpunit/E2E/Extern/RestTest.php b/tests/phpunit/E2E/Extern/RestTest.php index 22fbaedd3f45..ed3aed7019bc 100644 --- a/tests/phpunit/E2E/Extern/RestTest.php +++ b/tests/phpunit/E2E/Extern/RestTest.php @@ -36,7 +36,7 @@ protected function assertAPIErrorCode($apiResult, $cmpvar, $prefix = '') { //$this->assertEquals($cmpvar, $apiResult['is_error'], $prefix . print_r($apiResult, TRUE)); } - protected function setUp() { + protected function setUp(): void { parent::setUp(); if (empty($GLOBALS['_CV']['CIVI_SITE_KEY'])) { @@ -51,7 +51,7 @@ protected function getRestUrl() { ->getUrl('civicrm', 'extern/rest.php'); } - protected function tearDown() { + protected function tearDown(): void { if (!empty($this->old_api_keys)) { foreach ($this->old_api_keys as $cid => $apiKey) { civicrm_api3('Contact', 'create', array( diff --git a/tests/phpunit/api/v3/OptionGroupTest.php b/tests/phpunit/api/v3/OptionGroupTest.php index 1a5272c2c2e4..daf2ff001258 100644 --- a/tests/phpunit/api/v3/OptionGroupTest.php +++ b/tests/phpunit/api/v3/OptionGroupTest.php @@ -20,7 +20,7 @@ class api_v3_OptionGroupTest extends CiviUnitTestCase { protected $_entity = 'OptionGroup'; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); $this->_params = [ diff --git a/tests/phpunit/api/v3/OptionValueTest.php b/tests/phpunit/api/v3/OptionValueTest.php index 623296a559d9..6641cde5ad7b 100644 --- a/tests/phpunit/api/v3/OptionValueTest.php +++ b/tests/phpunit/api/v3/OptionValueTest.php @@ -16,7 +16,7 @@ class api_v3_OptionValueTest extends CiviUnitTestCase { protected $_apiversion = 3; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); } diff --git a/tests/phpunit/api/v3/OrderTest.php b/tests/phpunit/api/v3/OrderTest.php index d51e1c732e72..497d5bc3a053 100644 --- a/tests/phpunit/api/v3/OrderTest.php +++ b/tests/phpunit/api/v3/OrderTest.php @@ -27,7 +27,7 @@ class api_v3_OrderTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_apiversion = 3; diff --git a/tests/phpunit/api/v3/ParticipantPaymentTest.php b/tests/phpunit/api/v3/ParticipantPaymentTest.php index e040c69b8dda..2841eeb44a95 100644 --- a/tests/phpunit/api/v3/ParticipantPaymentTest.php +++ b/tests/phpunit/api/v3/ParticipantPaymentTest.php @@ -29,7 +29,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { /** * Set up for tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); $event = $this->eventCreate(NULL); diff --git a/tests/phpunit/api/v3/ProductTest.php b/tests/phpunit/api/v3/ProductTest.php index 73d685cb8820..d68c3e9d2a75 100644 --- a/tests/phpunit/api/v3/ProductTest.php +++ b/tests/phpunit/api/v3/ProductTest.php @@ -19,7 +19,7 @@ class api_v3_ProductTest extends CiviUnitTestCase { protected $_entity = 'Product'; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(); $this->_params = [ diff --git a/tests/phpunit/api/v3/SettingTest.php b/tests/phpunit/api/v3/SettingTest.php index 427b2f1cee14..1bc407ee8258 100644 --- a/tests/phpunit/api/v3/SettingTest.php +++ b/tests/phpunit/api/v3/SettingTest.php @@ -29,7 +29,7 @@ class api_v3_SettingTest extends CiviUnitTestCase { protected $_domainID2; protected $_domainID3; - public function setUp() { + public function setUp(): void { parent::setUp(); $params = [ 'name' => __CLASS__ . 'Second Domain',