|
|
|
|
@ -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'], []);
|
|
|
|
|
@ -257,12 +257,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);
|
|
|
|
|
@ -381,7 +382,6 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
'label' => $fedIDs[0],
|
|
|
|
|
'value' => [
|
|
|
|
|
'shareType' => IShare::TYPE_REMOTE,
|
|
|
|
|
'globalScale' => false,
|
|
|
|
|
'shareWith' => $fedIDs[0]
|
|
|
|
|
],
|
|
|
|
|
'extra' => ['federationId' => $fedIDs[0]],
|
|
|
|
|
@ -390,7 +390,6 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
'label' => $fedIDs[1],
|
|
|
|
|
'value' => [
|
|
|
|
|
'shareType' => IShare::TYPE_REMOTE,
|
|
|
|
|
'globalScale' => false,
|
|
|
|
|
'shareWith' => $fedIDs[1]
|
|
|
|
|
],
|
|
|
|
|
'extra' => ['federationId' => $fedIDs[1]],
|
|
|
|
|
@ -399,7 +398,6 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
'label' => $fedIDs[2],
|
|
|
|
|
'value' => [
|
|
|
|
|
'shareType' => IShare::TYPE_REMOTE,
|
|
|
|
|
'globalScale' => false,
|
|
|
|
|
'shareWith' => $fedIDs[2]
|
|
|
|
|
],
|
|
|
|
|
'extra' => ['federationId' => $fedIDs[2]],
|
|
|
|
|
@ -474,7 +472,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 +481,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 +490,7 @@ class LookupPluginTest extends TestCase {
|
|
|
|
|
'label' => $fedIDs[2],
|
|
|
|
|
'value' => [
|
|
|
|
|
'shareType' => IShare::TYPE_REMOTE,
|
|
|
|
|
'globalScale' => false,
|
|
|
|
|
'globalScale' => true,
|
|
|
|
|
'shareWith' => $fedIDs[2]
|
|
|
|
|
],
|
|
|
|
|
'extra' => ['federationId' => $fedIDs[2]],
|
|
|
|
|
|