Skip to content

Commit cd1aece

Browse files
authored
chore: harden argument type (#167)
1 parent 9cfb808 commit cd1aece

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/unit/Core/Media/MediaUrlGeneratorTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public function testGenerateWithUrlParam(): void
3737
'ExtensionsAllowList' => 'jpg',
3838
'ThumbnailPattern' => '{mediaUrl}/{mediaPath}?width={width}',
3939
];
40-
$configReader->expects($this->any())
40+
$configReader
4141
->method('getConfig')
42-
->willReturnCallback(function ($key) use ($defaultPluginConfig) {
42+
->willReturnCallback(function (string $key) use ($defaultPluginConfig) {
4343
return $defaultPluginConfig[$key] ?? null;
4444
});
4545

@@ -84,9 +84,9 @@ public function testGenerateWithExtendedUrlParam(): void
8484
'ExtensionsAllowList' => 'jpg',
8585
'ThumbnailPattern' => '{mediaUrl}/{mediaPath}?width={width}',
8686
];
87-
$configReader->expects($this->any())
87+
$configReader
8888
->method('getConfig')
89-
->willReturnCallback(function ($key) use ($defaultPluginConfig) {
89+
->willReturnCallback(function (string $key) use ($defaultPluginConfig) {
9090
return $defaultPluginConfig[$key] ?? null;
9191
});
9292

@@ -141,9 +141,9 @@ public function testGenerateWithInactiveConfig(): void
141141
'ExtensionsAllowList' => 'jpg',
142142
'ThumbnailPattern' => '{mediaUrl}/{mediaPath}?width={width}',
143143
];
144-
$configReader->expects($this->any())
144+
$configReader
145145
->method('getConfig')
146-
->willReturnCallback(function ($key) use ($defaultPluginConfig) {
146+
->willReturnCallback(function (string $key) use ($defaultPluginConfig) {
147147
return $defaultPluginConfig[$key] ?? null;
148148
});
149149

@@ -195,9 +195,9 @@ public function testGenerateWithNotAllowedExtensionResultsInOriginal(string $all
195195
'ExtensionsAllowList' => $allowList,
196196
'ThumbnailPattern' => '{mediaUrl}/{mediaPath}?width={width}',
197197
];
198-
$configReader->expects($this->any())
198+
$configReader
199199
->method('getConfig')
200-
->willReturnCallback(function ($key) use ($defaultPluginConfig) {
200+
->willReturnCallback(function (string $key) use ($defaultPluginConfig) {
201201
return $defaultPluginConfig[$key] ?? null;
202202
});
203203

@@ -244,7 +244,7 @@ public function testMultipleGenerationsUseCachedExtensionAllowList(): void
244244
];
245245
$configReader->expects($this->exactly(3))
246246
->method('getConfig')
247-
->willReturnCallback(function ($key) use ($defaultPluginConfig) {
247+
->willReturnCallback(function (string $key) use ($defaultPluginConfig) {
248248
return $defaultPluginConfig[$key] ?? null;
249249
});
250250

0 commit comments

Comments
 (0)