Browse Source

fix(tests): preview phpunit

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
tags/v28.0.0beta1
John Molakvoæ 10 months ago
parent
commit
266fb31180
No account linked to committer's email address

+ 1
- 1
core/Controller/PreviewController.php View File

@@ -81,7 +81,7 @@ class PreviewController extends Controller {
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);
}

+ 2
- 2
core/openapi.json View File

@@ -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
}
}
],

+ 2
- 2
tests/Core/Controller/PreviewControllerTest.php View File

@@ -26,7 +26,6 @@ namespace Tests\Core\Controller;
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;
@@ -35,6 +34,7 @@ use OCP\Files\SimpleFS\ISimpleFile;
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 */
@@ -62,7 +62,7 @@ class PreviewControllerTest extends \Test\TestCase {
$this->previewManager,
$this->rootFolder,
$this->userId,
$this->createMock(ITimeFactory::class)
$this->createMock(IMimeIconProvider::class)
);
}


Loading…
Cancel
Save