summaryrefslogtreecommitdiff
path: root/tests/Unit/Http/GuzzleServiceProviderTest.php
blob: 4d3c938b6bbe95a6590a9d0030cdeabdf6ad7039 (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\GuzzleServiceProvider;
use Engelsystem\Test\Unit\ServiceProviderTest;
use GuzzleHttp\Client as GuzzleClient;

class GuzzleServiceProviderTest extends ServiceProviderTest
{
    /**
     * @covers \Engelsystem\Http\GuzzleServiceProvider::register
     */
    public function testRegister()
    {
        $app = new Application();

        $serviceProvider = new GuzzleServiceProvider($app);
        $serviceProvider->register();

        /** @var GuzzleClient $guzzle */
        $guzzle = $app->make(GuzzleClient::class);
        $config = $guzzle->getConfig();

        $this->assertFalse($config['http_errors']);
        $this->assertArrayHasKey('timeout', $config);
    }
}