2015-03-16 13:28:23 +03:00
|
|
|
<?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.
|
|
|
|
*/
|
|
|
|
|
2016-05-19 09:46:58 +03:00
|
|
|
namespace Test\Http\Client;
|
2015-03-16 13:28:23 +03:00
|
|
|
|
|
|
|
use GuzzleHttp\Client as GuzzleClient;
|
2016-05-19 09:46:58 +03:00
|
|
|
use OC\Http\Client\Client;
|
|
|
|
use OC\Http\Client\ClientService;
|
2015-03-16 13:28:23 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class ClientServiceTest
|
|
|
|
*/
|
|
|
|
class ClientServiceTest extends \Test\TestCase {
|
|
|
|
public function testNewClient() {
|
|
|
|
$config = $this->getMock('\OCP\IConfig');
|
|
|
|
$certificateManager = $this->getMock('\OCP\ICertificateManager');
|
|
|
|
|
|
|
|
$expected = new Client($config, $certificateManager, new GuzzleClient());
|
|
|
|
$clientService = new ClientService($config, $certificateManager);
|
|
|
|
$this->assertEquals($expected, $clientService->newClient());
|
|
|
|
}
|
|
|
|
}
|