diff options
author | Joas Schilling <coding@schilljs.com> | 2023-06-02 16:05:35 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-08-07 15:38:09 +0200 |
commit | 32bfd43d2921d65198b2302a3084077eb154ecb6 (patch) | |
tree | 91773a648859b49ef91a2d4f7647f74776bf8c81 /tests/lib | |
parent | cc66e3bcd1afc305c121358d38be4bce03e35053 (diff) | |
download | nextcloud-server-32bfd43d2921d65198b2302a3084077eb154ecb6.tar.gz nextcloud-server-32bfd43d2921d65198b2302a3084077eb154ecb6.zip |
feat(HTTPClient): Provide wrapped access to Guzzle's asyncRequest()
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Http/Client/ClientServiceTest.php | 8 | ||||
-rw-r--r-- | tests/lib/Http/Client/ClientTest.php | 5 |
2 files changed, 10 insertions, 3 deletions
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, ); } |