diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2025-03-10 16:24:26 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2025-03-11 14:26:47 +0100 |
commit | 00d08a4f692f66a697080dbd353bcd6d66a6b67b (patch) | |
tree | 2b69ce1b221f3256ed137bb239367c1680fbb1a1 /tests | |
parent | 34251c4375cd2b0b26b2f5f4b8cbe3bd4c50f8a3 (diff) | |
download | nextcloud-server-00d08a4f692f66a697080dbd353bcd6d66a6b67b.tar.gz nextcloud-server-00d08a4f692f66a697080dbd353bcd6d66a6b67b.zip |
fix(lookup-server): disable lookup server for non-global scale setups
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Collaboration/Collaborators/LookupPluginTest.php | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php index 1ca40d160aa..7ff01831e18 100644 --- a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php @@ -80,7 +80,7 @@ class LookupPluginTest extends TestCase { ['gs.enabled', false], ['has_internet_connection', true], )->willReturnOnConsecutiveCalls( - false, + true, true, ); @@ -145,7 +145,7 @@ class LookupPluginTest extends TestCase { ['gs.enabled', false], ['has_internet_connection', true], )->willReturnOnConsecutiveCalls( - false, + true, true, ); @@ -199,7 +199,7 @@ class LookupPluginTest extends TestCase { ->method('getAppValue') ->with('files_sharing', 'lookupServerEnabled', 'no') ->willReturn($LookupEnabled ? 'yes' : 'no'); - if ($GSEnabled || $LookupEnabled) { + if ($GSEnabled) { $searchResult->expects($this->once()) ->method('addResultSet') ->with($type, $searchParams['expectedResult'], []); @@ -258,11 +258,13 @@ class LookupPluginTest extends TestCase { } - public function testSearchLookupServerDisabled(): void { - $this->config->expects($this->once()) - ->method('getAppValue') - ->with('files_sharing', 'lookupServerEnabled', 'yes') - ->willReturn('no'); + public function testSearchGSDisabled(): void { + $this->config->expects($this->atLeastOnce()) + ->method('getSystemValueBool') + ->willReturnMap([ + ['has_internet_connection', true, true], + ['gs.enabled', false, false], + ]); /** @var ISearchResult|MockObject $searchResult */ $searchResult = $this->createMock(ISearchResult::class); @@ -381,7 +383,6 @@ class LookupPluginTest extends TestCase { 'label' => $fedIDs[0], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, - 'globalScale' => false, 'shareWith' => $fedIDs[0] ], 'extra' => ['federationId' => $fedIDs[0]], @@ -390,7 +391,6 @@ class LookupPluginTest extends TestCase { 'label' => $fedIDs[1], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, - 'globalScale' => false, 'shareWith' => $fedIDs[1] ], 'extra' => ['federationId' => $fedIDs[1]], @@ -399,7 +399,6 @@ class LookupPluginTest extends TestCase { 'label' => $fedIDs[2], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, - 'globalScale' => false, 'shareWith' => $fedIDs[2] ], 'extra' => ['federationId' => $fedIDs[2]], @@ -474,7 +473,7 @@ class LookupPluginTest extends TestCase { 'label' => $fedIDs[0], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, - 'globalScale' => false, + 'globalScale' => true, 'shareWith' => $fedIDs[0] ], 'extra' => ['federationId' => $fedIDs[0]], @@ -483,7 +482,7 @@ class LookupPluginTest extends TestCase { 'label' => $fedIDs[1], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, - 'globalScale' => false, + 'globalScale' => true, 'shareWith' => $fedIDs[1] ], 'extra' => ['federationId' => $fedIDs[1]], @@ -492,7 +491,7 @@ class LookupPluginTest extends TestCase { 'label' => $fedIDs[2], 'value' => [ 'shareType' => IShare::TYPE_REMOTE, - 'globalScale' => false, + 'globalScale' => true, 'shareWith' => $fedIDs[2] ], 'extra' => ['federationId' => $fedIDs[2]], |