summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/Middleware
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-06-14 10:25:48 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-06-20 08:53:37 +0200
commit58376db92eb51b1c5f20b0553d2b7c6ab873a9ad (patch)
tree5fc24181c0ef761a31af22d439ca258cae3ea9f3 /apps/files_sharing/tests/Middleware
parent9f658febcafb0a51c20ef114a2a8e76bc9d05445 (diff)
downloadnextcloud-server-58376db92eb51b1c5f20b0553d2b7c6ab873a9ad.tar.gz
nextcloud-server-58376db92eb51b1c5f20b0553d2b7c6ab873a9ad.zip
Update SharingCheckMiddlewareTest
* They are handled now by the overal sharing public page middleware Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_sharing/tests/Middleware')
-rw-r--r--apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php89
1 files changed, 0 insertions, 89 deletions
diff --git a/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php b/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php
index d8676547a76..1fea73e6b47 100644
--- a/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php
+++ b/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php
@@ -98,49 +98,6 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
$this->assertFalse(self::invokePrivate($this->sharingCheckMiddleware, 'isSharingEnabled'));
}
- public function testIsLinkSharingEnabledWithEverythinEnabled() {
- $this->config
- ->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'));
-
- $this->assertTrue(self::invokePrivate($this->sharingCheckMiddleware, 'isLinkSharingEnabled'));
- }
-
-
- public function testIsLinkSharingEnabledWithLinkSharingDisabled() {
- $this->config
- ->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, 'isLinkSharingEnabled'));
- }
-
- public function testIsLinkSharingEnabledWithSharingAPIDisabled() {
- $this->config
- ->expects($this->once())
- ->method('getAppValue')
- ->with('core', 'shareapi_enabled', 'yes')
- ->will($this->returnValue('no'));
-
- $this->assertFalse(self::invokePrivate($this->sharingCheckMiddleware, 'isLinkSharingEnabled'));
- }
-
public function externalSharesChecksDataProvider() {
$data = [];
@@ -236,25 +193,6 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
->with('files_sharing')
->will($this->returnValue(true));
- $this->config
- ->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'));
-
- $this->request->expects($this->once())->method('getParam')->with('token')
- ->willReturn('token');
- $this->shareManager->expects($this->once())->method('getShareByToken')
- ->with('token')->willReturn($share);
-
- $share->expects($this->once())->method('getShareType')->willReturn(\OCP\Share::SHARE_TYPE_LINK);
-
$controller = $this->createMock(ShareController::class);
$this->sharingCheckMiddleware->beforeController($controller, 'myMethod');
@@ -262,33 +200,6 @@ class SharingCheckMiddlewareTest extends \Test\TestCase {
/**
* @expectedException \OCP\Files\NotFoundException
- * @expectedExceptionMessage Link sharing is disabled
- */
- public function testBeforeControllerWithShareControllerWithSharingEnabledAPIDisabled() {
-
- $share = $this->createMock(IShare::class);
-
- $this->appManager
- ->expects($this->once())
- ->method('isEnabledForUser')
- ->with('files_sharing')
- ->will($this->returnValue(true));
-
- $controller = $this->createMock(ShareController::class);
-
- $this->request->expects($this->once())->method('getParam')->with('token')
- ->willReturn('token');
- $this->shareManager->expects($this->once())->method('getShareByToken')
- ->with('token')->willReturn($share);
-
- $share->expects($this->once())->method('getShareType')->willReturn(\OCP\Share::SHARE_TYPE_LINK);
-
-
- $this->sharingCheckMiddleware->beforeController($controller, 'myMethod');
- }
-
- /**
- * @expectedException \OCP\Files\NotFoundException
* @expectedExceptionMessage Sharing is disabled.
*/
public function testBeforeControllerWithSharingDisabled() {