aboutsummaryrefslogtreecommitdiffstats
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.php40
1 files changed, 20 insertions, 20 deletions
diff --git a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php
index d013ad221bc..5aca6005f94 100644
--- a/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php
+++ b/apps/federation/tests/BackgroundJob/RequestSharedSecretTest.php
@@ -34,38 +34,38 @@ use OCP\BackgroundJob\IJobList;
use OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\IResponse;
-use OCP\ILogger;
use OCP\IURLGenerator;
use OCP\OCS\IDiscoveryService;
+use PHPUnit\Framework\MockObject\MockObject;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
class RequestSharedSecretTest extends TestCase {
-
- /** @var \PHPUnit\Framework\MockObject\MockObject|IClientService */
+ /** @var MockObject|IClientService */
private $httpClientService;
- /** @var \PHPUnit\Framework\MockObject\MockObject|IClient */
+ /** @var MockObject|IClient */
private $httpClient;
- /** @var \PHPUnit\Framework\MockObject\MockObject|IJobList */
+ /** @var MockObject|IJobList */
private $jobList;
- /** @var \PHPUnit\Framework\MockObject\MockObject|IURLGenerator */
+ /** @var MockObject|IURLGenerator */
private $urlGenerator;
- /** @var \PHPUnit\Framework\MockObject\MockObject|TrustedServers */
+ /** @var MockObject|TrustedServers */
private $trustedServers;
- /** @var \PHPUnit\Framework\MockObject\MockObject|IResponse */
+ /** @var MockObject|IResponse */
private $response;
- /** @var \PHPUnit\Framework\MockObject\MockObject|IDiscoveryService */
+ /** @var MockObject|IDiscoveryService */
private $discoveryService;
- /** @var \PHPUnit\Framework\MockObject\MockObject|ILogger */
+ /** @var MockObject|LoggerInterface */
private $logger;
- /** @var \PHPUnit\Framework\MockObject\MockObject|ITimeFactory */
+ /** @var MockObject|ITimeFactory */
private $timeFactory;
/** @var RequestSharedSecret */
@@ -82,7 +82,7 @@ class RequestSharedSecretTest extends TestCase {
->disableOriginalConstructor()->getMock();
$this->response = $this->getMockBuilder(IResponse::class)->getMock();
$this->discoveryService = $this->getMockBuilder(IDiscoveryService::class)->getMock();
- $this->logger = $this->createMock(ILogger::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
$this->discoveryService->expects($this->any())->method('discover')->willReturn([]);
@@ -100,13 +100,13 @@ class RequestSharedSecretTest extends TestCase {
}
/**
- * @dataProvider dataTestExecute
+ * @dataProvider dataTestStart
*
* @param bool $isTrustedServer
* @param bool $retainBackgroundJob
*/
- public function testExecute($isTrustedServer, $retainBackgroundJob) {
- /** @var RequestSharedSecret |\PHPUnit\Framework\MockObject\MockObject $requestSharedSecret */
+ public function testStart($isTrustedServer, $retainBackgroundJob) {
+ /** @var RequestSharedSecret |MockObject $requestSharedSecret */
$requestSharedSecret = $this->getMockBuilder('OCA\Federation\BackgroundJob\RequestSharedSecret')
->setConstructorArgs(
[
@@ -118,15 +118,15 @@ class RequestSharedSecretTest extends TestCase {
$this->logger,
$this->timeFactory
]
- )->setMethods(['parentExecute'])->getMock();
+ )->setMethods(['parentStart'])->getMock();
$this->invokePrivate($requestSharedSecret, 'argument', [['url' => 'url', 'token' => 'token']]);
$this->trustedServers->expects($this->once())->method('isTrustedServer')
->with('url')->willReturn($isTrustedServer);
if ($isTrustedServer) {
- $requestSharedSecret->expects($this->once())->method('parentExecute');
+ $requestSharedSecret->expects($this->once())->method('parentStart');
} else {
- $requestSharedSecret->expects($this->never())->method('parentExecute');
+ $requestSharedSecret->expects($this->never())->method('parentStart');
}
$this->invokePrivate($requestSharedSecret, 'retainJob', [$retainBackgroundJob]);
$this->jobList->expects($this->once())->method('remove');
@@ -148,10 +148,10 @@ class RequestSharedSecretTest extends TestCase {
$this->jobList->expects($this->never())->method('add');
}
- $requestSharedSecret->execute($this->jobList);
+ $requestSharedSecret->start($this->jobList);
}
- public function dataTestExecute() {
+ public function dataTestStart() {
return [
[true, true],
[true, false],