summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/Middleware
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 /apps/files_sharing/tests/Middleware
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 'apps/files_sharing/tests/Middleware')
-rw-r--r--apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php2
-rw-r--r--apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php18
2 files changed, 10 insertions, 10 deletions
diff --git a/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php b/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php
index 927cdd8a053..e4d6cefac4f 100644
--- a/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php
+++ b/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php
@@ -51,7 +51,7 @@ class OCSShareAPIMiddlewareTest extends \Test\TestCase {
$this->shareManager = $this->createMock(IManager::class);
$this->l = $this->createMock(IL10N::class);
- $this->l->method('t')->will($this->returnArgument(0));
+ $this->l->method('t')->willReturnArgument(0);
$this->middleware = new OCSShareAPIMiddleware($this->shareManager, $this->l);
}
diff --git a/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php b/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php
index 54db20c239e..4a6d3859b03 100644
--- a/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php
+++ b/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php
@@ -83,7 +83,7 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
->expects($this->once())
->method('isEnabledForUser')
->with('files_sharing')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->assertTrue(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled'));
}
@@ -93,7 +93,7 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
->expects($this->once())
->method('isEnabledForUser')
->with('files_sharing')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->assertFalse(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled'));
}
@@ -142,11 +142,11 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
$this->reflector
->expects($this->atLeastOnce())
->method('hasAnnotation')
- ->will($this->returnValueMap($annotations));
+ ->willReturnMap($annotations);
$this->config
->method('getAppValue')
- ->will($this->returnValueMap($config));
+ ->willReturnMap($config);
$this->assertEquals($expectedResult, self::invokePrivate($this->sharingCheckMiddleware, 'externalSharesChecks'));
}
@@ -159,16 +159,16 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
->expects($this->once())
->method('isEnabledForUser')
->with('files_sharing')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$this->reflector
->expects($this->atLeastOnce())
->method('hasAnnotation')
- ->will($this->returnValueMap($annotations));
+ ->willReturnMap($annotations);
$this->config
->method('getAppValue')
- ->will($this->returnValueMap($config));
+ ->willReturnMap($config);
$controller = $this->createMock(ExternalSharesController::class);
@@ -191,7 +191,7 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
->expects($this->once())
->method('isEnabledForUser')
->with('files_sharing')
- ->will($this->returnValue(true));
+ ->willReturn(true);
$controller = $this->createMock(ShareController::class);
@@ -207,7 +207,7 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
->expects($this->once())
->method('isEnabledForUser')
->with('files_sharing')
- ->will($this->returnValue(false));
+ ->willReturn(false);
$this->sharingCheckMiddleware->beforeController($this->controllerMock, 'myMethod');
}