Skip to content

Commit e9955a9

Browse files
committed
fix(tests): preview phpunit
Signed-off-by: John Molakvoæ <[email protected]>
1 parent d0ca97e commit e9955a9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

core/Controller/PreviewController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function getPreview(
8181
bool $a = false,
8282
bool $forceIcon = true,
8383
string $mode = 'fill',
84-
bool $mimeFallback): Http\Response {
84+
bool $mimeFallback = false): Http\Response {
8585
if ($file === '' || $x === 0 || $y === 0) {
8686
return new DataResponse([], Http::STATUS_BAD_REQUEST);
8787
}

core/openapi.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,9 +1075,9 @@
10751075
"name": "mimeFallback",
10761076
"in": "query",
10771077
"description": "Whether to fallback to the mime icon if no preview is available",
1078-
"required": true,
10791078
"schema": {
1080-
"type": "integer"
1079+
"type": "integer",
1080+
"default": 0
10811081
}
10821082
}
10831083
],

tests/Core/Controller/PreviewControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
use OC\Core\Controller\PreviewController;
2727
use OCP\AppFramework\Http;
2828
use OCP\AppFramework\Http\DataResponse;
29-
use OCP\AppFramework\Utility\ITimeFactory;
3029
use OCP\Files\File;
3130
use OCP\Files\Folder;
3231
use OCP\Files\IRootFolder;
@@ -35,6 +34,7 @@
3534
use OCP\Files\Storage\IStorage;
3635
use OCP\IPreview;
3736
use OCP\IRequest;
37+
use OCP\Preview\IMimeIconProvider;
3838

3939
class PreviewControllerTest extends \Test\TestCase {
4040
/** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */
@@ -62,7 +62,7 @@ protected function setUp(): void {
6262
$this->previewManager,
6363
$this->rootFolder,
6464
$this->userId,
65-
$this->createMock(ITimeFactory::class)
65+
$this->createMock(IMimeIconProvider::class)
6666
);
6767
}
6868

0 commit comments

Comments
 (0)