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

GuzzleClientTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 4
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testClient() 0 6 1
A testClientModifiedOptions() 0 6 1
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