Skip to content

Commit

Permalink
Add PHPStan ignore comments in test
Browse files Browse the repository at this point in the history
false-positive, psalm never report it.
  • Loading branch information
koriym committed May 14, 2024
1 parent 51c45a7 commit 232ec35
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/DonutCommandInterceptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ public function testCommandInterceptorRefreshOnErrorCode(): void
public function testCacheableResponse(): void
{
$ro = $this->resource->get('page://self/html/blog-posting-cache?id=0');
assert(property_exists($ro, 'bindings'));
assert(array_key_exists('onGet', $ro->bindings));
$interceptors = array_map(static fn (object $object): string => $object::class, $ro->bindings['onGet']);
$interceptors = array_map(static fn (object $object): string => $object::class, $ro->bindings['onGet']); // @phpstan-ignore-line
$this->assertContains(DonutCacheInterceptor::class, $interceptors);
assert(isset($ro->bindings['onGet'][0]));
assert(isset($ro->bindings['onGet'][0])); // @phpstan-ignore-line

Check failure on line 87 in tests/DonutCommandInterceptorTest.php

View workflow job for this annotation

GitHub Actions / sa / PHPStan

No error to ignore is reported on line 87.
assert(isset($ro->bindings['onDelete'][0]));
$this->assertInstanceOf(DonutCacheInterceptor::class, $ro->bindings['onDelete'][0]);
}
Expand Down

0 comments on commit 232ec35

Please sign in to comment.