aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-12-01 15:50:29 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-02-27 12:29:25 +0100
commit3285becdc16a9eb57a507e6ad58100d392f2894a (patch)
tree1c8800777638c6800f2acb8f33beeec0ecaa4dad /apps/files_sharing
parentebb15283a60d1c2ee5fb731feca1c68275d58264 (diff)
downloadnextcloud-server-3285becdc16a9eb57a507e6ad58100d392f2894a.tar.gz
nextcloud-server-3285becdc16a9eb57a507e6ad58100d392f2894a.zip
fix unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/files_sharing')
-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();