From 2b8f87e1e48dcd1e8c64fb32712691037a6ffdca Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Fri, 3 Jan 2025 10:00:28 +0100 Subject: [PATCH] phpstan level 3 for tests --- phpstan.tests.neon.dist | 3 +-- tests/Unit/SymfonyCache/PurgeListenerTest.php | 4 ++++ tests/Unit/SymfonyCache/PurgeTagsListenerTest.php | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/phpstan.tests.neon.dist b/phpstan.tests.neon.dist index bcef90bc..1a7201ba 100644 --- a/phpstan.tests.neon.dist +++ b/phpstan.tests.neon.dist @@ -1,5 +1,4 @@ parameters: - level: 2 + level: 3 paths: - tests - diff --git a/tests/Unit/SymfonyCache/PurgeListenerTest.php b/tests/Unit/SymfonyCache/PurgeListenerTest.php index a8396bd3..f682abce 100644 --- a/tests/Unit/SymfonyCache/PurgeListenerTest.php +++ b/tests/Unit/SymfonyCache/PurgeListenerTest.php @@ -187,6 +187,8 @@ public function testInvalidConfiguration(): void private function getKernelMock(StoreInterface $store): MockInterface&CacheInvalidation { + // https://github.com/phpstan/phpstan-mockery/issues/8 + /** @phpstan-ignore-next-line */ return \Mockery::mock(CacheInvalidation::class) ->shouldReceive('getStore') ->once() @@ -196,6 +198,8 @@ private function getKernelMock(StoreInterface $store): MockInterface&CacheInvali private function getUnusedKernelMock(): CacheInvalidation&MockInterface { + // https://github.com/phpstan/phpstan-mockery/issues/8 + /** @phpstan-ignore-next-line */ return \Mockery::mock(CacheInvalidation::class) ->shouldNotReceive('getStore') ->getMock(); diff --git a/tests/Unit/SymfonyCache/PurgeTagsListenerTest.php b/tests/Unit/SymfonyCache/PurgeTagsListenerTest.php index 8e06ff30..086102fa 100644 --- a/tests/Unit/SymfonyCache/PurgeTagsListenerTest.php +++ b/tests/Unit/SymfonyCache/PurgeTagsListenerTest.php @@ -180,6 +180,8 @@ public function testInvalidConfiguration(): void private function getKernelMock(StoreInterface $store): CacheInvalidation&MockInterface { + // https://github.com/phpstan/phpstan-mockery/issues/8 + /** @phpstan-ignore-next-line */ return \Mockery::mock(CacheInvalidation::class) ->shouldReceive('getStore') ->once() @@ -189,6 +191,8 @@ private function getKernelMock(StoreInterface $store): CacheInvalidation&MockInt private function getUnusedKernelMock(): CacheInvalidation&MockInterface { + // https://github.com/phpstan/phpstan-mockery/issues/8 + /** @phpstan-ignore-next-line */ return \Mockery::mock(CacheInvalidation::class) ->shouldNotReceive('getStore') ->getMock();