diff options
Diffstat (limited to 'apps/federation/tests/BackgroundJob/GetSharedSecretTest.php')
-rw-r--r-- | apps/federation/tests/BackgroundJob/GetSharedSecretTest.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php b/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php index fe7cc5cc337..6364ddaedff 100644 --- a/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php +++ b/apps/federation/tests/BackgroundJob/GetSharedSecretTest.php @@ -36,6 +36,7 @@ use OCP\Http\Client\IClient; use OCP\Http\Client\IResponse; use OCP\ILogger; use OCP\IURLGenerator; +use OCP\OCS\IDiscoveryService; /** * Class GetSharedSecretTest @@ -67,6 +68,9 @@ class GetSharedSecretTest extends TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject | IResponse */ private $response; + /** @var \PHPUnit_Framework_MockObject_MockObject | IDiscoveryService */ + private $discoverService; + /** @var GetSharedSecret */ private $getSharedSecret; @@ -82,6 +86,9 @@ class GetSharedSecretTest extends TestCase { ->disableOriginalConstructor()->getMock(); $this->logger = $this->getMockBuilder(ILogger::class)->getMock(); $this->response = $this->getMockBuilder(IResponse::class)->getMock(); + $this->discoverService = $this->getMockBuilder(IDiscoveryService::class)->getMock(); + + $this->discoverService->expects($this->any())->method('discover')->willReturn([]); $this->getSharedSecret = new GetSharedSecret( $this->httpClient, @@ -89,7 +96,8 @@ class GetSharedSecretTest extends TestCase { $this->jobList, $this->trustedServers, $this->logger, - $this->dbHandler + $this->dbHandler, + $this->discoverService ); } @@ -109,7 +117,8 @@ class GetSharedSecretTest extends TestCase { $this->jobList, $this->trustedServers, $this->logger, - $this->dbHandler + $this->dbHandler, + $this->discoverService ] )->setMethods(['parentExecute'])->getMock(); $this->invokePrivate($getSharedSecret, 'argument', [['url' => 'url']]); |