summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-02-27 13:44:34 +0100
committerGitHub <noreply@github.com>2018-02-27 13:44:34 +0100
commit7bc3c2e057c8c265ca7b1aa387dd1ba479690143 (patch)
treec02f1ec27b8037ef2f604829347e7efe2e3d34ab /apps/files_sharing/tests
parent01f420c7ac38128c03975d7de7dd20190c4afcc1 (diff)
parent20ec0344a26faf725762e3b344b66bb45ef1a5a2 (diff)
downloadnextcloud-server-7bc3c2e057c8c265ca7b1aa387dd1ba479690143.tar.gz
nextcloud-server-7bc3c2e057c8c265ca7b1aa387dd1ba479690143.zip
Merge pull request #7363 from nextcloud/default-share-perms
Let the admin configure the default share permissions
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r--apps/files_sharing/tests/ApiTest.php5
-rw-r--r--apps/files_sharing/tests/Controller/ShareAPIControllerTest.php13
2 files changed, 16 insertions, 2 deletions
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php
index 6d8e2dd8d84..d7bc169bf4a 100644
--- a/apps/files_sharing/tests/ApiTest.php
+++ b/apps/files_sharing/tests/ApiTest.php
@@ -37,6 +37,7 @@ use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\AppFramework\OCS\OCSException;
use OCP\AppFramework\OCS\OCSForbiddenException;
use OCP\AppFramework\OCS\OCSNotFoundException;
+use OCP\IConfig;
use OCP\IL10N;
use OCP\IRequest;
@@ -105,6 +106,7 @@ class ApiTest extends TestCase {
->will($this->returnCallback(function($text, $parameters = []) {
return vsprintf($text, $parameters);
}));
+ $config = $this->createMock(IConfig::class);
return new ShareAPIController(
self::APP_NAME,
@@ -115,7 +117,8 @@ class ApiTest extends TestCase {
\OC::$server->getRootFolder(),
\OC::$server->getURLGenerator(),
$userId,
- $l
+ $l,
+ $config
);
}
diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
index c438dac2521..a475474e3cf 100644
--- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
@@ -31,6 +31,7 @@ use OCP\AppFramework\OCS\OCSNotFoundException;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\Storage;
+use OCP\IConfig;
use OCP\IL10N;
use OCA\Files_Sharing\Controller\ShareAPIController;
use OCP\Files\NotFoundException;
@@ -84,6 +85,9 @@ class ShareAPIControllerTest extends TestCase {
/** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */
private $l;
+ /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
+ private $config;
+
protected function setUp() {
$this->shareManager = $this->createMock(IManager::class);
$this->shareManager
@@ -102,6 +106,7 @@ class ShareAPIControllerTest extends TestCase {
->will($this->returnCallback(function($text, $parameters = []) {
return vsprintf($text, $parameters);
}));
+ $this->config = $this->createMock(IConfig::class);
$this->ocs = new ShareAPIController(
$this->appName,
@@ -112,7 +117,8 @@ class ShareAPIControllerTest extends TestCase {
$this->rootFolder,
$this->urlGenerator,
$this->currentUser,
- $this->l
+ $this->l,
+ $this->config
);
}
@@ -131,6 +137,7 @@ class ShareAPIControllerTest extends TestCase {
$this->urlGenerator,
$this->currentUser,
$this->l,
+ $this->config
])->setMethods(['formatShare'])
->getMock();
}
@@ -439,6 +446,7 @@ class ShareAPIControllerTest extends TestCase {
$this->urlGenerator,
$this->currentUser,
$this->l,
+ $this->config
])->setMethods(['canAccessShare'])
->getMock();
@@ -707,6 +715,7 @@ class ShareAPIControllerTest extends TestCase {
$this->urlGenerator,
$this->currentUser,
$this->l,
+ $this->config
])->setMethods(['formatShare'])
->getMock();
@@ -804,6 +813,7 @@ class ShareAPIControllerTest extends TestCase {
$this->urlGenerator,
$this->currentUser,
$this->l,
+ $this->config
])->setMethods(['formatShare'])
->getMock();
@@ -1119,6 +1129,7 @@ class ShareAPIControllerTest extends TestCase {
$this->urlGenerator,
$this->currentUser,
$this->l,
+ $this->config
])->setMethods(['formatShare'])
->getMock();