summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/tests/middleware/sharingcheckmiddleware.php')
-rw-r--r--apps/files_sharing/tests/middleware/sharingcheckmiddleware.php35
1 files changed, 32 insertions, 3 deletions
diff --git a/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php b/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php
index 0db8a1ed5bc..58f4b841339 100644
--- a/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php
+++ b/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php
@@ -54,7 +54,13 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
->will($this->returnValue(true));
$this->config
- ->expects($this->once())
+ ->expects($this->at(0))
+ ->method('getAppValue')
+ ->with('core', 'shareapi_enabled', 'yes')
+ ->will($this->returnValue('yes'));
+
+ $this->config
+ ->expects($this->at(1))
->method('getAppValue')
->with('core', 'shareapi_allow_links', 'yes')
->will($this->returnValue('yes'));
@@ -72,7 +78,7 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
$this->assertFalse(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled'));
}
- public function testIsSharingEnabledWithSharingDisabled() {
+ public function testIsSharingEnabledWithLinkSharingDisabled() {
$this->appManager
->expects($this->once())
->method('isEnabledForUser')
@@ -80,11 +86,34 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
->will($this->returnValue(true));
$this->config
- ->expects($this->once())
+ ->expects($this->at(0))
+ ->method('getAppValue')
+ ->with('core', 'shareapi_enabled', 'yes')
+ ->will($this->returnValue('yes'));
+
+ $this->config
+ ->expects($this->at(1))
->method('getAppValue')
->with('core', 'shareapi_allow_links', 'yes')
->will($this->returnValue('no'));
$this->assertFalse(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled'));
}
+
+ public function testIsSharingEnabledWithSharingAPIDisabled() {
+ $this->appManager
+ ->expects($this->once())
+ ->method('isEnabledForUser')
+ ->with('files_sharing')
+ ->will($this->returnValue(true));
+
+ $this->config
+ ->expects($this->once())
+ ->method('getAppValue')
+ ->with('core', 'shareapi_enabled', 'yes')
+ ->will($this->returnValue('no'));
+
+ $this->assertFalse(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled'));
+ }
+
}