aboutsummaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/tests/Controller
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-01-18 12:44:17 +0100
committerjld3103 <jld3103yt@gmail.com>2023-06-14 14:54:44 +0200
commitbf4c5bd556ca3aef036a9b7bf4c7b0c01608383f (patch)
treee3b2983d77f34249a9a5b43543eb60c25fdddded /apps/federatedfilesharing/tests/Controller
parente4927cd91573de058845bdf2dceedc922f7ca885 (diff)
downloadnextcloud-server-bf4c5bd556ca3aef036a9b7bf4c7b0c01608383f.tar.gz
nextcloud-server-bf4c5bd556ca3aef036a9b7bf4c7b0c01608383f.zip
Specify the parameters of FederatedFileSharing controllers
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/federatedfilesharing/tests/Controller')
-rw-r--r--apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php19
1 files changed, 3 insertions, 16 deletions
diff --git a/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php b/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
index 77f7fde70fa..22e80f875d7 100644
--- a/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
+++ b/apps/federatedfilesharing/tests/Controller/RequestHandlerControllerTest.php
@@ -151,17 +151,6 @@ class RequestHandlerControllerTest extends \Test\TestCase {
}
public function testCreateShare() {
- // simulate a post request
- $_POST['remote'] = 'localhost';
- $_POST['token'] = 'token';
- $_POST['name'] = 'name';
- $_POST['owner'] = $this->owner;
- $_POST['sharedBy'] = $this->user1;
- $_POST['shareWith'] = $this->user2;
- $_POST['remoteId'] = 1;
- $_POST['sharedByFederatedId'] = $this->user1CloudId;
- $_POST['ownerFederatedId'] = $this->ownerCloudId;
-
$this->cloudFederationFactory->expects($this->once())->method('getCloudFederationShare')
->with(
$this->user2,
@@ -186,14 +175,13 @@ class RequestHandlerControllerTest extends \Test\TestCase {
$this->cloudFederationProvider->expects($this->once())->method('shareReceived')
->with($this->cloudFederationShare);
- $result = $this->requestHandler->createShare();
+ $result = $this->requestHandler->createShare('localhost', 'token', 'name', $this->owner, $this->user1, $this->user2, 1, $this->user1CloudId, $this->ownerCloudId);
$this->assertInstanceOf(DataResponse::class, $result);
}
public function testDeclineShare() {
$id = 42;
- $_POST['token'] = 'token';
$notification = [
'sharedSecret' => 'token',
@@ -209,7 +197,7 @@ class RequestHandlerControllerTest extends \Test\TestCase {
->method('notificationReceived')
->with('SHARE_DECLINED', $id, $notification);
- $result = $this->requestHandler->declineShare($id);
+ $result = $this->requestHandler->declineShare($id, 'token');
$this->assertInstanceOf(DataResponse::class, $result);
}
@@ -217,7 +205,6 @@ class RequestHandlerControllerTest extends \Test\TestCase {
public function testAcceptShare() {
$id = 42;
- $_POST['token'] = 'token';
$notification = [
'sharedSecret' => 'token',
@@ -233,7 +220,7 @@ class RequestHandlerControllerTest extends \Test\TestCase {
->method('notificationReceived')
->with('SHARE_ACCEPTED', $id, $notification);
- $result = $this->requestHandler->acceptShare($id);
+ $result = $this->requestHandler->acceptShare($id, 'token');
$this->assertInstanceOf(DataResponse::class, $result);
}