diff options
Diffstat (limited to 'apps/files_sharing/tests/controller/sharecontroller.php')
-rw-r--r-- | apps/files_sharing/tests/controller/sharecontroller.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/controller/sharecontroller.php b/apps/files_sharing/tests/controller/sharecontroller.php index db8c7fe553c..df3973099fb 100644 --- a/apps/files_sharing/tests/controller/sharecontroller.php +++ b/apps/files_sharing/tests/controller/sharecontroller.php @@ -29,6 +29,7 @@ namespace OCA\Files_Sharing\Controllers; use OC\Files\Filesystem; +use OCA\FederatedFileSharing\FederatedShareProvider; use OCP\Share\Exceptions\ShareNotFound; use OCP\AppFramework\Http\NotFoundResponse; use OCP\AppFramework\Http\RedirectResponse; @@ -66,6 +67,8 @@ class ShareControllerTest extends \Test\TestCase { private $shareManager; /** @var IUserManager | \PHPUnit_Framework_MockObject_MockObject */ private $userManager; + /** @var FederatedShareProvider | \PHPUnit_Framework_MockObject_MockObject */ + private $federatedShareProvider; protected function setUp() { $this->appName = 'files_sharing'; @@ -76,6 +79,12 @@ class ShareControllerTest extends \Test\TestCase { $this->previewManager = $this->getMock('\OCP\IPreview'); $this->config = $this->getMock('\OCP\IConfig'); $this->userManager = $this->getMock('\OCP\IUserManager'); + $this->federatedShareProvider = $this->getMockBuilder('OCA\FederatedFileSharing\FederatedShareProvider') + ->disableOriginalConstructor()->getMock(); + $this->federatedShareProvider->expects($this->any()) + ->method('isOutgoingServer2serverShareEnabled')->willReturn(true); + $this->federatedShareProvider->expects($this->any()) + ->method('isIncomingServer2serverShareEnabled')->willReturn(true); $this->shareController = new \OCA\Files_Sharing\Controllers\ShareController( $this->appName, @@ -88,7 +97,8 @@ class ShareControllerTest extends \Test\TestCase { $this->shareManager, $this->session, $this->previewManager, - $this->getMock('\OCP\Files\IRootFolder') + $this->getMock('\OCP\Files\IRootFolder'), + $this->federatedShareProvider ); |