From 32bfd43d2921d65198b2302a3084077eb154ecb6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 2 Jun 2023 16:05:35 +0200 Subject: feat(HTTPClient): Provide wrapped access to Guzzle's asyncRequest() Signed-off-by: Joas Schilling --- tests/lib/Http/Client/ClientServiceTest.php | 8 ++++++-- tests/lib/Http/Client/ClientTest.php | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'tests/lib') diff --git a/tests/lib/Http/Client/ClientServiceTest.php b/tests/lib/Http/Client/ClientServiceTest.php index 72281a0453c..40da0a2111c 100644 --- a/tests/lib/Http/Client/ClientServiceTest.php +++ b/tests/lib/Http/Client/ClientServiceTest.php @@ -23,6 +23,7 @@ use OCP\ICertificateManager; use OCP\IConfig; use OCP\Security\IRemoteHostValidator; use Psr\Http\Message\RequestInterface; +use Psr\Log\LoggerInterface; /** * Class ClientServiceTest @@ -41,13 +42,15 @@ class ClientServiceTest extends \Test\TestCase { }); $remoteHostValidator = $this->createMock(IRemoteHostValidator::class); $eventLogger = $this->createMock(IEventLogger::class); + $logger = $this->createMock(LoggerInterface::class); $clientService = new ClientService( $config, $certificateManager, $dnsPinMiddleware, $remoteHostValidator, - $eventLogger + $eventLogger, + $logger, ); $handler = new CurlHandler(); @@ -65,7 +68,8 @@ class ClientServiceTest extends \Test\TestCase { $config, $certificateManager, $guzzleClient, - $remoteHostValidator + $remoteHostValidator, + $logger, ), $clientService->newClient() ); diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php index 9a4fb1c657e..e48e237e0cc 100644 --- a/tests/lib/Http/Client/ClientTest.php +++ b/tests/lib/Http/Client/ClientTest.php @@ -19,6 +19,7 @@ use OCP\ICertificateManager; use OCP\IConfig; use OCP\Security\IRemoteHostValidator; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use function parse_url; /** @@ -44,11 +45,13 @@ class ClientTest extends \Test\TestCase { $this->guzzleClient = $this->createMock(\GuzzleHttp\Client::class); $this->certificateManager = $this->createMock(ICertificateManager::class); $this->remoteHostValidator = $this->createMock(IRemoteHostValidator::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->client = new Client( $this->config, $this->certificateManager, $this->guzzleClient, - $this->remoteHostValidator + $this->remoteHostValidator, + $this->logger, ); } -- cgit v1.2.3