nextcloud/tests/lib/Http/Client/ClientServiceTest.php

36 lines
975 B
PHP
Raw Normal View History

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;
2016-09-07 21:05:51 +03:00
use OCP\ICertificateManager;
use OCP\IConfig;
use OCP\ILogger;
2015-03-16 13:28:23 +03:00
/**
* Class ClientServiceTest
*/
class ClientServiceTest extends \Test\TestCase {
public function testNewClient(): void {
/** @var IConfig $config */
2016-09-07 21:05:51 +03:00
$config = $this->createMock(IConfig::class);
/** @var ICertificateManager $certificateManager */
2016-09-07 21:05:51 +03:00
$certificateManager = $this->createMock(ICertificateManager::class);
$logger = $this->createMock(ILogger::class);
2015-03-16 13:28:23 +03:00
$clientService = new ClientService($config, $logger, $certificateManager);
$this->assertEquals(
new Client($config, $logger, $certificateManager, new GuzzleClient()),
$clientService->newClient()
);
2015-03-16 13:28:23 +03:00
}
}