diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-10-25 09:15:39 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-10-25 11:35:31 +0200 |
commit | 8629d8e44f31dbcc0d8237391aa2fbaeea2d13f1 (patch) | |
tree | ada100e09304e5c327d2d772653b24603e08dca8 /tests | |
parent | e3aac7d573961933b185c87d9600580b21423a42 (diff) | |
download | nextcloud-server-8629d8e44f31dbcc0d8237391aa2fbaeea2d13f1.tar.gz nextcloud-server-8629d8e44f31dbcc0d8237391aa2fbaeea2d13f1.zip |
Check share attributes on preview endpoints
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Core/Controller/PreviewControllerTest.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/Core/Controller/PreviewControllerTest.php b/tests/Core/Controller/PreviewControllerTest.php index 704ddade7a4..e6045386538 100644 --- a/tests/Core/Controller/PreviewControllerTest.php +++ b/tests/Core/Controller/PreviewControllerTest.php @@ -32,6 +32,7 @@ use OCP\Files\Folder; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; use OCP\Files\SimpleFS\ISimpleFile; +use OCP\Files\Storage\IStorage; use OCP\IPreview; use OCP\IRequest; @@ -176,6 +177,10 @@ class PreviewControllerTest extends \Test\TestCase { ->with($this->equalTo('file')) ->willReturn($file); + $storage = $this->createMock(IStorage::class); + $file->method('getStorage') + ->willReturn($storage); + $this->previewManager->method('isAvailable') ->with($this->equalTo($file)) ->willReturn(true); @@ -211,6 +216,10 @@ class PreviewControllerTest extends \Test\TestCase { $file->method('isReadable') ->willReturn(true); + $storage = $this->createMock(IStorage::class); + $file->method('getStorage') + ->willReturn($storage); + $preview = $this->createMock(ISimpleFile::class); $preview->method('getName')->willReturn('my name'); $preview->method('getMTime')->willReturn(42); |