summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/ExternalStorageTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/tests/ExternalStorageTest.php')
-rw-r--r--apps/files_sharing/tests/ExternalStorageTest.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/ExternalStorageTest.php b/apps/files_sharing/tests/ExternalStorageTest.php
index e84d2bb0e17..49b72be1391 100644
--- a/apps/files_sharing/tests/ExternalStorageTest.php
+++ b/apps/files_sharing/tests/ExternalStorageTest.php
@@ -25,6 +25,9 @@
*/
namespace OCA\Files_Sharing\Tests;
+use OCP\Http\Client\IClient;
+use OCP\Http\Client\IClientService;
+use OCP\Http\Client\IResponse;
/**
* Tests for the external Storage class for remote shares.
@@ -69,6 +72,22 @@ class ExternalStorageTest extends \Test\TestCase {
private function getTestStorage($uri) {
$certificateManager = \OC::$server->getCertificateManager();
+ $httpClientService = $this->createMock(IClientService::class);
+ $client = $this->createMock(IClient::class);
+ $response = $this->createMock(IResponse::class);
+ $client
+ ->expects($this->any())
+ ->method('get')
+ ->willReturn($response);
+ $client
+ ->expects($this->any())
+ ->method('post')
+ ->willReturn($response);
+ $httpClientService
+ ->expects($this->any())
+ ->method('newClient')
+ ->willReturn($client);
+
return new TestSharingExternalStorage(
array(
'remote' => $uri,
@@ -77,7 +96,8 @@ class ExternalStorageTest extends \Test\TestCase {
'token' => 'abcdef',
'password' => '',
'manager' => null,
- 'certificateManager' => $certificateManager
+ 'certificateManager' => $certificateManager,
+ 'HttpClientService' => $httpClientService,
)
);
}