Skip to content

Commit

Permalink
fix(tests): preview phpunit
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <[email protected]>
  • Loading branch information
skjnldsv committed Aug 17, 2023
1 parent d0ca97e commit e9955a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/Controller/PreviewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getPreview(
bool $a = false,
bool $forceIcon = true,
string $mode = 'fill',
bool $mimeFallback): Http\Response {
bool $mimeFallback = false): Http\Response {
if ($file === '' || $x === 0 || $y === 0) {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}
Expand Down
4 changes: 2 additions & 2 deletions core/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1075,9 +1075,9 @@
"name": "mimeFallback",
"in": "query",
"description": "Whether to fallback to the mime icon if no preview is available",
"required": true,
"schema": {
"type": "integer"
"type": "integer",
"default": 0
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions tests/Core/Controller/PreviewControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use OC\Core\Controller\PreviewController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
Expand All @@ -35,6 +34,7 @@
use OCP\Files\Storage\IStorage;
use OCP\IPreview;
use OCP\IRequest;
use OCP\Preview\IMimeIconProvider;

class PreviewControllerTest extends \Test\TestCase {
/** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */
Expand Down Expand Up @@ -62,7 +62,7 @@ protected function setUp(): void {
$this->previewManager,
$this->rootFolder,
$this->userId,
$this->createMock(ITimeFactory::class)
$this->createMock(IMimeIconProvider::class)
);
}

Expand Down

0 comments on commit e9955a9

Please sign in to comment.