From 5d345864b06e9fbaf26cfca4b3909aced1918fc8 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/Batch/Form/EntryTest.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 ------- .../Contact/BAO/ContactType/ContactSearchTest.php | 2 +- .../CRM/Contact/BAO/ContactType/ContactTest.php | 2 +- .../Contact/BAO/ContactType/ContactTypeTest.php | 2 +- .../Contact/BAO/ContactType/RelationshipTest.php | 2 +- .../CRM/Contact/BAO/GroupContactCacheTest.php | 10 ---------- tests/phpunit/CRM/Contact/BAO/GroupTest.php | 9 --------- tests/phpunit/CRM/Contact/BAO/QueryTest.php | 4 ---- .../CRM/Contact/BAO/RelationshipCacheTest.php | 2 +- .../phpunit/CRM/Contact/BAO/RelationshipTest.php | 9 --------- .../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 ---------- .../Upgrade/Incremental/php/FiveTwentyTest.php | 4 ---- tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php | 8 -------- tests/phpunit/CRM/Utils/DateTest.php | 10 ---------- .../CRM/Utils/Migrate/ImportExportTest.php | 6 ------ 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 +- 103 files changed, 91 insertions(+), 252 deletions(-) diff --git a/tests/phpunit/CRM/ACL/ListTest.php b/tests/phpunit/CRM/ACL/ListTest.php index c435ffca4c..73bd29a9d6 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 30c927b7f5..6e0a62a6ab 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 8e603a500d..23969a1216 100644 --- a/tests/phpunit/CRM/Activity/Form/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/Form/ActivityTest.php @@ -8,7 +8,7 @@ use Civi\Test\Invasive; */ 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 3cddd3f2d5..324ce667d9 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 f9e9f7506f..0864cc9fbd 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/Batch/Form/EntryTest.php b/tests/phpunit/CRM/Batch/Form/EntryTest.php index 3af9d83648..8dc8ee08b1 100644 --- a/tests/phpunit/CRM/Batch/Form/EntryTest.php +++ b/tests/phpunit/CRM/Batch/Form/EntryTest.php @@ -75,7 +75,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { */ protected $_contactID4 = NULL; - public function setUp() { + public function setUp(): void { parent::setUp(); $params = [ diff --git a/tests/phpunit/CRM/Case/BAO/CaseTest.php b/tests/phpunit/CRM/Case/BAO/CaseTest.php index b16fe72620..43b42d3d98 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 82455b571c..e77dbda7d4 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 9499641693..1e276558ef 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 42c499d2aa..2266f1b3b1 100644 --- a/tests/phpunit/CRM/Case/Form/SearchTest.php +++ b/tests/phpunit/CRM/Case/Form/SearchTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/CiviCaseTestCase.php'; */ 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 d287613b41..f16b697e43 100644 --- a/tests/phpunit/CRM/Case/XMLProcessor/ProcessTest.php +++ b/tests/phpunit/CRM/Case/XMLProcessor/ProcessTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/CiviCaseTestCase.php'; */ 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 b1e2526dc0..acc3bcad98 100644 --- a/tests/phpunit/CRM/Case/XMLProcessor/ReportTest.php +++ b/tests/phpunit/CRM/Case/XMLProcessor/ReportTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/CiviCaseTestCase.php'; */ 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 5a12916bd4..8a87b5f009 100644 --- a/tests/phpunit/CRM/Case/XMLProcessorTest.php +++ b/tests/phpunit/CRM/Case/XMLProcessorTest.php @@ -7,7 +7,7 @@ require_once 'CiviTest/CiviCaseTestCase.php'; */ 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 fe6e4c5e3a..9cf37e091e 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 ffb38360b9..78e3bdb3b5 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 84689e5dcd..aa307e7b61 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/Contact/BAO/ContactType/ContactSearchTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php index c22ace6241..ead6037968 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php @@ -6,7 +6,7 @@ */ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $students = 'indivi_student' . substr(sha1(rand()), 0, 7); $params = [ diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php index d748416f7f..64a28032a5 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php @@ -6,7 +6,7 @@ */ class CRM_Contact_BAO_ContactType_ContactTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $params = [ diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php index 9bae2dfd98..9adee0c3b4 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php @@ -7,7 +7,7 @@ use Civi\Api4\ContactType; */ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); $params = [ 'label' => 'sub1_individual', diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php index 9021286c4c..8d1ce0af6d 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php @@ -6,7 +6,7 @@ */ class CRM_Contact_BAO_ContactType_RelationshipTest extends CiviUnitTestCase { - public function setUp() { + public function setUp(): void { parent::setUp(); //create contact subtypes diff --git a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php index d517143c58..a0d06a8d26 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php @@ -245,16 +245,6 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { */ private $_testObjects; - /** - * Sets up the fixture, for example, opens a network connection. - * - * This method is called before a test is executed. - */ - protected function setUp() { - $this->_testObjects = []; - parent::setUp(); - } - /** * Tears down the fixture, for example, closes a network connection. * diff --git a/tests/phpunit/CRM/Contact/BAO/GroupTest.php b/tests/phpunit/CRM/Contact/BAO/GroupTest.php index 49c1a49a3f..12a30dd15a 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupTest.php @@ -17,15 +17,6 @@ */ class CRM_Contact_BAO_GroupTest 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. * diff --git a/tests/phpunit/CRM/Contact/BAO/QueryTest.php b/tests/phpunit/CRM/Contact/BAO/QueryTest.php index 7e4789b610..03dd50e4ef 100644 --- a/tests/phpunit/CRM/Contact/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Contact/BAO/QueryTest.php @@ -17,10 +17,6 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { return new CRM_Contact_BAO_QueryTestDataProvider(); } - public function setUp() { - parent::setUp(); - } - /** * Clean up after test. * diff --git a/tests/phpunit/CRM/Contact/BAO/RelationshipCacheTest.php b/tests/phpunit/CRM/Contact/BAO/RelationshipCacheTest.php index 67fd78535e..44cd3c53ee 100644 --- a/tests/phpunit/CRM/Contact/BAO/RelationshipCacheTest.php +++ b/tests/phpunit/CRM/Contact/BAO/RelationshipCacheTest.php @@ -17,7 +17,7 @@ */ class CRM_Contact_BAO_RelationshipCacheTest extends CiviUnitTestCase { - protected function setUp() { + protected function setUp(): void { $this->useTransaction(TRUE); parent::setUp(); } diff --git a/tests/phpunit/CRM/Contact/BAO/RelationshipTest.php b/tests/phpunit/CRM/Contact/BAO/RelationshipTest.php index 1d0f42d891..a78e350c5b 100644 --- a/tests/phpunit/CRM/Contact/BAO/RelationshipTest.php +++ b/tests/phpunit/CRM/Contact/BAO/RelationshipTest.php @@ -17,15 +17,6 @@ */ class CRM_Contact_BAO_RelationshipTest 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. * diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionTypeTest.php index 976e06cfcf..aca4e92b5f 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 90d416a955..f242ed6085 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 847337cdde..53e12840c4 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 110b505ce9..be7029c65f 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 @@ class CRM_Extension_Manager_ReportTest extends CiviUnitTestCase { ]); } - 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 52396f41ba..ea1c71a53b 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 da9ba2c61e..1f7a955c3e 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 @@ class CRM_Extension_MapperTest extends CiviUnitTestCase { $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 39042cfb40..88119ae5b1 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 6832bb8965..6144b7558d 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 811ae26144..a5413a0288 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 536f24afad..182ee91b7c 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 @@ class CRM_Pledge_BAO_PledgeTest extends CiviUnitTestCase { ]; } - /** - * 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 23261b4c66..d229b86a00 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 36e1e19285..c0c93e1aaa 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 47f269e43b..83cc4cf686 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 8ce39c5b99..a7712723d2 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/Upgrade/Incremental/php/FiveTwentyTest.php b/tests/phpunit/CRM/Upgrade/Incremental/php/FiveTwentyTest.php index 14aa68c27f..f222e46a0c 100644 --- a/tests/phpunit/CRM/Upgrade/Incremental/php/FiveTwentyTest.php +++ b/tests/phpunit/CRM/Upgrade/Incremental/php/FiveTwentyTest.php @@ -7,10 +7,6 @@ require_once 'CiviTest/CiviCaseTestCase.php'; */ class CRM_Upgrade_Incremental_php_FiveTwentyTest extends CiviCaseTestCase { - public function setUp() { - parent::setUp(); - } - /** * Test that the upgrade task changes the direction but only * for bidirectional relationship types that are b_a. diff --git a/tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php b/tests/phpunit/CRM/Utils/Cache/SqlGroupTest.php index 68d1ac3250..2bfdcae245 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 65afb0384a..ac73ae3bb6 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/CRM/Utils/Migrate/ImportExportTest.php b/tests/phpunit/CRM/Utils/Migrate/ImportExportTest.php index 0e3e7c7009..d72b557909 100644 --- a/tests/phpunit/CRM/Utils/Migrate/ImportExportTest.php +++ b/tests/phpunit/CRM/Utils/Migrate/ImportExportTest.php @@ -5,12 +5,6 @@ * @group headless */ class CRM_Utils_Migrate_ImportExportTest extends CiviUnitTestCase { - protected $_apiversion; - - public function setUp() { - $this->_apiversion = 3; - parent::setUp(); - } public function tearDown(): void { $tablesToTruncate = [ diff --git a/tests/phpunit/Civi/CCase/SequenceListenerTest.php b/tests/phpunit/Civi/CCase/SequenceListenerTest.php index 1d3afb246e..88759ebc45 100644 --- a/tests/phpunit/Civi/CCase/SequenceListenerTest.php +++ b/tests/phpunit/Civi/CCase/SequenceListenerTest.php @@ -9,7 +9,7 @@ namespace Civi\CCase; */ 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 44b03ad317..f13ee024d4 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 @@ class CiviCaseTestCase 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->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 fca4ea43ad..d3f1e4adfd 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 1792a1c229..8a78474af5 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -462,7 +462,7 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { /** * 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 df3e8357b4..a68900238f 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 875e692a03..73e9f554df 100644 --- a/tests/phpunit/E2E/Cache/TwoInstancesTest.php +++ b/tests/phpunit/E2E/Cache/TwoInstancesTest.php @@ -31,7 +31,7 @@ class E2E_Cache_TwoInstancesTest extends CiviEndToEndTestCase { $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 7d0d944429..fb598f6e7e 100644 --- a/tests/phpunit/E2E/Core/PrevNextTest.php +++ b/tests/phpunit/E2E/Core/PrevNextTest.php @@ -38,7 +38,7 @@ class PrevNextTest extends \CiviEndToEndTestCase { ); } - 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 0117073647..db1bf239cb 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 @@ class E2E_Extern_CliRunnerTest extends CiviEndToEndTestCase { } } - 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 22fbaedd3f..ed3aed7019 100644 --- a/tests/phpunit/E2E/Extern/RestTest.php +++ b/tests/phpunit/E2E/Extern/RestTest.php @@ -36,7 +36,7 @@ class E2E_Extern_RestTest extends CiviEndToEndTestCase { //$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 @@ class E2E_Extern_RestTest extends CiviEndToEndTestCase { ->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 163747c60e..f2e325fe80 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 ad6ab9dfc3..eac98e582a 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 729c7f9a68..f8fc8376b1 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 92b689ce39..72d6610c6d 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 f04553c573..c7f693c48b 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 ac6622bf5b..24feffa2a1 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 170cee5ccd..4ffc4b1437 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 a1f77690cd..5272a1cc63 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 5690cc8662..f619443929 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 8b2021df46..a0c5bf0e5b 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 5c554ab006..34db4ab6e8 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 1a5272c2c2..daf2ff0012 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 623296a559..6641cde5ad 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 d51e1c732e..497d5bc3a0 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 e040c69b8d..2841eeb44a 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 a7e74ddc82..441b12ccbc 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 8d09b7603b..954c34e9bb 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 115040870f..1d8859a867 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 a97e61ce4c..4e5709831e 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 659e33d82a..e319f50407 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 85cefb3588..a19200f7d2 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 4f609a448c..500f963a92 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 ea2cbc882f..0f34561d3b 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 1bd7016e0b..4f1afba6c7 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 426c2987eb..9e8358d396 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 bfde926bc4..3f68eafaf0 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 4f11b37639..24518fe5cd 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 fbe747c2d3..1fa81b255f 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 73d685cb88..d68c3e9d2a 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 0d5d3a4e03..8733289fc3 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 64a3c98134..963a5bdd5d 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 88334e050f..db1716cc2c 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 ebf0acc34f..183772d2f8 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 427b2f1cee..1bc407ee82 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 7085bf5efb..15635ac2b7 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 6d9b117ad7..d566260c41 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 4b71be0c6d..8b05ed863c 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 cd2c532d8f..d08f53cc87 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 64eebcf9c5..bcc4326976 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 89d2df1f0c..d44f062fba 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 7aef4b55af..8eae0622a7 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 59c2d06abf..7623378bdb 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 0010e84542..0167412e07 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 3e667cce4f..a65cd8d5a7 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 f6a52f25f9..dd3c5dcb74 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 a82392a761..f7a76870f7 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 8bb74325f8..e0671893d0 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 aeb70e0a7d..7d819181b3 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 3e1d5b27f5..ffc68eb560 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 9512744fef..473f397cca 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 638f10efdf..b2bc8f670e 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(); -- 2.25.1