Skip to content

Commit f0517db

Browse files
cristianscheidAndyScherzinger
authored andcommitted
test(files_sharing): update ShareesAPIController mock to include FederatedShareProvider dependency
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
1 parent e249b7e commit f0517db

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
namespace OCA\Files_Sharing\Tests\Controller;
99

10+
use OCA\FederatedFileSharing\FederatedShareProvider;
1011
use OCA\Files_Sharing\Controller\ShareesAPIController;
1112
use OCA\Files_Sharing\Tests\TestCase;
1213
use OCP\AppFramework\Http\DataResponse;
@@ -46,6 +47,9 @@ class ShareesAPIControllerTest extends TestCase {
4647
/** @var IConfig|MockObject */
4748
protected $config;
4849

50+
/** @var FederatedShareProvider|MockObject */
51+
protected $federatedShareProvider;
52+
4953
protected function setUp(): void {
5054
parent::setUp();
5155

@@ -58,6 +62,7 @@ protected function setUp(): void {
5862
$urlGeneratorMock = $this->createMock(IURLGenerator::class);
5963

6064
$this->collaboratorSearch = $this->createMock(ISearch::class);
65+
$this->federatedShareProvider = $this->createMock(FederatedShareProvider::class);
6166

6267
$this->sharees = new ShareesAPIController(
6368
'files_sharing',
@@ -66,7 +71,8 @@ protected function setUp(): void {
6671
$this->config,
6772
$urlGeneratorMock,
6873
$this->shareManager,
69-
$this->collaboratorSearch
74+
$this->collaboratorSearch,
75+
$this->federatedShareProvider
7076
);
7177
}
7278

@@ -260,7 +266,8 @@ public function testSearch(
260266
$config,
261267
$urlGenerator,
262268
$this->shareManager,
263-
$this->collaboratorSearch
269+
$this->collaboratorSearch,
270+
$this->federatedShareProvider
264271
])
265272
->onlyMethods(['isRemoteSharingAllowed', 'isRemoteGroupSharingAllowed'])
266273
->getMock();
@@ -359,7 +366,8 @@ public function testSearchInvalid($getData, $message): void {
359366
$config,
360367
$urlGenerator,
361368
$this->shareManager,
362-
$this->collaboratorSearch
369+
$this->collaboratorSearch,
370+
$this->federatedShareProvider
363371
])
364372
->onlyMethods(['isRemoteSharingAllowed'])
365373
->getMock();

0 commit comments

Comments
 (0)