|
|
|
|
@ -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]], |
|
|
|
|
|