Completed
Push — master ( 943d61...bccf98 )
by Guillaume
06:26
created

GuzzleClientTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
c 2
b 0
f 1
lcom 1
cbo 5
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A testClient() 0 5 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
use Webmozart\Console\IO\BufferedIO;
8
9
/**
10
 * @author Guillaume Cavana <[email protected]>
11
 */
12
class GuzzleClientTest extends \PHPUnit_Framework_TestCase
13
{
14
    /**
15
     * @var BufferedIO
16
     */
17
    private $io;
18
19
    protected function setUp()
20
    {
21
        $this->io = new BufferedIO();
22
    }
23
24
    /**
25
     * testClient.
26
     */
27
    public function testClient()
28
    {
29
        $client = GuzzleClient::createClient($this->io);
30
        $this->assertSame(false, $client->getConfig()['allow_redirects']);
31
    }
32
33
    /**
34
     * testClientModifiedOptions.
35
     */
36
    public function testClientModifiedOptions()
37
    {
38
        $client = GuzzleClient::createClient($this->io, ['allow_redirects' => true, 'handler' => new MockHandler()]);
39
        $this->assertSame(true, $client->getConfig()['allow_redirects']);
40
        $this->assertInstanceOf(MockHandler::class, $client->getConfig()['handler']);
41
    }
42
}
43