diff options
author | Georg Ehrke <developer@georgehrke.com> | 2020-08-05 11:37:20 +0300 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2020-08-14 18:04:52 +0300 |
commit | 5b26487f142843ad99a663d1ce2223c46a9498b2 (patch) | |
tree | ee28708b23007815af072ea5420d3813e70be2e8 /apps/files_sharing/tests | |
parent | b13aa660c91873437afec36ef6466ef609b7959c (diff) |
Expose status via Collaborators API
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/ApiTest.php | 5 | ||||
-rw-r--r-- | apps/files_sharing/tests/Controller/ShareAPIControllerTest.php | 31 |
2 files changed, 28 insertions, 8 deletions
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index 5339128fbef..80fb4c257ce 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -46,6 +46,7 @@ use OCP\IL10N; use OCP\IRequest; use OCP\IServerContainer; use OCP\Share\IShare; +use OCP\UserStatus\IManager as IUserStatusManager; /** * Class ApiTest @@ -114,6 +115,7 @@ class ApiTest extends TestCase { $config = $this->createMock(IConfig::class); $appManager = $this->createMock(IAppManager::class); $serverContainer = $this->createMock(IServerContainer::class); + $userStatusManager = $this->createMock(IUserStatusManager::class); return new ShareAPIController( self::APP_NAME, @@ -127,7 +129,8 @@ class ApiTest extends TestCase { $l, $config, $appManager, - $serverContainer + $serverContainer, + $userStatusManager ); } diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index 4da51f7e5e9..a85a32713cd 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -56,6 +56,7 @@ use OCP\Share\Exceptions\GenericShareException; use OCP\Share\IManager; use OCP\Share\IShare; use Test\TestCase; +use OCP\UserStatus\IManager as IUserStatusManager; /** * Class ShareAPIControllerTest @@ -104,6 +105,9 @@ class ShareAPIControllerTest extends TestCase { /** @var IServerContainer|\PHPUnit\Framework\MockObject\MockObject */ private $serverContainer; + /** @var IUserStatusManager|\PHPUnit\Framework\MockObject\MockObject */ + private $userStatusManager; + protected function setUp(): void { $this->shareManager = $this->createMock(IManager::class); $this->shareManager @@ -128,6 +132,7 @@ class ShareAPIControllerTest extends TestCase { $this->config = $this->createMock(IConfig::class); $this->appManager = $this->createMock(IAppManager::class); $this->serverContainer = $this->createMock(IServerContainer::class); + $this->userStatusManager = $this->createMock(IUserStatusManager::class); $this->ocs = new ShareAPIController( $this->appName, @@ -141,7 +146,8 @@ class ShareAPIControllerTest extends TestCase { $this->l, $this->config, $this->appManager, - $this->serverContainer + $this->serverContainer, + $this->userStatusManager ); } @@ -162,7 +168,8 @@ class ShareAPIControllerTest extends TestCase { $this->l, $this->config, $this->appManager, - $this->serverContainer + $this->serverContainer, + $this->userStatusManager, ])->setMethods(['formatShare']) ->getMock(); } @@ -588,6 +595,7 @@ class ShareAPIControllerTest extends TestCase { 'hide_download' => 0, 'can_edit' => false, 'can_delete' => false, + 'status' => [], ]; $data[] = [$share, $expected]; @@ -715,7 +723,8 @@ class ShareAPIControllerTest extends TestCase { $this->l, $this->config, $this->appManager, - $this->serverContainer + $this->serverContainer, + $this->userStatusManager, ])->setMethods(['canAccessShare']) ->getMock(); @@ -1334,7 +1343,8 @@ class ShareAPIControllerTest extends TestCase { $this->l, $this->config, $this->appManager, - $this->serverContainer + $this->serverContainer, + $this->userStatusManager, ])->setMethods(['formatShare']) ->getMock(); @@ -1677,7 +1687,8 @@ class ShareAPIControllerTest extends TestCase { $this->l, $this->config, $this->appManager, - $this->serverContainer + $this->serverContainer, + $this->userStatusManager, ])->setMethods(['formatShare']) ->getMock(); @@ -1777,7 +1788,8 @@ class ShareAPIControllerTest extends TestCase { $this->l, $this->config, $this->appManager, - $this->serverContainer + $this->serverContainer, + $this->userStatusManager, ])->setMethods(['formatShare']) ->getMock(); @@ -2340,7 +2352,8 @@ class ShareAPIControllerTest extends TestCase { $this->l, $this->config, $this->appManager, - $this->serverContainer + $this->serverContainer, + $this->userStatusManager, ])->setMethods(['formatShare']) ->getMock(); @@ -3447,6 +3460,7 @@ class ShareAPIControllerTest extends TestCase { 'hide_download' => 0, 'can_edit' => false, 'can_delete' => false, + 'status' => [], ], $share, [], false ]; // User backend up @@ -3480,6 +3494,7 @@ class ShareAPIControllerTest extends TestCase { 'hide_download' => 0, 'can_edit' => false, 'can_delete' => false, + 'status' => [], ], $share, [ ['owner', $owner], ['initiator', $initiator], @@ -3529,6 +3544,7 @@ class ShareAPIControllerTest extends TestCase { 'hide_download' => 0, 'can_edit' => false, 'can_delete' => false, + 'status' => [], ], $share, [], false ]; @@ -3574,6 +3590,7 @@ class ShareAPIControllerTest extends TestCase { 'hide_download' => 0, 'can_edit' => true, 'can_delete' => true, + 'status' => [], ], $share, [], false ]; |