From 99e9e58318189ececfabb6f6248d9587ec5c158d Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 29 Apr 2023 03:03:25 +0000 Subject: [PATCH] Set return type of base TestCase methods From the [PHPUnit 8 release notes][1], the `TestCase` methods below now declare a `void` return type: - `setUpBeforeClass()` - `setUp()` - `assertPreConditions()` - `assertPostConditions()` - `tearDown()` - `tearDownAfterClass()` - `onNotSuccessfulTest()` [1]: https://phpunit.de/announcements/phpunit-8.html --- .../Api/Application/ApplicationApiIntegrationTestCase.php | 2 +- tests/Integration/Api/Application/Nests/NestControllerTest.php | 2 +- .../Api/Client/Server/Allocation/CreateNewAllocationTest.php | 2 +- tests/Integration/Api/Client/Server/Backup/DeleteBackupTest.php | 2 +- .../Integration/Api/Remote/SftpAuthenticationControllerTest.php | 2 +- tests/Integration/IntegrationTestCase.php | 2 +- .../Allocations/FindAssignableAllocationServiceTest.php | 2 +- .../Services/Databases/DatabaseManagementServiceTest.php | 2 +- .../Services/Databases/DeployServerDatabaseServiceTest.php | 2 +- .../Services/Deployment/FindViableNodesServiceTest.php | 2 +- .../Services/Servers/BuildModificationServiceTest.php | 2 +- .../Integration/Services/Servers/ServerCreationServiceTest.php | 2 +- .../Integration/Services/Servers/ServerDeletionServiceTest.php | 2 +- tests/Integration/Services/Servers/SuspensionServiceTest.php | 2 +- .../Services/Servers/VariableValidatorServiceTest.php | 2 +- tests/TestCase.php | 2 +- .../Unit/Http/Middleware/Api/Daemon/DaemonAuthenticateTest.php | 2 +- tests/Unit/Http/Middleware/LanguageMiddlewareTest.php | 2 +- tests/Unit/Http/Middleware/MaintenanceMiddlewareTest.php | 2 +- tests/Unit/Http/Middleware/MiddlewareTestCase.php | 2 +- tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/Integration/Api/Application/ApplicationApiIntegrationTestCase.php b/tests/Integration/Api/Application/ApplicationApiIntegrationTestCase.php index 73a4f8f51..4fafba7dd 100644 --- a/tests/Integration/Api/Application/ApplicationApiIntegrationTestCase.php +++ b/tests/Integration/Api/Application/ApplicationApiIntegrationTestCase.php @@ -28,7 +28,7 @@ abstract class ApplicationApiIntegrationTestCase extends IntegrationTestCase * Bootstrap application API tests. Creates a default admin user and associated API key * and also sets some default headers required for accessing the API. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Api/Application/Nests/NestControllerTest.php b/tests/Integration/Api/Application/Nests/NestControllerTest.php index 799fc18ac..c96e292ab 100644 --- a/tests/Integration/Api/Application/Nests/NestControllerTest.php +++ b/tests/Integration/Api/Application/Nests/NestControllerTest.php @@ -14,7 +14,7 @@ class NestControllerTest extends ApplicationApiIntegrationTestCase /** * Setup tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Api/Client/Server/Allocation/CreateNewAllocationTest.php b/tests/Integration/Api/Client/Server/Allocation/CreateNewAllocationTest.php index 1abb106cd..2fba5ab70 100644 --- a/tests/Integration/Api/Client/Server/Allocation/CreateNewAllocationTest.php +++ b/tests/Integration/Api/Client/Server/Allocation/CreateNewAllocationTest.php @@ -12,7 +12,7 @@ class CreateNewAllocationTest extends ClientApiIntegrationTestCase /** * Setup tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Api/Client/Server/Backup/DeleteBackupTest.php b/tests/Integration/Api/Client/Server/Backup/DeleteBackupTest.php index 5c4d53e49..a74bde743 100644 --- a/tests/Integration/Api/Client/Server/Backup/DeleteBackupTest.php +++ b/tests/Integration/Api/Client/Server/Backup/DeleteBackupTest.php @@ -15,7 +15,7 @@ class DeleteBackupTest extends ClientApiIntegrationTestCase { private MockInterface $repository; - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php b/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php index 9e7136a80..b52702666 100644 --- a/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php +++ b/tests/Integration/Api/Remote/SftpAuthenticationControllerTest.php @@ -19,7 +19,7 @@ class SftpAuthenticationControllerTest extends IntegrationTestCase /** * Sets up the tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/IntegrationTestCase.php b/tests/Integration/IntegrationTestCase.php index 103c97b9b..de6daecc0 100644 --- a/tests/Integration/IntegrationTestCase.php +++ b/tests/Integration/IntegrationTestCase.php @@ -22,7 +22,7 @@ abstract class IntegrationTestCase extends TestCase 'Accept' => 'application/json', ]; - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Services/Allocations/FindAssignableAllocationServiceTest.php b/tests/Integration/Services/Allocations/FindAssignableAllocationServiceTest.php index 3c116cbeb..79090f69e 100644 --- a/tests/Integration/Services/Allocations/FindAssignableAllocationServiceTest.php +++ b/tests/Integration/Services/Allocations/FindAssignableAllocationServiceTest.php @@ -13,7 +13,7 @@ class FindAssignableAllocationServiceTest extends IntegrationTestCase /** * Setup tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Services/Databases/DatabaseManagementServiceTest.php b/tests/Integration/Services/Databases/DatabaseManagementServiceTest.php index 8a0dea312..cccc6939e 100644 --- a/tests/Integration/Services/Databases/DatabaseManagementServiceTest.php +++ b/tests/Integration/Services/Databases/DatabaseManagementServiceTest.php @@ -19,7 +19,7 @@ class DatabaseManagementServiceTest extends IntegrationTestCase /** * Setup tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Services/Databases/DeployServerDatabaseServiceTest.php b/tests/Integration/Services/Databases/DeployServerDatabaseServiceTest.php index ec02c13c7..191e6cc94 100644 --- a/tests/Integration/Services/Databases/DeployServerDatabaseServiceTest.php +++ b/tests/Integration/Services/Databases/DeployServerDatabaseServiceTest.php @@ -18,7 +18,7 @@ class DeployServerDatabaseServiceTest extends IntegrationTestCase /** * Setup tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Services/Deployment/FindViableNodesServiceTest.php b/tests/Integration/Services/Deployment/FindViableNodesServiceTest.php index 64594c8b6..b501e3a2d 100644 --- a/tests/Integration/Services/Deployment/FindViableNodesServiceTest.php +++ b/tests/Integration/Services/Deployment/FindViableNodesServiceTest.php @@ -13,7 +13,7 @@ class FindViableNodesServiceTest extends IntegrationTestCase { - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Services/Servers/BuildModificationServiceTest.php b/tests/Integration/Services/Servers/BuildModificationServiceTest.php index f63efee9e..bf0b99a54 100644 --- a/tests/Integration/Services/Servers/BuildModificationServiceTest.php +++ b/tests/Integration/Services/Servers/BuildModificationServiceTest.php @@ -21,7 +21,7 @@ class BuildModificationServiceTest extends IntegrationTestCase /** * Setup tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Services/Servers/ServerCreationServiceTest.php b/tests/Integration/Services/Servers/ServerCreationServiceTest.php index 378070c07..65717ecb1 100644 --- a/tests/Integration/Services/Servers/ServerCreationServiceTest.php +++ b/tests/Integration/Services/Servers/ServerCreationServiceTest.php @@ -31,7 +31,7 @@ class ServerCreationServiceTest extends IntegrationTestCase /** * Stub the calls to Wings so that we don't actually hit those API endpoints. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Services/Servers/ServerDeletionServiceTest.php b/tests/Integration/Services/Servers/ServerDeletionServiceTest.php index 676a60416..0847a8fa7 100644 --- a/tests/Integration/Services/Servers/ServerDeletionServiceTest.php +++ b/tests/Integration/Services/Servers/ServerDeletionServiceTest.php @@ -25,7 +25,7 @@ class ServerDeletionServiceTest extends IntegrationTestCase /** * Stub out services that we don't want to test in here. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Services/Servers/SuspensionServiceTest.php b/tests/Integration/Services/Servers/SuspensionServiceTest.php index e3f925cf5..43cff1f80 100644 --- a/tests/Integration/Services/Servers/SuspensionServiceTest.php +++ b/tests/Integration/Services/Servers/SuspensionServiceTest.php @@ -15,7 +15,7 @@ class SuspensionServiceTest extends IntegrationTestCase /** * Setup test instance. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Services/Servers/VariableValidatorServiceTest.php b/tests/Integration/Services/Servers/VariableValidatorServiceTest.php index a81f24dc0..f784f11d1 100644 --- a/tests/Integration/Services/Servers/VariableValidatorServiceTest.php +++ b/tests/Integration/Services/Servers/VariableValidatorServiceTest.php @@ -13,7 +13,7 @@ class VariableValidatorServiceTest extends IntegrationTestCase { protected Egg $egg; - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/TestCase.php b/tests/TestCase.php index 5e131fa8b..d0b93a517 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -13,7 +13,7 @@ abstract class TestCase extends BaseTestCase /** * Setup tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Unit/Http/Middleware/Api/Daemon/DaemonAuthenticateTest.php b/tests/Unit/Http/Middleware/Api/Daemon/DaemonAuthenticateTest.php index 8c8c76920..3f0c94f6e 100644 --- a/tests/Unit/Http/Middleware/Api/Daemon/DaemonAuthenticateTest.php +++ b/tests/Unit/Http/Middleware/Api/Daemon/DaemonAuthenticateTest.php @@ -23,7 +23,7 @@ class DaemonAuthenticateTest extends MiddlewareTestCase /** * Setup tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Unit/Http/Middleware/LanguageMiddlewareTest.php b/tests/Unit/Http/Middleware/LanguageMiddlewareTest.php index 214cb9dc0..1a58967f0 100644 --- a/tests/Unit/Http/Middleware/LanguageMiddlewareTest.php +++ b/tests/Unit/Http/Middleware/LanguageMiddlewareTest.php @@ -15,7 +15,7 @@ class LanguageMiddlewareTest extends MiddlewareTestCase /** * Setup tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Unit/Http/Middleware/MaintenanceMiddlewareTest.php b/tests/Unit/Http/Middleware/MaintenanceMiddlewareTest.php index 573c78814..d3c303781 100644 --- a/tests/Unit/Http/Middleware/MaintenanceMiddlewareTest.php +++ b/tests/Unit/Http/Middleware/MaintenanceMiddlewareTest.php @@ -17,7 +17,7 @@ class MaintenanceMiddlewareTest extends MiddlewareTestCase /** * Setup tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Unit/Http/Middleware/MiddlewareTestCase.php b/tests/Unit/Http/Middleware/MiddlewareTestCase.php index b716681d8..d01e3fd49 100644 --- a/tests/Unit/Http/Middleware/MiddlewareTestCase.php +++ b/tests/Unit/Http/Middleware/MiddlewareTestCase.php @@ -16,7 +16,7 @@ abstract class MiddlewareTestCase extends TestCase /** * Setup tests with a mocked request object and normal attributes. */ - public function setUp(): void + protected function setUp(): void { parent::setUp(); diff --git a/tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php b/tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php index 68f238aaf..64b85e213 100644 --- a/tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php +++ b/tests/Unit/Http/Middleware/RedirectIfAuthenticatedTest.php @@ -15,7 +15,7 @@ class RedirectIfAuthenticatedTest extends MiddlewareTestCase /** * Setup tests. */ - public function setUp(): void + protected function setUp(): void { parent::setUp();