engelsystem/tests/Unit/Http/HttpClientServiceProviderTe...

32 lines
819 B
PHP

<?php
declare(strict_types=1);
namespace Engelsystem\Test\Unit\Http;
use Engelsystem\Application;
use Engelsystem\Http\HttpClientServiceProvider;
use Engelsystem\Test\Unit\ServiceProviderTest;
use GuzzleHttp\Client as GuzzleClient;
class HttpClientServiceProviderTest extends ServiceProviderTest
{
/**
* @covers \Engelsystem\Http\HttpClientServiceProvider::register
*/
public function testRegister(): void
{
$app = new Application();
$serviceProvider = new HttpClientServiceProvider($app);
$serviceProvider->register();
/** @var GuzzleClient $guzzle */
$guzzle = $app->make(GuzzleClient::class);
$config = $guzzle->getConfig();
$this->assertFalse($config['http_errors']);
$this->assertArrayHasKey('timeout', $config);
}
}