server/tests/lib/Http/Client/ClientServiceTest.php
Robin Appelman 9b25ff9fcb
adjust httpclient to guzzle6
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-02-09 17:13:21 +01:00

30 lines
871 B
PHP

<?php
/**
* Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace Test\Http\Client;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\HandlerStack;
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->createMock(IConfig::class);
$certificateManager = $this->createMock(ICertificateManager::class);
$expected = new Client($config, $certificateManager, new GuzzleClient(), HandlerStack::create());
$clientService = new ClientService($config, $certificateManager);
$this->assertEquals($expected, $clientService->newClient());
}
}