]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix getMock Http Client
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 7 Sep 2016 18:05:51 +0000 (20:05 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 7 Sep 2016 18:42:37 +0000 (20:42 +0200)
tests/lib/Http/Client/ClientServiceTest.php
tests/lib/Http/Client/ClientTest.php

index 3c406f30111462727d90034f3d2ef96f6eded7fb..48330dc33c0b1b2543d157e43481b5a17360f730 100644 (file)
@@ -11,14 +11,16 @@ namespace Test\Http\Client;
 use GuzzleHttp\Client as GuzzleClient;
 use OC\Http\Client\Client;
 use OC\Http\Client\ClientService;
+use OCP\ICertificateManager;
+use OCP\IConfig;
 
 /**
  * Class ClientServiceTest
  */
 class ClientServiceTest extends \Test\TestCase {
        public function testNewClient() {
-               $config = $this->getMock('\OCP\IConfig');
-               $certificateManager = $this->getMock('\OCP\ICertificateManager');
+               $config = $this->createMock(IConfig::class);
+               $certificateManager = $this->createMock(ICertificateManager::class);
 
                $expected = new Client($config, $certificateManager, new GuzzleClient());
                $clientService = new ClientService($config, $certificateManager);
index 705e1eeddea0b85911eb51129de94af047eebedd..4369eab3a54a43dd2332ebf9573b2f707d04ca72 100644 (file)
@@ -10,6 +10,7 @@ namespace Test\Http\Client;
 
 use GuzzleHttp\Message\Response;
 use OC\Http\Client\Client;
+use OCP\ICertificateManager;
 use OCP\IConfig;
 
 /**
@@ -25,11 +26,11 @@ class ClientTest extends \Test\TestCase {
 
        public function setUp() {
                parent::setUp();
-               $this->config = $this->getMock('\OCP\IConfig');
+               $this->config = $this->createMock(IConfig::class);
                $this->guzzleClient = $this->getMockBuilder('\GuzzleHttp\Client')
                        ->disableOriginalConstructor()
                        ->getMock();
-               $certificateManager = $this->getMock('\OCP\ICertificateManager');
+               $certificateManager = $this->createMock(ICertificateManager::class);
                $this->client = new Client(
                        $this->config,
                        $certificateManager,