diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2021-10-22 11:52:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-22 11:52:56 +0200 |
commit | c98039c1df19f8b53efea5b627d5e8f183ec77c3 (patch) | |
tree | fd4fef772d501f21573bdf1a16e30a68c907060d /apps/provisioning_api/tests | |
parent | 0a359376628b36256aa8332d79b1af1dfc513ce8 (diff) | |
parent | 193cf6cfde8a91e225947021e582997403074c78 (diff) | |
download | nextcloud-server-c98039c1df19f8b53efea5b627d5e8f183ec77c3.tar.gz nextcloud-server-c98039c1df19f8b53efea5b627d5e8f183ec77c3.zip |
Merge pull request #26725 from nextcloud/fix-federated-scope-not-shown-when-public-addressbook-upload-is-disabled
Diffstat (limited to 'apps/provisioning_api/tests')
-rw-r--r-- | apps/provisioning_api/tests/CapabilitiesTest.php | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/apps/provisioning_api/tests/CapabilitiesTest.php b/apps/provisioning_api/tests/CapabilitiesTest.php index 97f9ba562bc..8fc29b442eb 100644 --- a/apps/provisioning_api/tests/CapabilitiesTest.php +++ b/apps/provisioning_api/tests/CapabilitiesTest.php @@ -57,20 +57,25 @@ class CapabilitiesTest extends TestCase { public function getCapabilitiesProvider() { return [ - [false, false, false], - [true, false, false], - [true, true, true], + [true, false, false, true, false], + [true, true, false, true, false], + [true, true, true, true, true], + [false, false, false, false, false], + [false, true, false, false, false], + [false, true, true, false, true], ]; } /** * @dataProvider getCapabilitiesProvider */ - public function testGetCapabilities($federationAppEnabled, $lookupServerEnabled, $expectedFederationScopesEnabled) { - $this->appManager->expects($this->once()) - ->method('isEnabledForUser') - ->with('federatedfilesharing') - ->willReturn($federationAppEnabled); + public function testGetCapabilities($federationAppEnabled, $federatedFileSharingAppEnabled, $lookupServerEnabled, $expectedFederatedScopeEnabled, $expectedPublishedScopeEnabled) { + $this->appManager->expects($this->any()) + ->method('isEnabledForUser') + ->will($this->returnValueMap([ + ['federation', null, $federationAppEnabled], + ['federatedfilesharing', null, $federatedFileSharingAppEnabled], + ])); $federatedShareProvider = $this->createMock(FederatedShareProvider::class); $this->overwriteService(FederatedShareProvider::class, $federatedShareProvider); @@ -83,7 +88,8 @@ class CapabilitiesTest extends TestCase { 'provisioning_api' => [ 'version' => '1.12', 'AccountPropertyScopesVersion' => 2, - 'AccountPropertyScopesFederationEnabled' => $expectedFederationScopesEnabled, + 'AccountPropertyScopesFederatedEnabled' => $expectedFederatedScopeEnabled, + 'AccountPropertyScopesPublishedEnabled' => $expectedPublishedScopeEnabled, ], ]; $this->assertSame($expected, $this->capabilities->getCapabilities()); |