summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Preview/GeneratorTest.php7
-rw-r--r--tests/lib/Preview/Provider.php5
2 files changed, 8 insertions, 4 deletions
diff --git a/tests/lib/Preview/GeneratorTest.php b/tests/lib/Preview/GeneratorTest.php
index 565b526b659..9bca43a1a7e 100644
--- a/tests/lib/Preview/GeneratorTest.php
+++ b/tests/lib/Preview/GeneratorTest.php
@@ -33,6 +33,7 @@ use OCP\IConfig;
use OCP\IImage;
use OCP\IPreview;
use OCP\Preview\IProvider;
+use OCP\Preview\IProviderV2;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
@@ -149,13 +150,13 @@ class GeneratorTest extends \Test\TestCase {
return $defult;
}));
- $invalidProvider = $this->createMock(IProvider::class);
+ $invalidProvider = $this->createMock(IProviderV2::class);
$invalidProvider->method('isAvailable')
->willReturn(true);
- $unavailableProvider = $this->createMock(IProvider::class);
+ $unavailableProvider = $this->createMock(IProviderV2::class);
$unavailableProvider->method('isAvailable')
->willReturn(false);
- $validProvider = $this->createMock(IProvider::class);
+ $validProvider = $this->createMock(IProviderV2::class);
$validProvider->method('isAvailable')
->with($file)
->willReturn(true);
diff --git a/tests/lib/Preview/Provider.php b/tests/lib/Preview/Provider.php
index 5377f30df82..2050b3f56b4 100644
--- a/tests/lib/Preview/Provider.php
+++ b/tests/lib/Preview/Provider.php
@@ -21,6 +21,8 @@
namespace Test\Preview;
+use OC\Files\Node\File;
+
abstract class Provider extends \Test\TestCase {
/** @var string */
@@ -136,7 +138,8 @@ abstract class Provider extends \Test\TestCase {
* @return bool|\OCP\IImage
*/
private function getPreview($provider) {
- $preview = $provider->getThumbnail($this->imgPath, $this->maxWidth, $this->maxHeight, $this->scalingUp, $this->rootView);
+ $file = new File(\OC::$server->getRootFolder(), $this->rootView, $this->imgPath);
+ $preview = $provider->getThumbnail($file, $this->maxWidth, $this->maxHeight, $this->scalingUp);
$this->assertNotEquals(false, $preview);
$this->assertEquals(true, $preview->valid());