Completed
Push — master ( 4f2fad...dd1cd3 )
by Guillaume
07:10
created

GuzzleClientTest::testClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Hogosha\Monitor\Client;
4
5
use GuzzleHttp\Handler\CurlMultiHandler;
6
use GuzzleHttp\Handler\MockHandler;
7
8
/**
9
 * @author Guillaume Cavana <[email protected]>
10
 */
11
class GuzzleClientTest extends \PHPUnit_Framework_TestCase
12
{
13
    /**
14
     * testClient.
15
     */
16
    public function testClient()
17
    {
18
        $client = GuzzleClient::createClient();
19
        $this->assertSame(false, $client->getConfig()['allow_redirects']);
20
        $this->assertInstanceOf(CurlMultiHandler::class, $client->getConfig()['handler']);
21
    }
22
23
    /**
24
     * testClientModifiedOptions.
25
     */
26
    public function testClientModifiedOptions()
27
    {
28
        $client = GuzzleClient::createClient(['allow_redirects' => true, 'handler' => new MockHandler()]);
29
        $this->assertSame(true, $client->getConfig()['allow_redirects']);
30
        $this->assertInstanceOf(MockHandler::class, $client->getConfig()['handler']);
31
    }
32
}
33