diff options
author | Björn Schießle <bjoern@schiessle.org> | 2017-04-10 11:04:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-10 11:04:19 +0200 |
commit | 235563f0a0481209f2e5d0303afe0b4db36bfcb6 (patch) | |
tree | e596b9e7aab8cd7cfe1641495a9c8edd54033243 /apps/federatedfilesharing/tests | |
parent | 09c66c93c54a81b4747abb3191f604cd67bfc601 (diff) | |
parent | 78f0b5c19fe3101e3f10b5da70411681cd9b3d3e (diff) | |
download | nextcloud-server-235563f0a0481209f2e5d0303afe0b4db36bfcb6.tar.gz nextcloud-server-235563f0a0481209f2e5d0303afe0b4db36bfcb6.zip |
Merge pull request #4250 from nextcloud/disable-lookupserver-upload
allow admin to disable lookupserver upload
Diffstat (limited to 'apps/federatedfilesharing/tests')
-rw-r--r-- | apps/federatedfilesharing/tests/FederatedShareProviderTest.php | 32 | ||||
-rw-r--r-- | apps/federatedfilesharing/tests/Settings/AdminTest.php | 5 |
2 files changed, 37 insertions, 0 deletions
diff --git a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php index 97d8ccd65c3..d9bc9a7e2ad 100644 --- a/apps/federatedfilesharing/tests/FederatedShareProviderTest.php +++ b/apps/federatedfilesharing/tests/FederatedShareProviderTest.php @@ -705,6 +705,38 @@ class FederatedShareProviderTest extends \Test\TestCase { ); } + /** + * @dataProvider dataTestFederatedSharingSettings + * + * @param string $isEnabled + * @param bool $expected + */ + public function testIsLookupServerQueriesEnabled($isEnabled, $expected) { + $this->config->expects($this->once())->method('getAppValue') + ->with('files_sharing', 'lookupServerEnabled', 'no') + ->willReturn($isEnabled); + + $this->assertSame($expected, + $this->provider->isLookupServerQueriesEnabled() + ); + } + + /** + * @dataProvider dataTestFederatedSharingSettings + * + * @param string $isEnabled + * @param bool $expected + */ + public function testIsLookupServerUploadEnabled($isEnabled, $expected) { + $this->config->expects($this->once())->method('getAppValue') + ->with('files_sharing', 'lookupServerUploadEnabled', 'yes') + ->willReturn($isEnabled); + + $this->assertSame($expected, + $this->provider->isLookupServerUploadEnabled() + ); + } + public function dataTestFederatedSharingSettings() { return [ ['yes', true], diff --git a/apps/federatedfilesharing/tests/Settings/AdminTest.php b/apps/federatedfilesharing/tests/Settings/AdminTest.php index c0b35a6427b..9eae6317bf7 100644 --- a/apps/federatedfilesharing/tests/Settings/AdminTest.php +++ b/apps/federatedfilesharing/tests/Settings/AdminTest.php @@ -69,11 +69,16 @@ class AdminTest extends TestCase { ->expects($this->once()) ->method('isLookupServerQueriesEnabled') ->willReturn($state); + $this->federatedShareProvider + ->expects($this->once()) + ->method('isLookupServerUploadEnabled') + ->willReturn($state); $params = [ 'outgoingServer2serverShareEnabled' => $state, 'incomingServer2serverShareEnabled' => $state, 'lookupServerEnabled' => $state, + 'lookupServerUploadEnabled' => $state ]; $expected = new TemplateResponse('federatedfilesharing', 'settings-admin', $params, ''); $this->assertEquals($expected, $this->admin->getForm()); |