From b28525d718f6e0aa7e1f5b8bc050966a38e72cbb Mon Sep 17 00:00:00 2001 From: Younes ENNAJI Date: Mon, 27 May 2024 00:34:47 +0100 Subject: [PATCH] chore: add and run phpstan phpunit --- composer.json | 5 +- composer.lock | 80 +++++++++++++++---- package-lock.json | 2 +- phpstan.neon.dist | 5 ++ .../Component/FlasherComponentTest.php | 2 + tests/Laravel/Http/RequestTest.php | 2 + tests/Laravel/Http/ResponseTest.php | 2 + .../Middleware/FlasherMiddlewareTest.php | 2 + .../Middleware/SessionMiddlewareTest.php | 2 + tests/Laravel/Storage/SessionBagTest.php | 2 + tests/Laravel/Translation/TranslatorTest.php | 2 + .../FlasherNotyServiceProviderTest.php | 2 + tests/Noty/Prime/NotyBuilderTest.php | 2 + tests/Noty/Prime/NotyPluginTest.php | 2 + .../Symfony/FlasherNotySymfonyBundleTest.php | 2 + .../FlasherNotyfServiceProviderTest.php | 2 + tests/Notyf/Prime/NotyfBuilderTest.php | 2 + tests/Notyf/Prime/NotyfPluginTest.php | 2 + .../Symfony/FlasherNotyfSymfonyBundleTest.php | 2 + tests/Prime/Asset/AssetManagerTest.php | 4 + .../Prime/Container/FlasherContainerTest.php | 2 + .../EventDispatcher/EventDispatcherTest.php | 2 + tests/Prime/FlasherTest.php | 2 + .../Csp/ContentSecurityPolicyHandlerTest.php | 2 + tests/Prime/Http/Csp/NonceGeneratorTest.php | 2 + tests/Prime/Http/RequestExtensionTest.php | 2 + tests/Prime/Notification/EnvelopeTest.php | 1 + .../Prime/Notification/FlasherBuilderTest.php | 2 - tests/Prime/Stamp/CreatedAtStampTest.php | 2 + tests/Prime/Stamp/DelayStampTest.php | 2 + tests/Prime/Stamp/HtmlStampTest.php | 2 + tests/Prime/Storage/Bag/ArrayBagTest.php | 2 + tests/Prime/Storage/Bag/StaticBagTest.php | 2 + .../Storage/Filter/FilterFactoryTest.php | 2 + tests/Prime/Storage/Filter/FilterTest.php | 2 + tests/Prime/Storage/StorageManagerTest.php | 2 + tests/Prime/Storage/StorageTest.php | 2 + .../Prime/Template/PHPTemplateEngineTest.php | 2 + .../Prime/Translation/EchoTranslatorTest.php | 2 + .../FlasherSweetAlertServiceProviderTest.php | 2 + .../Prime/SweetAlertBuilderTest.php | 2 + .../SweetAlert/Prime/SweetAlertPluginTest.php | 2 + .../FlasherSweetAlertSymfonyBundleTest.php | 2 + tests/Symfony/Command/InstallCommandTest.php | 2 + .../EventListenerCompilerPassTest.php | 2 + .../Compiler/PresenterCompilerPassTest.php | 2 + .../FlasherExtensionTest.php | 2 + .../EventListener/FlasherListenerTest.php | 2 + .../EventListener/SessionListenerTest.php | 2 + .../NotificationFactoryLocatorTest.php | 2 + tests/Symfony/FlasherSymfonyBundleTest.php | 2 + tests/Symfony/Http/RequestTest.php | 2 + tests/Symfony/Http/ResponseTest.php | 2 + tests/Symfony/Storage/FallbackSessionTest.php | 2 + tests/Symfony/Storage/SessionBagTest.php | 2 + tests/Symfony/Translation/TranslatorTest.php | 2 + .../Symfony/Twig/FlasherTwigExtensionTest.php | 4 + .../FlasherToastrServiceProviderTest.php | 2 + tests/Toastr/Prime/ToastrBuilderTest.php | 2 + tests/Toastr/Prime/ToastrPluginTest.php | 2 + .../FlasherToastrSymfonyBundleTest.php | 2 + 61 files changed, 190 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 2623b4a4..b27de838 100644 --- a/composer.json +++ b/composer.json @@ -35,11 +35,12 @@ "php-cs-fixer/shim": "^3.57.2", "phpstan/phpstan": "^1.11.2", "phpstan/phpstan-mockery": "^1.1.2", + "phpstan/phpstan-phpunit": "^1.4", "phpstan/phpstan-symfony": "^1.4.1", - "phpunit/phpunit": "^10.5.13", + "phpunit/phpunit": "^10.5.20", "psr/container": "^1.1|^2.0", "rector/rector": "^1.1.0", - "rector/swiss-knife": "^0.2.3", + "rector/swiss-knife": "^0.2.6", "symfony/config": "^7.0", "symfony/console": "^7.0", "symfony/dependency-injection": "^7.0", diff --git a/composer.lock b/composer.lock index b5be75a2..462a67e4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7e78d762177a41a7c6e4daab644b5e32", + "content-hash": "6277b51593db73ef534b68b04ddc8f13", "packages": [], "packages-dev": [ { @@ -3852,6 +3852,58 @@ }, "time": "2024-01-10T13:50:05+00:00" }, + { + "name": "phpstan/phpstan-phpunit", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-phpunit.git", + "reference": "f3ea021866f4263f07ca3636bf22c64be9610c11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/f3ea021866f4263f07ca3636bf22c64be9610c11", + "reference": "f3ea021866f4263f07ca3636bf22c64be9610c11", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.11" + }, + "conflict": { + "phpunit/phpunit": "<7.0" + }, + "require-dev": { + "nikic/php-parser": "^4.13.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-strict-rules": "^1.5.1", + "phpunit/phpunit": "^9.5" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon", + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPUnit extensions and rules for PHPStan", + "support": { + "issues": "https://github.com/phpstan/phpstan-phpunit/issues", + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.0" + }, + "time": "2024-04-20T06:39:00+00:00" + }, { "name": "phpstan/phpstan-symfony", "version": "1.4.1", @@ -4245,16 +4297,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.13", + "version": "10.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "20a63fc1c6db29b15da3bd02d4b6cf59900088a7" + "reference": "547d314dc24ec1e177720d45c6263fb226cc2ae3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/20a63fc1c6db29b15da3bd02d4b6cf59900088a7", - "reference": "20a63fc1c6db29b15da3bd02d4b6cf59900088a7", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/547d314dc24ec1e177720d45c6263fb226cc2ae3", + "reference": "547d314dc24ec1e177720d45c6263fb226cc2ae3", "shasum": "" }, "require": { @@ -4326,7 +4378,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.13" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.20" }, "funding": [ { @@ -4342,7 +4394,7 @@ "type": "tidelift" } ], - "time": "2024-03-12T15:37:41+00:00" + "time": "2024-04-24T06:32:35+00:00" }, { "name": "psr/cache", @@ -5160,16 +5212,16 @@ }, { "name": "rector/swiss-knife", - "version": "0.2.3", + "version": "0.2.6", "source": { "type": "git", "url": "https://github.com/rectorphp/swiss-knife.git", - "reference": "618ffe570d2a5316adf9cdab092e789c7f7b0bce" + "reference": "aa076d88df0020266502d014f8b414e43b4b5da4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/swiss-knife/zipball/618ffe570d2a5316adf9cdab092e789c7f7b0bce", - "reference": "618ffe570d2a5316adf9cdab092e789c7f7b0bce", + "url": "https://api.github.com/repos/rectorphp/swiss-knife/zipball/aa076d88df0020266502d014f8b414e43b4b5da4", + "reference": "aa076d88df0020266502d014f8b414e43b4b5da4", "shasum": "" }, "require": { @@ -5186,7 +5238,7 @@ "description": "Swiss knife in pocket of every upgrade architect", "support": { "issues": "https://github.com/rectorphp/swiss-knife/issues", - "source": "https://github.com/rectorphp/swiss-knife/tree/0.2.3" + "source": "https://github.com/rectorphp/swiss-knife/tree/0.2.6" }, "funding": [ { @@ -5198,7 +5250,7 @@ "type": "github" } ], - "time": "2024-05-10T07:38:18+00:00" + "time": "2024-05-26T02:44:18+00:00" }, { "name": "sebastian/cli-parser", @@ -10756,7 +10808,7 @@ "minimum-stability": "dev", "stability-flags": [], "prefer-stable": true, - "prefer-lowest": true, + "prefer-lowest": false, "platform": { "php": ">=8.2", "ext-intl": "*" diff --git a/package-lock.json b/package-lock.json index 80e6e46a..f0925459 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2015,7 +2015,7 @@ }, "node_modules/@clack/prompts/node_modules/is-unicode-supported": { "version": "1.3.0", - "extraneous": true, + "dev": true, "inBundle": true, "license": "MIT", "engines": { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 7e4464c2..1d6a4959 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -5,6 +5,8 @@ includes: - vendor/phpstan/phpstan-symfony/rules.neon - vendor/larastan/larastan/extension.neon - vendor/phpstan/phpstan-mockery/extension.neon + - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/phpstan/phpstan-phpunit/rules.neon parameters: level: 9 @@ -14,3 +16,6 @@ parameters: - tests/ tmpDir: .cache/phpstan + + ignoreErrors: + - '#Call to method .+ with .+ will always evaluate to true.#' diff --git a/tests/Laravel/Component/FlasherComponentTest.php b/tests/Laravel/Component/FlasherComponentTest.php index a9bcb70a..31e79614 100644 --- a/tests/Laravel/Component/FlasherComponentTest.php +++ b/tests/Laravel/Component/FlasherComponentTest.php @@ -21,6 +21,8 @@ final class FlasherComponentTest extends TestCase protected function setUp(): void { + parent::setUp(); + $flasherServiceMock = \Mockery::mock(FlasherInterface::class); $flasherServiceMock->allows('render') ->andReturns('Your expected result'); diff --git a/tests/Laravel/Http/RequestTest.php b/tests/Laravel/Http/RequestTest.php index 75691e8f..803ac1d9 100644 --- a/tests/Laravel/Http/RequestTest.php +++ b/tests/Laravel/Http/RequestTest.php @@ -19,6 +19,8 @@ final class RequestTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->laravelRequestMock = \Mockery::mock(LaravelRequest::class); } diff --git a/tests/Laravel/Http/ResponseTest.php b/tests/Laravel/Http/ResponseTest.php index ad533c5e..b44e449c 100644 --- a/tests/Laravel/Http/ResponseTest.php +++ b/tests/Laravel/Http/ResponseTest.php @@ -21,6 +21,8 @@ final class ResponseTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->responseHeaderBagMock = \Mockery::mock(ResponseHeaderBag::class); $this->responseMock = \Mockery::mock(LaravelResponse::class); diff --git a/tests/Laravel/Middleware/FlasherMiddlewareTest.php b/tests/Laravel/Middleware/FlasherMiddlewareTest.php index 6c0fd5a2..43f2b3d8 100644 --- a/tests/Laravel/Middleware/FlasherMiddlewareTest.php +++ b/tests/Laravel/Middleware/FlasherMiddlewareTest.php @@ -24,6 +24,8 @@ final class FlasherMiddlewareTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->responseExtensionMock = \Mockery::mock(ResponseExtensionInterface::class); $this->middleware = new FlasherMiddleware($this->responseExtensionMock); } diff --git a/tests/Laravel/Middleware/SessionMiddlewareTest.php b/tests/Laravel/Middleware/SessionMiddlewareTest.php index 799fd9cf..f9832f2b 100644 --- a/tests/Laravel/Middleware/SessionMiddlewareTest.php +++ b/tests/Laravel/Middleware/SessionMiddlewareTest.php @@ -30,6 +30,8 @@ final class SessionMiddlewareTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->requestExtensionMock = \Mockery::mock(RequestExtensionInterface::class); $this->sessionMiddleware = new SessionMiddleware($this->requestExtensionMock); } diff --git a/tests/Laravel/Storage/SessionBagTest.php b/tests/Laravel/Storage/SessionBagTest.php index c05e94d6..ee218043 100644 --- a/tests/Laravel/Storage/SessionBagTest.php +++ b/tests/Laravel/Storage/SessionBagTest.php @@ -23,6 +23,8 @@ final class SessionBagTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->sessionManagerMock = \Mockery::mock(SessionManager::class); $this->sessionBag = new SessionBag($this->sessionManagerMock); } diff --git a/tests/Laravel/Translation/TranslatorTest.php b/tests/Laravel/Translation/TranslatorTest.php index ae3d685e..1c84ba62 100644 --- a/tests/Laravel/Translation/TranslatorTest.php +++ b/tests/Laravel/Translation/TranslatorTest.php @@ -18,6 +18,8 @@ final class TranslatorTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->laravelTranslatorMock = \Mockery::mock(LaravelTranslator::class); } diff --git a/tests/Noty/Laravel/FlasherNotyServiceProviderTest.php b/tests/Noty/Laravel/FlasherNotyServiceProviderTest.php index 8a9a41f4..cc2475b5 100644 --- a/tests/Noty/Laravel/FlasherNotyServiceProviderTest.php +++ b/tests/Noty/Laravel/FlasherNotyServiceProviderTest.php @@ -21,6 +21,8 @@ final class FlasherNotyServiceProviderTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->app = \Mockery::mock(Application::class); $this->serviceProvider = new FlasherNotyServiceProvider($this->app); } diff --git a/tests/Noty/Prime/NotyBuilderTest.php b/tests/Noty/Prime/NotyBuilderTest.php index e5a0bb48..acdf8d4a 100644 --- a/tests/Noty/Prime/NotyBuilderTest.php +++ b/tests/Noty/Prime/NotyBuilderTest.php @@ -14,6 +14,8 @@ final class NotyBuilderTest extends TestCase protected function setUp(): void { + parent::setUp(); + $storageManagerMock = \Mockery::mock(StorageManagerInterface::class); $this->notyBuilder = new NotyBuilder('noty', $storageManagerMock); } diff --git a/tests/Noty/Prime/NotyPluginTest.php b/tests/Noty/Prime/NotyPluginTest.php index f53f8ebd..1d7234bc 100644 --- a/tests/Noty/Prime/NotyPluginTest.php +++ b/tests/Noty/Prime/NotyPluginTest.php @@ -15,6 +15,8 @@ final class NotyPluginTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->notyPlugin = new NotyPlugin(); } diff --git a/tests/Noty/Symfony/FlasherNotySymfonyBundleTest.php b/tests/Noty/Symfony/FlasherNotySymfonyBundleTest.php index daa9c667..d9fbac2c 100644 --- a/tests/Noty/Symfony/FlasherNotySymfonyBundleTest.php +++ b/tests/Noty/Symfony/FlasherNotySymfonyBundleTest.php @@ -18,6 +18,8 @@ final class FlasherNotySymfonyBundleTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->flasherNotyBundle = new FlasherNotySymfonyBundle(); } diff --git a/tests/Notyf/Laravel/FlasherNotyfServiceProviderTest.php b/tests/Notyf/Laravel/FlasherNotyfServiceProviderTest.php index 0d12c856..1179f85f 100644 --- a/tests/Notyf/Laravel/FlasherNotyfServiceProviderTest.php +++ b/tests/Notyf/Laravel/FlasherNotyfServiceProviderTest.php @@ -21,6 +21,8 @@ final class FlasherNotyfServiceProviderTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->app = \Mockery::mock(Application::class); $this->serviceProvider = new FlasherNotyfServiceProvider($this->app); } diff --git a/tests/Notyf/Prime/NotyfBuilderTest.php b/tests/Notyf/Prime/NotyfBuilderTest.php index cf005d87..e68bfdf8 100644 --- a/tests/Notyf/Prime/NotyfBuilderTest.php +++ b/tests/Notyf/Prime/NotyfBuilderTest.php @@ -14,6 +14,8 @@ final class NotyfBuilderTest extends TestCase protected function setUp(): void { + parent::setUp(); + $storageManagerMock = \Mockery::mock(StorageManagerInterface::class); $this->notyfBuilder = new NotyfBuilder('notyf', $storageManagerMock); } diff --git a/tests/Notyf/Prime/NotyfPluginTest.php b/tests/Notyf/Prime/NotyfPluginTest.php index e8eb88a3..412b4e83 100644 --- a/tests/Notyf/Prime/NotyfPluginTest.php +++ b/tests/Notyf/Prime/NotyfPluginTest.php @@ -15,6 +15,8 @@ final class NotyfPluginTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->notyfPlugin = new NotyfPlugin(); } diff --git a/tests/Notyf/Symfony/FlasherNotyfSymfonyBundleTest.php b/tests/Notyf/Symfony/FlasherNotyfSymfonyBundleTest.php index afd74b06..04cdbcd3 100644 --- a/tests/Notyf/Symfony/FlasherNotyfSymfonyBundleTest.php +++ b/tests/Notyf/Symfony/FlasherNotyfSymfonyBundleTest.php @@ -18,6 +18,8 @@ final class FlasherNotyfSymfonyBundleTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->flasherNotyfBundle = new FlasherNotyfSymfonyBundle(); } diff --git a/tests/Prime/Asset/AssetManagerTest.php b/tests/Prime/Asset/AssetManagerTest.php index 6fade10d..9b528566 100644 --- a/tests/Prime/Asset/AssetManagerTest.php +++ b/tests/Prime/Asset/AssetManagerTest.php @@ -14,12 +14,16 @@ final class AssetManagerTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->publicDir = __DIR__.'/../Fixtures/Asset'; $this->manifestPath = __DIR__.'/../Fixtures/Asset/manifest.json'; } protected function tearDown(): void { + parent::tearDown(); + if (file_exists($this->manifestPath)) { unlink($this->manifestPath); } diff --git a/tests/Prime/Container/FlasherContainerTest.php b/tests/Prime/Container/FlasherContainerTest.php index ac01f0b9..765cd45f 100644 --- a/tests/Prime/Container/FlasherContainerTest.php +++ b/tests/Prime/Container/FlasherContainerTest.php @@ -14,6 +14,8 @@ final class FlasherContainerTest extends TestCase { protected function setUp(): void { + parent::setUp(); + // Reset the FlasherContainer instance to ensure isolation between tests FlasherContainer::reset(); } diff --git a/tests/Prime/EventDispatcher/EventDispatcherTest.php b/tests/Prime/EventDispatcher/EventDispatcherTest.php index 1187060d..05a3ab6d 100644 --- a/tests/Prime/EventDispatcher/EventDispatcherTest.php +++ b/tests/Prime/EventDispatcher/EventDispatcherTest.php @@ -19,6 +19,8 @@ final class EventDispatcherTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->dispatcher = new EventDispatcher(); } diff --git a/tests/Prime/FlasherTest.php b/tests/Prime/FlasherTest.php index 2a181cd5..81fdcb27 100644 --- a/tests/Prime/FlasherTest.php +++ b/tests/Prime/FlasherTest.php @@ -26,6 +26,8 @@ final class FlasherTest extends MockeryTestCase protected function setUp(): void { + parent::setUp(); + $this->factoryLocatorMock = \Mockery::mock(NotificationFactoryLocatorInterface::class); $this->responseManagerMock = \Mockery::mock(ResponseManagerInterface::class); $this->storageManagerMock = \Mockery::mock(StorageManagerInterface::class); diff --git a/tests/Prime/Http/Csp/ContentSecurityPolicyHandlerTest.php b/tests/Prime/Http/Csp/ContentSecurityPolicyHandlerTest.php index 1f208946..5588e8c2 100644 --- a/tests/Prime/Http/Csp/ContentSecurityPolicyHandlerTest.php +++ b/tests/Prime/Http/Csp/ContentSecurityPolicyHandlerTest.php @@ -26,6 +26,8 @@ final class ContentSecurityPolicyHandlerTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->nonceGeneratorMock = $this->createMock(NonceGeneratorInterface::class); $this->requestMock = $this->createMock(RequestInterface::class); $this->responseMock = $this->createMock(ResponseInterface::class); diff --git a/tests/Prime/Http/Csp/NonceGeneratorTest.php b/tests/Prime/Http/Csp/NonceGeneratorTest.php index 7b7711c7..699c17ca 100644 --- a/tests/Prime/Http/Csp/NonceGeneratorTest.php +++ b/tests/Prime/Http/Csp/NonceGeneratorTest.php @@ -18,6 +18,8 @@ final class NonceGeneratorTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->nonceGenerator = new NonceGenerator(); } diff --git a/tests/Prime/Http/RequestExtensionTest.php b/tests/Prime/Http/RequestExtensionTest.php index 4e1a3580..b3bc460d 100644 --- a/tests/Prime/Http/RequestExtensionTest.php +++ b/tests/Prime/Http/RequestExtensionTest.php @@ -30,6 +30,8 @@ final class RequestExtensionTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->flasher = \Mockery::mock(FlasherInterface::class); $this->request = \Mockery::mock(RequestInterface::class); $this->response = \Mockery::mock(ResponseInterface::class); diff --git a/tests/Prime/Notification/EnvelopeTest.php b/tests/Prime/Notification/EnvelopeTest.php index e1a5ea99..26c2101e 100644 --- a/tests/Prime/Notification/EnvelopeTest.php +++ b/tests/Prime/Notification/EnvelopeTest.php @@ -259,6 +259,7 @@ final class EnvelopeTest extends TestCase $envelope = new Envelope($notification, new PluginStamp('flasher')); + // @phpstan-ignore-next-line $this->assertSame([ 'title' => 'PHPFlasher', 'message' => 'success message', diff --git a/tests/Prime/Notification/FlasherBuilderTest.php b/tests/Prime/Notification/FlasherBuilderTest.php index dbb424ff..c9aa94ed 100644 --- a/tests/Prime/Notification/FlasherBuilderTest.php +++ b/tests/Prime/Notification/FlasherBuilderTest.php @@ -519,8 +519,6 @@ final class FlasherBuilderTest extends TestCase /** * @phpstan-param MockObject|StorageManagerInterface $storageManager - * - * @phpstan-ignore-next-line */ private function getNotificationBuilder(?StorageManagerInterface $storageManager = null): NotificationBuilderInterface { diff --git a/tests/Prime/Stamp/CreatedAtStampTest.php b/tests/Prime/Stamp/CreatedAtStampTest.php index 3fd35c50..59394b3d 100644 --- a/tests/Prime/Stamp/CreatedAtStampTest.php +++ b/tests/Prime/Stamp/CreatedAtStampTest.php @@ -17,6 +17,8 @@ final class CreatedAtStampTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->time = new \DateTimeImmutable('2023-01-01 12:00:00'); $this->format = 'Y-m-d H:i:s'; $this->createdAtStamp = new CreatedAtStamp($this->time, $this->format); diff --git a/tests/Prime/Stamp/DelayStampTest.php b/tests/Prime/Stamp/DelayStampTest.php index b64f63a8..562630a9 100644 --- a/tests/Prime/Stamp/DelayStampTest.php +++ b/tests/Prime/Stamp/DelayStampTest.php @@ -14,6 +14,8 @@ final class DelayStampTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->testDelay = 100; $this->instance = new DelayStamp($this->testDelay); } diff --git a/tests/Prime/Stamp/HtmlStampTest.php b/tests/Prime/Stamp/HtmlStampTest.php index b507b9ee..8f728eb4 100644 --- a/tests/Prime/Stamp/HtmlStampTest.php +++ b/tests/Prime/Stamp/HtmlStampTest.php @@ -14,6 +14,8 @@ final class HtmlStampTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->htmlString = '
Hello World
'; $this->htmlStamp = new HtmlStamp($this->htmlString); } diff --git a/tests/Prime/Storage/Bag/ArrayBagTest.php b/tests/Prime/Storage/Bag/ArrayBagTest.php index 571afc39..2054c717 100644 --- a/tests/Prime/Storage/Bag/ArrayBagTest.php +++ b/tests/Prime/Storage/Bag/ArrayBagTest.php @@ -15,6 +15,8 @@ final class ArrayBagTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->bag = new ArrayBag(); } diff --git a/tests/Prime/Storage/Bag/StaticBagTest.php b/tests/Prime/Storage/Bag/StaticBagTest.php index 43a8fa15..5ecb16b5 100644 --- a/tests/Prime/Storage/Bag/StaticBagTest.php +++ b/tests/Prime/Storage/Bag/StaticBagTest.php @@ -15,6 +15,8 @@ final class StaticBagTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->staticBag = new StaticBag(); } diff --git a/tests/Prime/Storage/Filter/FilterFactoryTest.php b/tests/Prime/Storage/Filter/FilterFactoryTest.php index 82cca9af..32bdd54e 100644 --- a/tests/Prime/Storage/Filter/FilterFactoryTest.php +++ b/tests/Prime/Storage/Filter/FilterFactoryTest.php @@ -17,6 +17,8 @@ final class FilterFactoryTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->filterFactory = new FilterFactory(); } diff --git a/tests/Prime/Storage/Filter/FilterTest.php b/tests/Prime/Storage/Filter/FilterTest.php index 828fddc4..3774c954 100644 --- a/tests/Prime/Storage/Filter/FilterTest.php +++ b/tests/Prime/Storage/Filter/FilterTest.php @@ -17,6 +17,8 @@ final class FilterTest extends MockeryTestCase protected function setUp(): void { + parent::setUp(); + $this->filter = new Filter(); } diff --git a/tests/Prime/Storage/StorageManagerTest.php b/tests/Prime/Storage/StorageManagerTest.php index 97527780..fc525aa8 100644 --- a/tests/Prime/Storage/StorageManagerTest.php +++ b/tests/Prime/Storage/StorageManagerTest.php @@ -36,6 +36,8 @@ final class StorageManagerTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->storageMock = \Mockery::mock(StorageInterface::class); $this->filterFactoryMock = \Mockery::mock(FilterFactoryInterface::class); $this->eventDispatcherMock = \Mockery::mock(EventDispatcherInterface::class); diff --git a/tests/Prime/Storage/StorageTest.php b/tests/Prime/Storage/StorageTest.php index be01eba7..2a898f22 100644 --- a/tests/Prime/Storage/StorageTest.php +++ b/tests/Prime/Storage/StorageTest.php @@ -17,6 +17,8 @@ final class StorageTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->storage = new Storage(new ArrayBag()); } diff --git a/tests/Prime/Template/PHPTemplateEngineTest.php b/tests/Prime/Template/PHPTemplateEngineTest.php index 53900e47..16e22c9b 100644 --- a/tests/Prime/Template/PHPTemplateEngineTest.php +++ b/tests/Prime/Template/PHPTemplateEngineTest.php @@ -13,6 +13,8 @@ final class PHPTemplateEngineTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->templateEngine = new PHPTemplateEngine(); } diff --git a/tests/Prime/Translation/EchoTranslatorTest.php b/tests/Prime/Translation/EchoTranslatorTest.php index 9466913d..38d8a9ca 100644 --- a/tests/Prime/Translation/EchoTranslatorTest.php +++ b/tests/Prime/Translation/EchoTranslatorTest.php @@ -13,6 +13,8 @@ final class EchoTranslatorTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->translator = new EchoTranslator(); } diff --git a/tests/SweetAlert/Laravel/FlasherSweetAlertServiceProviderTest.php b/tests/SweetAlert/Laravel/FlasherSweetAlertServiceProviderTest.php index 468fdc45..3ad45d18 100644 --- a/tests/SweetAlert/Laravel/FlasherSweetAlertServiceProviderTest.php +++ b/tests/SweetAlert/Laravel/FlasherSweetAlertServiceProviderTest.php @@ -21,6 +21,8 @@ final class FlasherSweetAlertServiceProviderTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->app = \Mockery::mock(Application::class); $this->serviceProvider = new FlasherSweetAlertServiceProvider($this->app); } diff --git a/tests/SweetAlert/Prime/SweetAlertBuilderTest.php b/tests/SweetAlert/Prime/SweetAlertBuilderTest.php index 5360d1c5..c6ba9ea8 100644 --- a/tests/SweetAlert/Prime/SweetAlertBuilderTest.php +++ b/tests/SweetAlert/Prime/SweetAlertBuilderTest.php @@ -16,6 +16,8 @@ final class SweetAlertBuilderTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->storageManagerMock = \Mockery::mock(StorageManagerInterface::class); $this->sweetAlertBuilder = new SweetAlertBuilder('sweetAlert', $this->storageManagerMock); } diff --git a/tests/SweetAlert/Prime/SweetAlertPluginTest.php b/tests/SweetAlert/Prime/SweetAlertPluginTest.php index b356210d..42fd3f32 100644 --- a/tests/SweetAlert/Prime/SweetAlertPluginTest.php +++ b/tests/SweetAlert/Prime/SweetAlertPluginTest.php @@ -15,6 +15,8 @@ final class SweetAlertPluginTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->sweetAlertPlugin = new SweetAlertPlugin(); } diff --git a/tests/SweetAlert/Symfony/FlasherSweetAlertSymfonyBundleTest.php b/tests/SweetAlert/Symfony/FlasherSweetAlertSymfonyBundleTest.php index d3303641..8b08600c 100644 --- a/tests/SweetAlert/Symfony/FlasherSweetAlertSymfonyBundleTest.php +++ b/tests/SweetAlert/Symfony/FlasherSweetAlertSymfonyBundleTest.php @@ -18,6 +18,8 @@ final class FlasherSweetAlertSymfonyBundleTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->flasherSweetAlertBundle = new FlasherSweetAlertSymfonyBundle(); } diff --git a/tests/Symfony/Command/InstallCommandTest.php b/tests/Symfony/Command/InstallCommandTest.php index ac50d955..53ee8b85 100644 --- a/tests/Symfony/Command/InstallCommandTest.php +++ b/tests/Symfony/Command/InstallCommandTest.php @@ -16,6 +16,8 @@ final class InstallCommandTest extends MockeryTestCase protected function setUp(): void { + parent::setUp(); + $kernel = new FlasherKernel(); $kernel->boot(); diff --git a/tests/Symfony/DependencyInjection/Compiler/EventListenerCompilerPassTest.php b/tests/Symfony/DependencyInjection/Compiler/EventListenerCompilerPassTest.php index 54d7ca82..18523bb7 100644 --- a/tests/Symfony/DependencyInjection/Compiler/EventListenerCompilerPassTest.php +++ b/tests/Symfony/DependencyInjection/Compiler/EventListenerCompilerPassTest.php @@ -21,6 +21,8 @@ final class EventListenerCompilerPassTest extends MockeryTestCase protected function setUp(): void { + parent::setUp(); + $this->compilerPass = new EventListenerCompilerPass(); $this->container = new ContainerBuilder(); } diff --git a/tests/Symfony/DependencyInjection/Compiler/PresenterCompilerPassTest.php b/tests/Symfony/DependencyInjection/Compiler/PresenterCompilerPassTest.php index 3ccd0f91..ef7141b6 100644 --- a/tests/Symfony/DependencyInjection/Compiler/PresenterCompilerPassTest.php +++ b/tests/Symfony/DependencyInjection/Compiler/PresenterCompilerPassTest.php @@ -17,6 +17,8 @@ final class PresenterCompilerPassTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->compilerPass = new PresenterCompilerPass(); $this->container = new ContainerBuilder(); } diff --git a/tests/Symfony/DependencyInjection/FlasherExtensionTest.php b/tests/Symfony/DependencyInjection/FlasherExtensionTest.php index c6dd0978..c6b84be2 100644 --- a/tests/Symfony/DependencyInjection/FlasherExtensionTest.php +++ b/tests/Symfony/DependencyInjection/FlasherExtensionTest.php @@ -17,6 +17,8 @@ final class FlasherExtensionTest extends MockeryTestCase protected function setUp(): void { + parent::setUp(); + $this->container = new ContainerBuilder(); $this->extension = new FlasherExtension(new FlasherPlugin()); diff --git a/tests/Symfony/EventListener/FlasherListenerTest.php b/tests/Symfony/EventListener/FlasherListenerTest.php index 5d2c4d7c..942bd4ef 100644 --- a/tests/Symfony/EventListener/FlasherListenerTest.php +++ b/tests/Symfony/EventListener/FlasherListenerTest.php @@ -25,6 +25,8 @@ final class FlasherListenerTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->responseExtensionMock = \Mockery::mock(ResponseExtensionInterface::class); $this->flasherListener = new FlasherListener($this->responseExtensionMock); } diff --git a/tests/Symfony/EventListener/SessionListenerTest.php b/tests/Symfony/EventListener/SessionListenerTest.php index 7d929a07..ba4536b6 100644 --- a/tests/Symfony/EventListener/SessionListenerTest.php +++ b/tests/Symfony/EventListener/SessionListenerTest.php @@ -25,6 +25,8 @@ final class SessionListenerTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->requestExtensionMock = \Mockery::mock(RequestExtensionInterface::class); $this->sessionListener = new SessionListener($this->requestExtensionMock); } diff --git a/tests/Symfony/Factory/NotificationFactoryLocatorTest.php b/tests/Symfony/Factory/NotificationFactoryLocatorTest.php index 7ee8c829..59141db1 100644 --- a/tests/Symfony/Factory/NotificationFactoryLocatorTest.php +++ b/tests/Symfony/Factory/NotificationFactoryLocatorTest.php @@ -22,6 +22,8 @@ final class NotificationFactoryLocatorTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->serviceLocatorMock = \Mockery::mock(ServiceLocator::class); $this->notificationFactoryLocator = new NotificationFactoryLocator($this->serviceLocatorMock); } diff --git a/tests/Symfony/FlasherSymfonyBundleTest.php b/tests/Symfony/FlasherSymfonyBundleTest.php index 02375dbc..83654754 100644 --- a/tests/Symfony/FlasherSymfonyBundleTest.php +++ b/tests/Symfony/FlasherSymfonyBundleTest.php @@ -20,6 +20,8 @@ final class FlasherSymfonyBundleTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->flasherBundle = new FlasherSymfonyBundle(); } diff --git a/tests/Symfony/Http/RequestTest.php b/tests/Symfony/Http/RequestTest.php index 49111530..f536e43c 100644 --- a/tests/Symfony/Http/RequestTest.php +++ b/tests/Symfony/Http/RequestTest.php @@ -26,6 +26,8 @@ final class RequestTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->symfonyRequestMock = \Mockery::mock(SymfonyRequest::class); } diff --git a/tests/Symfony/Http/ResponseTest.php b/tests/Symfony/Http/ResponseTest.php index c7570510..96651d3c 100644 --- a/tests/Symfony/Http/ResponseTest.php +++ b/tests/Symfony/Http/ResponseTest.php @@ -21,6 +21,8 @@ final class ResponseTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->responseHeaderBagMock = \Mockery::mock(ResponseHeaderBag::class); $this->responseMock = \Mockery::mock(SymfonyResponse::class); diff --git a/tests/Symfony/Storage/FallbackSessionTest.php b/tests/Symfony/Storage/FallbackSessionTest.php index b8c199e4..308264d1 100644 --- a/tests/Symfony/Storage/FallbackSessionTest.php +++ b/tests/Symfony/Storage/FallbackSessionTest.php @@ -17,6 +17,8 @@ final class FallbackSessionTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->session = new FallbackSession(); } diff --git a/tests/Symfony/Storage/SessionBagTest.php b/tests/Symfony/Storage/SessionBagTest.php index 6de4c259..9d382b4e 100644 --- a/tests/Symfony/Storage/SessionBagTest.php +++ b/tests/Symfony/Storage/SessionBagTest.php @@ -27,6 +27,8 @@ final class SessionBagTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->requestStackMock = \Mockery::mock(RequestStack::class); $this->fallbackSessionMock = \Mockery::mock(FallbackSessionInterface::class); $this->sessionBag = new SessionBag($this->requestStackMock, $this->fallbackSessionMock); diff --git a/tests/Symfony/Translation/TranslatorTest.php b/tests/Symfony/Translation/TranslatorTest.php index 5135db12..8c9a0ab7 100644 --- a/tests/Symfony/Translation/TranslatorTest.php +++ b/tests/Symfony/Translation/TranslatorTest.php @@ -20,6 +20,8 @@ final class TranslatorTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->symfonyTranslatorMock = \Mockery::mock(SymfonyTranslatorInterface::class); if (interface_exists(TranslatorBagInterface::class)) { $this->symfonyTranslatorMock->allows('getCatalogue')->andReturnUndefined(); diff --git a/tests/Symfony/Twig/FlasherTwigExtensionTest.php b/tests/Symfony/Twig/FlasherTwigExtensionTest.php index 81869cfb..cbdc785f 100644 --- a/tests/Symfony/Twig/FlasherTwigExtensionTest.php +++ b/tests/Symfony/Twig/FlasherTwigExtensionTest.php @@ -21,12 +21,16 @@ final class FlasherTwigExtensionTest extends MockeryTestCase protected function setUp(): void { + parent::setUp(); + $this->flasher = \Mockery::mock(FlasherInterface::class); $this->extension = new FlasherTwigExtension($this->flasher); } protected function tearDown(): void { + parent::tearDown(); + \Mockery::close(); } diff --git a/tests/Toastr/Laravel/FlasherToastrServiceProviderTest.php b/tests/Toastr/Laravel/FlasherToastrServiceProviderTest.php index e19193ba..1d9289ef 100644 --- a/tests/Toastr/Laravel/FlasherToastrServiceProviderTest.php +++ b/tests/Toastr/Laravel/FlasherToastrServiceProviderTest.php @@ -21,6 +21,8 @@ final class FlasherToastrServiceProviderTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->app = \Mockery::mock(Application::class); $this->serviceProvider = new FlasherToastrServiceProvider($this->app); } diff --git a/tests/Toastr/Prime/ToastrBuilderTest.php b/tests/Toastr/Prime/ToastrBuilderTest.php index 86e721c0..2234ce16 100644 --- a/tests/Toastr/Prime/ToastrBuilderTest.php +++ b/tests/Toastr/Prime/ToastrBuilderTest.php @@ -14,6 +14,8 @@ final class ToastrBuilderTest extends TestCase protected function setUp(): void { + parent::setUp(); + $storageManagerMock = \Mockery::mock(StorageManagerInterface::class); $this->toastrBuilder = new ToastrBuilder('toastr', $storageManagerMock); } diff --git a/tests/Toastr/Prime/ToastrPluginTest.php b/tests/Toastr/Prime/ToastrPluginTest.php index c297e8b2..39718ee7 100644 --- a/tests/Toastr/Prime/ToastrPluginTest.php +++ b/tests/Toastr/Prime/ToastrPluginTest.php @@ -15,6 +15,8 @@ final class ToastrPluginTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->toastrPlugin = new ToastrPlugin(); } diff --git a/tests/Toastr/Symfony/FlasherToastrSymfonyBundleTest.php b/tests/Toastr/Symfony/FlasherToastrSymfonyBundleTest.php index 5fd42e2d..a6cf6648 100644 --- a/tests/Toastr/Symfony/FlasherToastrSymfonyBundleTest.php +++ b/tests/Toastr/Symfony/FlasherToastrSymfonyBundleTest.php @@ -18,6 +18,8 @@ final class FlasherToastrSymfonyBundleTest extends TestCase protected function setUp(): void { + parent::setUp(); + $this->flasherToastrBundle = new FlasherToastrSymfonyBundle(); }