From 83fb28bc2785f509ece3b43673cf5c5a5f8e6a30 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 25 Mar 2021 22:58:22 +1300 Subject: [PATCH] [PHPunit8] cleanup on tearDown functions --- tests/phpunit/CRM/ACL/ListTest.php | 2 +- tests/phpunit/CRM/Activity/BAO/ActivityTest.php | 2 +- tests/phpunit/CRM/Activity/Form/ActivityTest.php | 2 +- tests/phpunit/CRM/Activity/Form/SearchTest.php | 2 +- tests/phpunit/CRM/Activity/Page/AJAXTest.php | 2 +- tests/phpunit/CRM/Case/BAO/CaseTest.php | 2 +- tests/phpunit/CRM/Case/BAO/CaseTypeForkTest.php | 2 +- tests/phpunit/CRM/Case/Form/CustomDataTest.php | 2 +- tests/phpunit/CRM/Case/Form/SearchTest.php | 2 +- .../phpunit/CRM/Case/XMLProcessor/ProcessTest.php | 2 +- .../phpunit/CRM/Case/XMLProcessor/ReportTest.php | 2 +- tests/phpunit/CRM/Case/XMLProcessorTest.php | 2 +- tests/phpunit/CRM/Case/XMLRepositoryTest.php | 2 +- .../CRM/Contact/BAO/ActivitySearchTest.php | 2 +- tests/phpunit/CRM/Contact/BAO/ContactTest.php | 7 ------- .../CRM/Contribute/BAO/ContributionTypeTest.php | 2 +- tests/phpunit/CRM/Contribute/BAO/ProductTest.php | 4 ---- .../phpunit/CRM/Extension/Manager/ModuleTest.php | 2 +- .../phpunit/CRM/Extension/Manager/ReportTest.php | 6 +----- tests/phpunit/CRM/Extension/ManagerTest.php | 6 +----- tests/phpunit/CRM/Extension/MapperTest.php | 6 +----- .../CRM/Financial/Form/PaymentEditTest.php | 2 +- tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php | 9 +-------- .../phpunit/CRM/Pledge/BAO/PledgePaymentTest.php | 15 --------------- tests/phpunit/CRM/Pledge/BAO/PledgeTest.php | 9 +-------- .../phpunit/CRM/Price/BAO/PriceFieldValueTest.php | 13 ------------- tests/phpunit/CRM/Price/BAO/PriceSetTest.php | 13 ------------- .../CRM/Report/Form/ContactSummaryTest.php | 6 +----- tests/phpunit/CRM/Report/FormTest.php | 10 ---------- tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php | 8 -------- tests/phpunit/CRM/Utils/DateTest.php | 10 ---------- tests/phpunit/Civi/CCase/SequenceListenerTest.php | 2 +- tests/phpunit/CiviTest/CiviCaseTestCase.php | 4 ++-- tests/phpunit/CiviTest/CiviReportTestCase.php | 7 +------ tests/phpunit/CiviTest/CiviUnitTestCase.php | 2 +- tests/phpunit/E2E/Cache/TieredTest.php | 2 +- tests/phpunit/E2E/Cache/TwoInstancesTest.php | 2 +- tests/phpunit/E2E/Core/PrevNextTest.php | 2 +- tests/phpunit/E2E/Extern/CliRunnerTest.php | 6 +----- tests/phpunit/E2E/Extern/RestTest.php | 4 ++-- tests/phpunit/api/v3/MailingTest.php | 2 +- tests/phpunit/api/v3/MappingFieldTest.php | 2 +- tests/phpunit/api/v3/MappingTest.php | 2 +- tests/phpunit/api/v3/MembershipPaymentTest.php | 2 +- tests/phpunit/api/v3/MembershipStatusTest.php | 2 +- tests/phpunit/api/v3/MembershipTest.php | 2 +- tests/phpunit/api/v3/MembershipTypeTest.php | 2 +- tests/phpunit/api/v3/MessageTemplateTest.php | 2 +- tests/phpunit/api/v3/MultilingualTest.php | 2 +- tests/phpunit/api/v3/NoteTest.php | 2 +- tests/phpunit/api/v3/OpenIDTest.php | 2 +- tests/phpunit/api/v3/OptionGroupTest.php | 2 +- tests/phpunit/api/v3/OptionValueTest.php | 2 +- tests/phpunit/api/v3/OrderTest.php | 2 +- tests/phpunit/api/v3/ParticipantPaymentTest.php | 2 +- .../phpunit/api/v3/ParticipantStatusTypeTest.php | 2 +- tests/phpunit/api/v3/ParticipantTest.php | 2 +- tests/phpunit/api/v3/PaymentProcessorTest.php | 2 +- tests/phpunit/api/v3/PaymentProcessorTypeTest.php | 2 +- tests/phpunit/api/v3/PaymentTest.php | 2 +- tests/phpunit/api/v3/PaymentTokenTest.php | 2 +- tests/phpunit/api/v3/PcpTest.php | 2 +- tests/phpunit/api/v3/PhoneTest.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/PriceSetTest.php | 2 +- tests/phpunit/api/v3/ProductTest.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/SelectQueryTest.php | 2 +- tests/phpunit/api/v3/SettingTest.php | 2 +- tests/phpunit/api/v3/StateProvinceTest.php | 2 +- tests/phpunit/api/v3/StatusPreferenceTest.php | 2 +- tests/phpunit/api/v3/SurveyRespondantTest.php | 2 +- tests/phpunit/api/v3/SurveyTest.php | 2 +- tests/phpunit/api/v3/SyntaxConformanceTest.php | 2 +- tests/phpunit/api/v3/SystemCheckTest.php | 2 +- tests/phpunit/api/v3/SystemTest.php | 2 +- tests/phpunit/api/v3/TagTest.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 +- tests/phpunit/api/v3/UserTest.php | 2 +- tests/phpunit/api/v3/UtilsTest.php | 2 +- tests/phpunit/api/v3/ValidateTest.php | 2 +- tests/phpunit/api/v3/WebsiteTest.php | 2 +- 91 files changed, 85 insertions(+), 204 deletions(-) diff --git a/tests/phpunit/CRM/ACL/ListTest.php b/tests/phpunit/CRM/ACL/ListTest.php index c435ffca4cb..73bd29a9d6a 100644 --- a/tests/phpunit/CRM/ACL/ListTest.php +++ b/tests/phpunit/CRM/ACL/ListTest.php @@ -13,7 +13,7 @@ class CRM_ACL_ListTest extends CiviUnitTestCase { /** * Set up function. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // $this->quickCleanup(array('civicrm_acl_contact_cache'), TRUE); $this->useTransaction(TRUE); diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php index 30c927b7f5b..6e0a62a6abc 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 8e603a500dc..23969a1216c 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/Activity/Form/SearchTest.php b/tests/phpunit/CRM/Activity/Form/SearchTest.php index 3cddd3f2d51..324ce667d92 100644 --- a/tests/phpunit/CRM/Activity/Form/SearchTest.php +++ b/tests/phpunit/CRM/Activity/Form/SearchTest.php @@ -6,7 +6,7 @@ */ class CRM_Activity_Form_SearchTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->individualID = $this->individualCreate(); $this->contributionCreate([ diff --git a/tests/phpunit/CRM/Activity/Page/AJAXTest.php b/tests/phpunit/CRM/Activity/Page/AJAXTest.php index f9e9f7506f9..0864cc9fbd0 100644 --- a/tests/phpunit/CRM/Activity/Page/AJAXTest.php +++ b/tests/phpunit/CRM/Activity/Page/AJAXTest.php @@ -5,7 +5,7 @@ */ class CRM_Activity_Page_AJAXTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->loadAllFixtures(); diff --git a/tests/phpunit/CRM/Case/BAO/CaseTest.php b/tests/phpunit/CRM/Case/BAO/CaseTest.php index b16fe726205..43b42d3d985 100644 --- a/tests/phpunit/CRM/Case/BAO/CaseTest.php +++ b/tests/phpunit/CRM/Case/BAO/CaseTest.php @@ -6,7 +6,7 @@ */ class CRM_Case_BAO_CaseTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->tablesToTruncate = [ diff --git a/tests/phpunit/CRM/Case/BAO/CaseTypeForkTest.php b/tests/phpunit/CRM/Case/BAO/CaseTypeForkTest.php index 82455b571c1..e77dbda7d46 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 94996416938..1e276558ef3 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 42c499d2aa5..2266f1b3b15 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/Case/XMLProcessor/ProcessTest.php b/tests/phpunit/CRM/Case/XMLProcessor/ProcessTest.php index d287613b413..f16b697e439 100644 --- a/tests/phpunit/CRM/Case/XMLProcessor/ProcessTest.php +++ b/tests/phpunit/CRM/Case/XMLProcessor/ProcessTest.php @@ -7,7 +7,7 @@ */ class CRM_Case_XMLProcessor_ProcessTest extends CiviCaseTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->defaultAssigneeOptionsValues = []; diff --git a/tests/phpunit/CRM/Case/XMLProcessor/ReportTest.php b/tests/phpunit/CRM/Case/XMLProcessor/ReportTest.php index b1e2526dc0b..acc3bcad98f 100644 --- a/tests/phpunit/CRM/Case/XMLProcessor/ReportTest.php +++ b/tests/phpunit/CRM/Case/XMLProcessor/ReportTest.php @@ -7,7 +7,7 @@ */ class CRM_Case_XMLProcessor_ReportTest extends CiviCaseTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->simplifyCaseTypeDefinition(); diff --git a/tests/phpunit/CRM/Case/XMLProcessorTest.php b/tests/phpunit/CRM/Case/XMLProcessorTest.php index 5a12916bd4c..8a87b5f0090 100644 --- a/tests/phpunit/CRM/Case/XMLProcessorTest.php +++ b/tests/phpunit/CRM/Case/XMLProcessorTest.php @@ -7,7 +7,7 @@ */ class CRM_Case_XMLProcessorTest extends CiviCaseTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->processor = new CRM_Case_XMLProcessor(); diff --git a/tests/phpunit/CRM/Case/XMLRepositoryTest.php b/tests/phpunit/CRM/Case/XMLRepositoryTest.php index fe6e4c5e3a9..9cf37e091e8 100644 --- a/tests/phpunit/CRM/Case/XMLRepositoryTest.php +++ b/tests/phpunit/CRM/Case/XMLRepositoryTest.php @@ -7,7 +7,7 @@ class CRM_Case_XMLRepositoryTest extends CiviUnitTestCase { protected $fixtures = []; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->fixtures['CaseTypeWithSingleActivityType'] = ' diff --git a/tests/phpunit/CRM/Contact/BAO/ActivitySearchTest.php b/tests/phpunit/CRM/Contact/BAO/ActivitySearchTest.php index ffb38360b95..78e3bdb3b52 100644 --- a/tests/phpunit/CRM/Contact/BAO/ActivitySearchTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ActivitySearchTest.php @@ -52,7 +52,7 @@ class CRM_Contact_BAO_ActivitySearchTest 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(); diff --git a/tests/phpunit/CRM/Contact/BAO/ContactTest.php b/tests/phpunit/CRM/Contact/BAO/ContactTest.php index 84689e5dcd7..aa307e7b618 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactTest.php @@ -6,13 +6,6 @@ */ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase { - /** - * Set up function. - */ - public function setUp() { - parent::setUp(); - } - /** * Test case for add( ). * diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php index 976e06cfcf2..aca4e92b5f4 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 90d416a955a..f242ed60858 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 847337cdde1..53e12840c40 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 110b505ce99..be7029c65ff 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 52396f41ba5..ea1c71a53ba 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 da9ba2c61ea..1f7a955c3e5 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/Financial/Form/PaymentEditTest.php b/tests/phpunit/CRM/Financial/Form/PaymentEditTest.php index 39042cfb40c..88119ae5b10 100644 --- a/tests/phpunit/CRM/Financial/Form/PaymentEditTest.php +++ b/tests/phpunit/CRM/Financial/Form/PaymentEditTest.php @@ -19,7 +19,7 @@ class CRM_Financial_Form_PaymentEditTest extends CiviUnitTestCase { /** * Setup function. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->createLoggedInUser(); diff --git a/tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php b/tests/phpunit/CRM/Pledge/BAO/PledgeBlockTest.php index 6832bb8965c..6144b7558d8 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 811ae261449..a5413a0288d 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 536f24afadf..182ee91b7c2 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 23261b4c66b..d229b86a00a 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 36e1e19285c..c0c93e1aaa1 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 47f269e43b8..83cc4cf686d 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 8ce39c5b99f..a7712723d25 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 68d1ac32503..2bfdcae2456 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 65afb0384ae..ac73ae3bb6e 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 1d3afb246e0..88759ebc456 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 44b03ad3170..f13ee024d47 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 fca4ea43ad7..d3f1e4adfd6 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 1792a1c2296..8a78474af55 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 df3e8357b40..a68900238ff 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 875e692a034..73e9f554df5 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 7d0d944429e..fb598f6e7eb 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 01170736479..db1bf239cbc 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 22fbaedd3f4..ed3aed7019b 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/MailingTest.php b/tests/phpunit/api/v3/MailingTest.php index 163747c60e5..f2e325fe80c 100644 --- a/tests/phpunit/api/v3/MailingTest.php +++ b/tests/phpunit/api/v3/MailingTest.php @@ -44,7 +44,7 @@ class api_v3_MailingTest extends CiviUnitTestCase { */ protected $footer; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(); // DGW diff --git a/tests/phpunit/api/v3/MappingFieldTest.php b/tests/phpunit/api/v3/MappingFieldTest.php index ad6ab9dfc36..eac98e582a1 100644 --- a/tests/phpunit/api/v3/MappingFieldTest.php +++ b/tests/phpunit/api/v3/MappingFieldTest.php @@ -25,7 +25,7 @@ class api_v3_MappingFieldTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); diff --git a/tests/phpunit/api/v3/MappingTest.php b/tests/phpunit/api/v3/MappingTest.php index 729c7f9a686..f8fc8376b1a 100644 --- a/tests/phpunit/api/v3/MappingTest.php +++ b/tests/phpunit/api/v3/MappingTest.php @@ -25,7 +25,7 @@ class api_v3_MappingTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); diff --git a/tests/phpunit/api/v3/MembershipPaymentTest.php b/tests/phpunit/api/v3/MembershipPaymentTest.php index 92b689ce39d..72d6610c6d9 100644 --- a/tests/phpunit/api/v3/MembershipPaymentTest.php +++ b/tests/phpunit/api/v3/MembershipPaymentTest.php @@ -23,7 +23,7 @@ class api_v3_MembershipPaymentTest extends CiviUnitTestCase { protected $_membershipStatusID; protected $_contribution = []; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); diff --git a/tests/phpunit/api/v3/MembershipStatusTest.php b/tests/phpunit/api/v3/MembershipStatusTest.php index f04553c5730..c7f693c48b6 100644 --- a/tests/phpunit/api/v3/MembershipStatusTest.php +++ b/tests/phpunit/api/v3/MembershipStatusTest.php @@ -21,7 +21,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { protected $_apiversion = 3; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_contactID = $this->individualCreate(); $this->_membershipTypeID = $this->membershipTypeCreate(['member_of_contact_id' => $this->_contactID]); diff --git a/tests/phpunit/api/v3/MembershipTest.php b/tests/phpunit/api/v3/MembershipTest.php index ac6622bf5ba..24feffa2a1d 100644 --- a/tests/phpunit/api/v3/MembershipTest.php +++ b/tests/phpunit/api/v3/MembershipTest.php @@ -41,7 +41,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { /** * Set up for tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_contactID = $this->individualCreate(); $this->_membershipTypeID = $this->membershipTypeCreate(['member_of_contact_id' => $this->_contactID]); diff --git a/tests/phpunit/api/v3/MembershipTypeTest.php b/tests/phpunit/api/v3/MembershipTypeTest.php index 170cee5ccdc..4ffc4b1437f 100644 --- a/tests/phpunit/api/v3/MembershipTypeTest.php +++ b/tests/phpunit/api/v3/MembershipTypeTest.php @@ -20,7 +20,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { /** * Set up for tests. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); $this->_contactID = $this->organizationCreate(); diff --git a/tests/phpunit/api/v3/MessageTemplateTest.php b/tests/phpunit/api/v3/MessageTemplateTest.php index a1f77690cd2..5272a1cc63c 100644 --- a/tests/phpunit/api/v3/MessageTemplateTest.php +++ b/tests/phpunit/api/v3/MessageTemplateTest.php @@ -20,7 +20,7 @@ class api_v3_MessageTemplateTest extends CiviUnitTestCase { protected $entity = 'MessageTemplate'; protected $params; - public function setUp() { + public function setUp(): void { $this->_apiversion = 3; parent::setUp(); $this->useTransaction(TRUE); diff --git a/tests/phpunit/api/v3/MultilingualTest.php b/tests/phpunit/api/v3/MultilingualTest.php index 5690cc86620..f6194439291 100644 --- a/tests/phpunit/api/v3/MultilingualTest.php +++ b/tests/phpunit/api/v3/MultilingualTest.php @@ -24,7 +24,7 @@ class api_v3_MultilingualTest extends CiviUnitTestCase { * * This method is called before a test is executed. */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); } diff --git a/tests/phpunit/api/v3/NoteTest.php b/tests/phpunit/api/v3/NoteTest.php index 8b2021df46f..a0c5bf0e5b1 100644 --- a/tests/phpunit/api/v3/NoteTest.php +++ b/tests/phpunit/api/v3/NoteTest.php @@ -20,7 +20,7 @@ class api_v3_NoteTest extends CiviUnitTestCase { protected $_noteID; protected $_note; - public function setUp() { + public function setUp(): void { // Connect to the database. parent::setUp(); diff --git a/tests/phpunit/api/v3/OpenIDTest.php b/tests/phpunit/api/v3/OpenIDTest.php index 5c554ab006d..34db4ab6e8c 100644 --- a/tests/phpunit/api/v3/OpenIDTest.php +++ b/tests/phpunit/api/v3/OpenIDTest.php @@ -31,7 +31,7 @@ class api_v3_OpenIDTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(); diff --git a/tests/phpunit/api/v3/OptionGroupTest.php b/tests/phpunit/api/v3/OptionGroupTest.php index 1a5272c2c2e..daf2ff00125 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 623296a559d..6641cde5ad7 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 d51e1c732e7..497d5bc3a05 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 e040c69b8dd..2841eeb44a9 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/ParticipantStatusTypeTest.php b/tests/phpunit/api/v3/ParticipantStatusTypeTest.php index a7e74ddc82b..441b12ccbc7 100644 --- a/tests/phpunit/api/v3/ParticipantStatusTypeTest.php +++ b/tests/phpunit/api/v3/ParticipantStatusTypeTest.php @@ -20,7 +20,7 @@ class api_v3_ParticipantStatusTypeTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - public function setUp() { + public function setUp(): void { $this->_apiversion = 3; $this->params = [ 'name' => 'test status', diff --git a/tests/phpunit/api/v3/ParticipantTest.php b/tests/phpunit/api/v3/ParticipantTest.php index 8d09b7603b1..954c34e9bbe 100644 --- a/tests/phpunit/api/v3/ParticipantTest.php +++ b/tests/phpunit/api/v3/ParticipantTest.php @@ -31,7 +31,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { protected $_individualId; protected $_params; - public function setUp() { + public function setUp(): void { $this->_apiversion = 3; parent::setUp(); $this->_entity = 'participant'; diff --git a/tests/phpunit/api/v3/PaymentProcessorTest.php b/tests/phpunit/api/v3/PaymentProcessorTest.php index 115040870f0..1d8859a867e 100644 --- a/tests/phpunit/api/v3/PaymentProcessorTest.php +++ b/tests/phpunit/api/v3/PaymentProcessorTest.php @@ -23,7 +23,7 @@ class api_v3_PaymentProcessorTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); // Create dummy processor diff --git a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php index a97e61ce4c4..4e5709831e7 100644 --- a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php +++ b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php @@ -17,7 +17,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { protected $_ppTypeID; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); diff --git a/tests/phpunit/api/v3/PaymentTest.php b/tests/phpunit/api/v3/PaymentTest.php index 659e33d82af..e319f504075 100644 --- a/tests/phpunit/api/v3/PaymentTest.php +++ b/tests/phpunit/api/v3/PaymentTest.php @@ -27,7 +27,7 @@ class api_v3_PaymentTest 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/PaymentTokenTest.php b/tests/phpunit/api/v3/PaymentTokenTest.php index 85cefb35889..a19200f7d24 100644 --- a/tests/phpunit/api/v3/PaymentTokenTest.php +++ b/tests/phpunit/api/v3/PaymentTokenTest.php @@ -20,7 +20,7 @@ class api_v3_PaymentTokenTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - public function setUp() { + public function setUp(): void { $this->_apiversion = 3; $this->useTransaction(TRUE); parent::setUp(); diff --git a/tests/phpunit/api/v3/PcpTest.php b/tests/phpunit/api/v3/PcpTest.php index 4f609a448c8..500f963a929 100644 --- a/tests/phpunit/api/v3/PcpTest.php +++ b/tests/phpunit/api/v3/PcpTest.php @@ -33,7 +33,7 @@ class api_v3_PcpTest extends CiviUnitTestCase { protected $entity = 'Pcp'; public $DBResetRequired = TRUE; - public function setUp() { + public function setUp(): void { $this->params = [ 'title' => "Pcp title", 'contact_id' => 1, diff --git a/tests/phpunit/api/v3/PhoneTest.php b/tests/phpunit/api/v3/PhoneTest.php index ea2cbc882ff..0f34561d3b1 100644 --- a/tests/phpunit/api/v3/PhoneTest.php +++ b/tests/phpunit/api/v3/PhoneTest.php @@ -29,7 +29,7 @@ class api_v3_PhoneTest extends CiviUnitTestCase { */ protected $isLocationTypesOnPostAssert = TRUE; - public function setUp() { + public function setUp(): void { $this->_entity = 'Phone'; parent::setUp(); $this->useTransaction(); diff --git a/tests/phpunit/api/v3/PledgePaymentTest.php b/tests/phpunit/api/v3/PledgePaymentTest.php index 1bd7016e0b2..4f1afba6c7a 100644 --- a/tests/phpunit/api/v3/PledgePaymentTest.php +++ b/tests/phpunit/api/v3/PledgePaymentTest.php @@ -28,7 +28,7 @@ class api_v3_PledgePaymentTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_individualId = $this->individualCreate(); $this->_pledgeID = $this->pledgeCreate(['contact_id' => $this->_individualId]); diff --git a/tests/phpunit/api/v3/PledgeTest.php b/tests/phpunit/api/v3/PledgeTest.php index 426c2987eb9..9e8358d3965 100644 --- a/tests/phpunit/api/v3/PledgeTest.php +++ b/tests/phpunit/api/v3/PledgeTest.php @@ -26,7 +26,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { /** * @throws \CRM_Core_Exception */ - public function setUp() { + public function setUp(): void { $this->_apiversion = 3; parent::setUp(); $this->quickCleanup(['civicrm_pledge', 'civicrm_pledge_payment']); diff --git a/tests/phpunit/api/v3/PriceFieldTest.php b/tests/phpunit/api/v3/PriceFieldTest.php index bfde926bc4b..3f68eafaf09 100644 --- a/tests/phpunit/api/v3/PriceFieldTest.php +++ b/tests/phpunit/api/v3/PriceFieldTest.php @@ -24,7 +24,7 @@ class api_v3_PriceFieldTest extends CiviUnitTestCase { * * @throws \CRM_Core_Exception */ - public function setUp() { + public function setUp(): void { parent::setUp(); $priceSetparams = [ 'name' => 'default_goat_priceset', diff --git a/tests/phpunit/api/v3/PriceFieldValueTest.php b/tests/phpunit/api/v3/PriceFieldValueTest.php index 4f11b37639c..24518fe5cdc 100644 --- a/tests/phpunit/api/v3/PriceFieldValueTest.php +++ b/tests/phpunit/api/v3/PriceFieldValueTest.php @@ -30,7 +30,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase { /** * Setup function. */ - public function setUp() { + public function setUp(): void { parent::setUp(); // Put stuff here that should happen before all tests in this unit. $priceSetParams = [ diff --git a/tests/phpunit/api/v3/PriceSetTest.php b/tests/phpunit/api/v3/PriceSetTest.php index fbe747c2d33..1fa81b255f3 100644 --- a/tests/phpunit/api/v3/PriceSetTest.php +++ b/tests/phpunit/api/v3/PriceSetTest.php @@ -25,7 +25,7 @@ class api_v3_PriceSetTest extends CiviUnitTestCase { /** * Set up for class. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_params = [ 'name' => 'default_goat_priceset', diff --git a/tests/phpunit/api/v3/ProductTest.php b/tests/phpunit/api/v3/ProductTest.php index 73d685cb882..d68c3e9d2a7 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/ProfileTest.php b/tests/phpunit/api/v3/ProfileTest.php index 0d5d3a4e034..8733289fc3f 100644 --- a/tests/phpunit/api/v3/ProfileTest.php +++ b/tests/phpunit/api/v3/ProfileTest.php @@ -27,7 +27,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Set up for test. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $config = CRM_Core_Config::singleton(); $countryLimit = $config->countryLimit; diff --git a/tests/phpunit/api/v3/RelationshipTest.php b/tests/phpunit/api/v3/RelationshipTest.php index 64a3c981347..963a5bdd5d9 100644 --- a/tests/phpunit/api/v3/RelationshipTest.php +++ b/tests/phpunit/api/v3/RelationshipTest.php @@ -41,7 +41,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { /** * Set up function. */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_cId_a = $this->individualCreate(); $this->_cId_a_2 = $this->individualCreate([ diff --git a/tests/phpunit/api/v3/RelationshipTypeTest.php b/tests/phpunit/api/v3/RelationshipTypeTest.php index 88334e050ff..db1716cc2c1 100644 --- a/tests/phpunit/api/v3/RelationshipTypeTest.php +++ b/tests/phpunit/api/v3/RelationshipTypeTest.php @@ -20,7 +20,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { protected $_relTypeID; protected $_apiversion = 3; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_cId_a = $this->individualCreate(); diff --git a/tests/phpunit/api/v3/SelectQueryTest.php b/tests/phpunit/api/v3/SelectQueryTest.php index ebf0acc34f4..183772d2f80 100644 --- a/tests/phpunit/api/v3/SelectQueryTest.php +++ b/tests/phpunit/api/v3/SelectQueryTest.php @@ -20,7 +20,7 @@ class api_v3_SelectQueryTest extends CiviUnitTestCase { private $hookEntity; private $hookCondition = []; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); CRM_Utils_Hook::singleton()->setHook('civicrm_selectWhereClause', [$this, 'hook_civicrm_selectWhereClause']); diff --git a/tests/phpunit/api/v3/SettingTest.php b/tests/phpunit/api/v3/SettingTest.php index 427b2f1cee1..1bc407ee825 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', diff --git a/tests/phpunit/api/v3/StateProvinceTest.php b/tests/phpunit/api/v3/StateProvinceTest.php index 7085bf5efb2..15635ac2b76 100644 --- a/tests/phpunit/api/v3/StateProvinceTest.php +++ b/tests/phpunit/api/v3/StateProvinceTest.php @@ -19,7 +19,7 @@ class api_v3_StateProvinceTest extends CiviUnitTestCase { protected $_params; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); $this->_params = [ diff --git a/tests/phpunit/api/v3/StatusPreferenceTest.php b/tests/phpunit/api/v3/StatusPreferenceTest.php index 6d9b117ad79..d566260c41e 100644 --- a/tests/phpunit/api/v3/StatusPreferenceTest.php +++ b/tests/phpunit/api/v3/StatusPreferenceTest.php @@ -20,7 +20,7 @@ class api_v3_StatusPreferenceTest extends CiviUnitTestCase { protected $_locationType; protected $_params; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); $this->_params = [ diff --git a/tests/phpunit/api/v3/SurveyRespondantTest.php b/tests/phpunit/api/v3/SurveyRespondantTest.php index 4b71be0c6d3..8b05ed863cb 100644 --- a/tests/phpunit/api/v3/SurveyRespondantTest.php +++ b/tests/phpunit/api/v3/SurveyRespondantTest.php @@ -17,7 +17,7 @@ class api_v3_SurveyRespondantTest extends CiviUnitTestCase { protected $_apiversion = 3; protected $params; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); $phoneBankActivity = $this->callAPISuccess('Option_value', 'Get', ['label' => 'PhoneBank', 'sequential' => 1]); diff --git a/tests/phpunit/api/v3/SurveyTest.php b/tests/phpunit/api/v3/SurveyTest.php index cd2c532d8f5..d08f53cc875 100644 --- a/tests/phpunit/api/v3/SurveyTest.php +++ b/tests/phpunit/api/v3/SurveyTest.php @@ -33,7 +33,7 @@ class api_v3_SurveyTest extends CiviUnitTestCase { protected $entity = 'survey'; public $DBResetRequired = FALSE; - public function setUp() { + public function setUp(): void { $phoneBankActivityTypeID = $this->callAPISuccessGetValue('Option_value', [ 'label' => 'PhoneBank', 'return' => 'value', diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 64eebcf9c53..bcc4326976a 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -81,7 +81,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { * and that will never exist (eg an obsoleted Entity * they need to be returned by the function toBeSkipped_{$action} (because it has to be a static method and therefore couldn't access a this->toBeSkipped) */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->enableCiviCampaign(); $this->toBeImplemented['get'] = [ diff --git a/tests/phpunit/api/v3/SystemCheckTest.php b/tests/phpunit/api/v3/SystemCheckTest.php index 89d2df1f0cf..d44f062fba6 100644 --- a/tests/phpunit/api/v3/SystemCheckTest.php +++ b/tests/phpunit/api/v3/SystemCheckTest.php @@ -21,7 +21,7 @@ */ class api_v3_SystemCheckTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); } diff --git a/tests/phpunit/api/v3/SystemTest.php b/tests/phpunit/api/v3/SystemTest.php index 7aef4b55af8..8eae0622a71 100644 --- a/tests/phpunit/api/v3/SystemTest.php +++ b/tests/phpunit/api/v3/SystemTest.php @@ -25,7 +25,7 @@ class api_v3_SystemTest extends CiviUnitTestCase { * * This method is called before a test is executed. */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); } diff --git a/tests/phpunit/api/v3/TagTest.php b/tests/phpunit/api/v3/TagTest.php index 59c2d06abf3..7623378bdb0 100644 --- a/tests/phpunit/api/v3/TagTest.php +++ b/tests/phpunit/api/v3/TagTest.php @@ -32,7 +32,7 @@ class api_v3_TagTest extends CiviUnitTestCase { protected $tagID; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); $this->tag = $this->tagCreate(); diff --git a/tests/phpunit/api/v3/TaxContributionPageTest.php b/tests/phpunit/api/v3/TaxContributionPageTest.php index 0010e84542d..0167412e07e 100644 --- a/tests/phpunit/api/v3/TaxContributionPageTest.php +++ b/tests/phpunit/api/v3/TaxContributionPageTest.php @@ -31,7 +31,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { protected $halfFinancialAccId; protected $halfFinancialTypeId; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->_individualId = $this->individualCreate(); $this->_orgId = $this->organizationCreate(NULL); diff --git a/tests/phpunit/api/v3/UFFieldTest.php b/tests/phpunit/api/v3/UFFieldTest.php index 3e667cce4fb..a65cd8d5a72 100644 --- a/tests/phpunit/api/v3/UFFieldTest.php +++ b/tests/phpunit/api/v3/UFFieldTest.php @@ -37,7 +37,7 @@ class api_v3_UFFieldTest extends CiviUnitTestCase { * * @throws \Exception */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->quickCleanup( [ diff --git a/tests/phpunit/api/v3/UFGroupTest.php b/tests/phpunit/api/v3/UFGroupTest.php index f6a52f25f97..dd3c5dcb744 100644 --- a/tests/phpunit/api/v3/UFGroupTest.php +++ b/tests/phpunit/api/v3/UFGroupTest.php @@ -27,7 +27,7 @@ class api_v3_UFGroupTest extends CiviUnitTestCase { protected $_groupId; protected $params; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->_groupId = $this->groupCreate(); $this->_contactId = $this->individualCreate(); diff --git a/tests/phpunit/api/v3/UFJoinTest.php b/tests/phpunit/api/v3/UFJoinTest.php index a82392a7610..f7a76870f7d 100644 --- a/tests/phpunit/api/v3/UFJoinTest.php +++ b/tests/phpunit/api/v3/UFJoinTest.php @@ -25,7 +25,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { protected $_ufFieldId; protected $_contactId = 69; - protected function setUp() { + protected function setUp(): void { parent::setUp(); // Truncate the tables $this->quickCleanup( diff --git a/tests/phpunit/api/v3/UFMatchTest.php b/tests/phpunit/api/v3/UFMatchTest.php index 8bb74325f88..e0671893d00 100644 --- a/tests/phpunit/api/v3/UFMatchTest.php +++ b/tests/phpunit/api/v3/UFMatchTest.php @@ -26,7 +26,7 @@ class api_v3_UFMatchTest extends CiviUnitTestCase { protected $_contactId; protected $_params = []; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->quickCleanup( [ diff --git a/tests/phpunit/api/v3/UserTest.php b/tests/phpunit/api/v3/UserTest.php index aeb70e0a7d1..7d819181b39 100644 --- a/tests/phpunit/api/v3/UserTest.php +++ b/tests/phpunit/api/v3/UserTest.php @@ -24,7 +24,7 @@ class api_v3_UserTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->contactID = $this->createLoggedInUser(); $this->params = [ diff --git a/tests/phpunit/api/v3/UtilsTest.php b/tests/phpunit/api/v3/UtilsTest.php index 3e1d5b27f5c..ffc68eb560f 100644 --- a/tests/phpunit/api/v3/UtilsTest.php +++ b/tests/phpunit/api/v3/UtilsTest.php @@ -28,7 +28,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { * * This method is called before a test is executed. */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->useTransaction(TRUE); } diff --git a/tests/phpunit/api/v3/ValidateTest.php b/tests/phpunit/api/v3/ValidateTest.php index 9512744fef7..473f397ccac 100644 --- a/tests/phpunit/api/v3/ValidateTest.php +++ b/tests/phpunit/api/v3/ValidateTest.php @@ -20,7 +20,7 @@ class api_v3_ValidateTest extends CiviUnitTestCase { /** * This method is called before a test is executed. */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); } diff --git a/tests/phpunit/api/v3/WebsiteTest.php b/tests/phpunit/api/v3/WebsiteTest.php index 638f10efdfd..b2bc8f670e5 100644 --- a/tests/phpunit/api/v3/WebsiteTest.php +++ b/tests/phpunit/api/v3/WebsiteTest.php @@ -24,7 +24,7 @@ class api_v3_WebsiteTest extends CiviUnitTestCase { public $DBResetRequired = FALSE; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->useTransaction();