2019-11-27 23:43:21 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Engelsystem\Test\Unit\Http;
|
|
|
|
|
|
|
|
use Engelsystem\Application;
|
2019-12-01 22:10:10 +01:00
|
|
|
use Engelsystem\Http\HttpClientServiceProvider;
|
2019-11-27 23:43:21 +01:00
|
|
|
use Engelsystem\Test\Unit\ServiceProviderTest;
|
|
|
|
use GuzzleHttp\Client as GuzzleClient;
|
|
|
|
|
2019-12-01 22:10:10 +01:00
|
|
|
class HttpClientServiceProviderTest extends ServiceProviderTest
|
2019-11-27 23:43:21 +01:00
|
|
|
{
|
|
|
|
/**
|
2019-12-01 22:10:10 +01:00
|
|
|
* @covers \Engelsystem\Http\HttpClientServiceProvider::register
|
2019-11-27 23:43:21 +01:00
|
|
|
*/
|
|
|
|
public function testRegister()
|
|
|
|
{
|
|
|
|
$app = new Application();
|
|
|
|
|
2019-12-01 22:10:10 +01:00
|
|
|
$serviceProvider = new HttpClientServiceProvider($app);
|
2019-11-27 23:43:21 +01:00
|
|
|
$serviceProvider->register();
|
|
|
|
|
|
|
|
/** @var GuzzleClient $guzzle */
|
|
|
|
$guzzle = $app->make(GuzzleClient::class);
|
|
|
|
$config = $guzzle->getConfig();
|
|
|
|
|
|
|
|
$this->assertFalse($config['http_errors']);
|
|
|
|
$this->assertArrayHasKey('timeout', $config);
|
|
|
|
}
|
|
|
|
}
|