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

GuzzleClientTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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