summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/ApiTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/tests/ApiTest.php')
-rw-r--r--apps/files_sharing/tests/ApiTest.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php
index bf4cca53891..a68ec7de1f0 100644
--- a/apps/files_sharing/tests/ApiTest.php
+++ b/apps/files_sharing/tests/ApiTest.php
@@ -33,6 +33,7 @@ namespace OCA\Files_Sharing\Tests;
use OC\Files\Cache\Scanner;
use OCA\Files_Sharing\Controller\ShareAPIController;
+use OCP\App\IAppManager;
use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\AppFramework\OCS\OCSException;
use OCP\AppFramework\OCS\OCSForbiddenException;
@@ -107,6 +108,7 @@ class ApiTest extends TestCase {
return vsprintf($text, $parameters);
}));
$config = $this->createMock(IConfig::class);
+ $appManager = $this->createMock(IAppManager::class);
return new ShareAPIController(
self::APP_NAME,
@@ -118,7 +120,8 @@ class ApiTest extends TestCase {
\OC::$server->getURLGenerator(),
$userId,
$l,
- $config
+ $config,
+ $appManager
);
}
@@ -960,7 +963,7 @@ class ApiTest extends TestCase {
// update public upload
$ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1);
- $ocs->updateShare($share1->getId(), null, null, 'true');
+ $ocs->updateShare($share1->getId(), null, null, null, 'true');
$ocs->cleanup();
$share1 = $this->shareManager->getShareById($share1->getFullId());
@@ -1003,7 +1006,7 @@ class ApiTest extends TestCase {
// update expire date to a valid value
$ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1);
- $ocs->updateShare($share1->getId(), null, null, null, $dateWithinRange->format('Y-m-d'));
+ $ocs->updateShare($share1->getId(), null, null, null, null, $dateWithinRange->format('Y-m-d'));
$ocs->cleanup();
$share1 = $this->shareManager->getShareById($share1->getFullId());
@@ -1234,7 +1237,7 @@ class ApiTest extends TestCase {
$ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1);
try {
- $result = $ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', '', $date);
+ $result = $ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', '', null, $date);
$this->assertTrue($valid);
} catch (OCSNotFoundException $e) {
$this->assertFalse($valid);
@@ -1270,7 +1273,7 @@ class ApiTest extends TestCase {
$date->add(new \DateInterval('P5D'));
$ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1);
- $result = $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', '', $date->format('Y-m-d'));
+ $result = $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', '', null, $date->format('Y-m-d'));
$ocs->cleanup();
$data = $result->getData();
@@ -1304,7 +1307,7 @@ class ApiTest extends TestCase {
$ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1);
try {
- $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', '', $date->format('Y-m-d'));
+ $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', '', null, $date->format('Y-m-d'));
$this->fail();
} catch (OCSException $e) {
$this->assertEquals(404, $e->getCode());
@@ -1325,7 +1328,7 @@ class ApiTest extends TestCase {
$ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1);
try {
- $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', '', $date->format('Y-m-d'));
+ $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', '', null, $date->format('Y-m-d'));
$this->fail();
} catch(OCSException $e) {
$this->assertEquals(404, $e->getCode());