diff options
author | Björn Schießle <bjoern@schiessle.org> | 2017-03-09 14:39:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-09 14:39:18 +0100 |
commit | c23c062c89b214f4504a418cc96e5f6c740713f2 (patch) | |
tree | a2207a381aae90331ac25529fc2a95a8d89397d0 /tests/lib | |
parent | 6d10a2aece9ab4cce0f57f20594b9fcb9372a794 (diff) | |
parent | 43bca9f7f611a96640a8363be44e6977a110aa03 (diff) | |
download | nextcloud-server-c23c062c89b214f4504a418cc96e5f6c740713f2.tar.gz nextcloud-server-c23c062c89b214f4504a418cc96e5f6c740713f2.zip |
Merge pull request #3611 from nextcloud/announce-trsuted-server-endpoints
Announce trusted server endpoints
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/OCS/ProviderTest.php | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/tests/lib/OCS/ProviderTest.php b/tests/lib/OCS/ProviderTest.php index 399fd3933d9..9444544d12a 100644 --- a/tests/lib/OCS/ProviderTest.php +++ b/tests/lib/OCS/ProviderTest.php @@ -48,11 +48,16 @@ class ProviderTest extends \Test\TestCase { $this->appManager ->expects($this->at(1)) ->method('isEnabledForUser') - ->with('activity') + ->with('federation') ->will($this->returnValue(false)); $this->appManager ->expects($this->at(2)) ->method('isEnabledForUser') + ->with('activity') + ->will($this->returnValue(false)); + $this->appManager + ->expects($this->at(3)) + ->method('isEnabledForUser') ->with('provisioning_api') ->will($this->returnValue(false)); @@ -84,11 +89,16 @@ class ProviderTest extends \Test\TestCase { $this->appManager ->expects($this->at(1)) ->method('isEnabledForUser') - ->with('activity') + ->with('federation') ->will($this->returnValue(false)); $this->appManager ->expects($this->at(2)) ->method('isEnabledForUser') + ->with('activity') + ->will($this->returnValue(false)); + $this->appManager + ->expects($this->at(3)) + ->method('isEnabledForUser') ->with('provisioning_api') ->will($this->returnValue(false)); @@ -124,6 +134,55 @@ class ProviderTest extends \Test\TestCase { $this->assertEquals($expected, $this->ocsProvider->buildProviderList()); } + public function testBuildProviderListWithFederationEnabled() { + $this->appManager + ->expects($this->at(0)) + ->method('isEnabledForUser') + ->with('files_sharing') + ->will($this->returnValue(false)); + $this->appManager + ->expects($this->at(1)) + ->method('isEnabledForUser') + ->with('federation') + ->will($this->returnValue(true)); + $this->appManager + ->expects($this->at(2)) + ->method('isEnabledForUser') + ->with('activity') + ->will($this->returnValue(false)); + $this->appManager + ->expects($this->at(3)) + ->method('isEnabledForUser') + ->with('provisioning_api') + ->will($this->returnValue(false)); + + $expected = new \OCP\AppFramework\Http\JSONResponse( + [ + 'version' => 2, + 'services' => [ + 'PRIVATE_DATA' => [ + 'version' => 1, + 'endpoints' => [ + 'store' => '/ocs/v2.php/privatedata/setattribute', + 'read' => '/ocs/v2.php/privatedata/getattribute', + 'delete' => '/ocs/v2.php/privatedata/deleteattribute', + ], + ], + 'FEDERATED_SHARING' => [ + 'version' => 1, + 'endpoints' => [ + 'shared-secret' => '/ocs/v2.php/cloud/shared-secret', + 'system-address-book' => '/remote.php/dav/addressbooks/system/system/system', + 'carddav-user' => 'system' + ], + ], + ], + ] + ); + + $this->assertEquals($expected, $this->ocsProvider->buildProviderList()); + } + public function testBuildProviderListWithEverythingEnabled() { $this->appManager ->expects($this->any()) @@ -147,6 +206,9 @@ class ProviderTest extends \Test\TestCase { 'endpoints' => [ 'share' => '/ocs/v2.php/cloud/shares', 'webdav' => '/public.php/webdav/', + 'shared-secret' => '/ocs/v2.php/cloud/shared-secret', + 'system-address-book' => '/remote.php/dav/addressbooks/system/system/system', + 'carddav-user' => 'system' ], ], 'SHARING' => [ |