summaryrefslogtreecommitdiffstats
path: root/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php')
-rw-r--r--apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php
index 3fa2ca2973e..06da29d17fc 100644
--- a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php
+++ b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php
@@ -33,6 +33,7 @@ use OCP\BackgroundJob\IJobList;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IResponse;
use OCP\IURLGenerator;
+use OCP\OCS\IDiscoveryService;
use Test\TestCase;
class RequestSharedSecretTest extends TestCase {
@@ -55,6 +56,9 @@ class RequestSharedSecretTest extends TestCase {
/** @var \PHPUnit_Framework_MockObject_MockObject | IResponse */
private $response;
+ /** @var \PHPUnit_Framework_MockObject_MockObject | IDiscoveryService */
+ private $discoveryService;
+
/** @var RequestSharedSecret */
private $requestSharedSecret;
@@ -69,13 +73,17 @@ class RequestSharedSecretTest extends TestCase {
$this->dbHandler = $this->getMockBuilder(DbHandler::class)
->disableOriginalConstructor()->getMock();
$this->response = $this->getMockBuilder(IResponse::class)->getMock();
+ $this->discoveryService = $this->getMockBuilder(IDiscoveryService::class)->getMock();
+
+ $this->discoveryService->expects($this->any())->method('discover')->willReturn([]);
$this->requestSharedSecret = new RequestSharedSecret(
$this->httpClient,
$this->urlGenerator,
$this->jobList,
$this->trustedServers,
- $this->dbHandler
+ $this->dbHandler,
+ $this->discoveryService
);
}
@@ -94,7 +102,8 @@ class RequestSharedSecretTest extends TestCase {
$this->urlGenerator,
$this->jobList,
$this->trustedServers,
- $this->dbHandler
+ $this->dbHandler,
+ $this->discoveryService
]
)->setMethods(['parentExecute'])->getMock();
$this->invokePrivate($requestSharedSecret, 'argument', [['url' => 'url']]);