summaryrefslogtreecommitdiffstats
path: root/tests/lib/Preview
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-25 22:21:27 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-25 22:21:27 +0100
commit2ee65f177e4f7e09ad2287f14d564e7068d322fb (patch)
tree39075e87ea7927e20e8956824cb7c49bf626b178 /tests/lib/Preview
parent3cf321fdfc4235a87015a9af2f59c63220016c65 (diff)
downloadnextcloud-server-2ee65f177e4f7e09ad2287f14d564e7068d322fb.tar.gz
nextcloud-server-2ee65f177e4f7e09ad2287f14d564e7068d322fb.zip
Use the shorter phpunit syntax for mocked return values
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/Preview')
-rw-r--r--tests/lib/Preview/GeneratorTest.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/lib/Preview/GeneratorTest.php b/tests/lib/Preview/GeneratorTest.php
index cfb78a05da5..f5a3f9a1bf0 100644
--- a/tests/lib/Preview/GeneratorTest.php
+++ b/tests/lib/Preview/GeneratorTest.php
@@ -147,9 +147,9 @@ class GeneratorTest extends \Test\TestCase {
->willReturn($previewFolder);
$this->config->method('getSystemValue')
- ->will($this->returnCallback(function($key, $defult) {
+ ->willReturnCallback(function($key, $defult) {
return $defult;
- }));
+ });
$invalidProvider = $this->createMock(IProviderV2::class);
$invalidProvider->method('isAvailable')
@@ -169,7 +169,7 @@ class GeneratorTest extends \Test\TestCase {
]);
$this->helper->method('getProvider')
- ->will($this->returnCallback(function($provider) use ($invalidProvider, $validProvider, $unavailableProvider) {
+ ->willReturnCallback(function($provider) use ($invalidProvider, $validProvider, $unavailableProvider) {
if ($provider === 'wrongProvider') {
$this->fail('Wrongprovider should not be constructed!');
} else if ($provider === 'brokenProvider') {
@@ -182,7 +182,7 @@ class GeneratorTest extends \Test\TestCase {
return $unavailableProvider;
}
$this->fail('Unexpected provider requested');
- }));
+ });
$image = $this->createMock(IImage::class);
$image->method('width')->willReturn(2048);
@@ -191,13 +191,13 @@ class GeneratorTest extends \Test\TestCase {
$image->method('dataMimeType')->willReturn('image/png');
$this->helper->method('getThumbnail')
- ->will($this->returnCallback(function ($provider, $file, $x, $y) use ($invalidProvider, $validProvider, $image) {
+ ->willReturnCallback(function ($provider, $file, $x, $y) use ($invalidProvider, $validProvider, $image) {
if ($provider === $validProvider) {
return $image;
} else {
return false;
}
- }));
+ });
$image->method('data')
->willReturn('my data');
@@ -211,14 +211,14 @@ class GeneratorTest extends \Test\TestCase {
$previewFolder->method('getDirectoryListing')
->willReturn([]);
$previewFolder->method('newFile')
- ->will($this->returnCallback(function($filename) use ($maxPreview, $previewFile) {
+ ->willReturnCallback(function($filename) use ($maxPreview, $previewFile) {
if ($filename === '2048-2048-max.png') {
return $maxPreview;
} else if ($filename === '256-256.png') {
return $previewFile;
}
$this->fail('Unexpected file');
- }));
+ });
$maxPreview->expects($this->once())
->method('putContent')