summaryrefslogtreecommitdiff
path: root/tests/Unit/Http/HttpClientServiceProviderTest.php
blob: 7dfc0a3ec81d7bcf51c9a65f022bbbed4e044703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

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()
    {
        $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);
    }
}