|
|
|
|
@ -97,7 +97,7 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
['gs.enabled', false],
|
|
|
|
|
['has_internet_connection', true],
|
|
|
|
|
)->willReturnOnConsecutiveCalls(
|
|
|
|
|
false,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
@ -162,7 +162,7 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
['gs.enabled', false],
|
|
|
|
|
['has_internet_connection', true],
|
|
|
|
|
)->willReturnOnConsecutiveCalls(
|
|
|
|
|
false,
|
|
|
|
|
true,
|
|
|
|
|
true,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
@ -216,7 +216,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'], []);
|
|
|
|
|
@ -274,12 +274,13 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
$this->assertFalse($moreResults);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testSearchLookupServerDisabled() {
|
|
|
|
|
$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);
|
|
|
|
|
@ -398,7 +399,6 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
'label' => $fedIDs[0],
|
|
|
|
|
'value' => [
|
|
|
|
|
'shareType' => IShare::TYPE_REMOTE,
|
|
|
|
|
'globalScale' => false,
|
|
|
|
|
'shareWith' => $fedIDs[0]
|
|
|
|
|
],
|
|
|
|
|
'extra' => ['federationId' => $fedIDs[0]],
|
|
|
|
|
@ -407,7 +407,6 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
'label' => $fedIDs[1],
|
|
|
|
|
'value' => [
|
|
|
|
|
'shareType' => IShare::TYPE_REMOTE,
|
|
|
|
|
'globalScale' => false,
|
|
|
|
|
'shareWith' => $fedIDs[1]
|
|
|
|
|
],
|
|
|
|
|
'extra' => ['federationId' => $fedIDs[1]],
|
|
|
|
|
@ -416,7 +415,6 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
'label' => $fedIDs[2],
|
|
|
|
|
'value' => [
|
|
|
|
|
'shareType' => IShare::TYPE_REMOTE,
|
|
|
|
|
'globalScale' => false,
|
|
|
|
|
'shareWith' => $fedIDs[2]
|
|
|
|
|
],
|
|
|
|
|
'extra' => ['federationId' => $fedIDs[2]],
|
|
|
|
|
@ -491,7 +489,7 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
'label' => $fedIDs[0],
|
|
|
|
|
'value' => [
|
|
|
|
|
'shareType' => IShare::TYPE_REMOTE,
|
|
|
|
|
'globalScale' => false,
|
|
|
|
|
'globalScale' => true,
|
|
|
|
|
'shareWith' => $fedIDs[0]
|
|
|
|
|
],
|
|
|
|
|
'extra' => ['federationId' => $fedIDs[0]],
|
|
|
|
|
@ -500,7 +498,7 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
'label' => $fedIDs[1],
|
|
|
|
|
'value' => [
|
|
|
|
|
'shareType' => IShare::TYPE_REMOTE,
|
|
|
|
|
'globalScale' => false,
|
|
|
|
|
'globalScale' => true,
|
|
|
|
|
'shareWith' => $fedIDs[1]
|
|
|
|
|
],
|
|
|
|
|
'extra' => ['federationId' => $fedIDs[1]],
|
|
|
|
|
@ -509,7 +507,7 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
'label' => $fedIDs[2],
|
|
|
|
|
'value' => [
|
|
|
|
|
'shareType' => IShare::TYPE_REMOTE,
|
|
|
|
|
'globalScale' => false,
|
|
|
|
|
'globalScale' => true,
|
|
|
|
|
'shareWith' => $fedIDs[2]
|
|
|
|
|
],
|
|
|
|
|
'extra' => ['federationId' => $fedIDs[2]],
|
|
|
|
|
|