Skip to content

Commit b3a1f85

Browse files
authored
chore: ignore construct type for IdSearchResult (#168)
1 parent dbf415d commit b3a1f85

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

phpstan.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,9 @@ parameters:
105105
count: 1
106106
path: src/DependencyInjection/GeneratorCompilerPass.php
107107
reportUnmatched: false
108+
109+
-
110+
message: "#IdSearchResult constructor expects#"
111+
count: 3
112+
path: tests/unit/Controller/Api/TestControllerTest.php
113+
reportUnmatched: false

tests/unit/Controller/Api/TestControllerTest.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testCheckFailsMediaSaving(): void
9393
$mediaRepository = $this->createMock(EntityRepository::class);
9494

9595
$mediaFolderRepository = $this->createMock(EntityRepository::class);
96-
$mediaFolderRepository->expects(static::once())
96+
$mediaFolderRepository->expects($this->once())
9797
->method('searchIds')
9898
->willReturn(
9999
new IdSearchResult(
@@ -200,16 +200,8 @@ public function testCheckWithExistingMedia(): void
200200
});
201201

202202
$mediaFolderRepository = $this->createMock(EntityRepository::class);
203-
$mediaFolderRepository->expects(static::never())
204-
->method('searchIds')
205-
->willReturn(
206-
new IdSearchResult(
207-
1,
208-
[['primaryKey' => 'folder-id', 'data' => []]],
209-
new Criteria(),
210-
Context::createDefaultContext(),
211-
),
212-
);
203+
$mediaFolderRepository->expects($this->never())
204+
->method('searchIds');
213205

214206
$fileSaver = $this->createMock(FileSaver::class);
215207
$fileFetcher = $this->createMock(FileFetcher::class);
@@ -284,7 +276,7 @@ public function testCheck(): void
284276
});
285277

286278
$mediaFolderRepository = $this->createMock(EntityRepository::class);
287-
$mediaFolderRepository->expects(static::once())
279+
$mediaFolderRepository->expects($this->once())
288280
->method('searchIds')
289281
->willReturn(
290282
new IdSearchResult(
@@ -368,7 +360,7 @@ public function testCheckWithSalesChannel(): void
368360
});
369361

370362
$mediaFolderRepository = $this->createMock(EntityRepository::class);
371-
$mediaFolderRepository->expects(static::once())
363+
$mediaFolderRepository->expects($this->once())
372364
->method('searchIds')
373365
->willReturn(
374366
new IdSearchResult(

0 commit comments

Comments
 (0)