Completed
Pull Request — master (#5)
by Jean-Baptiste
04:36
created

Guzzle6Mock::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace CanalTP\AbstractGuzzle\Tests\Mock;
4
5
use CanalTP\AbstractGuzzle\GuzzleFactory;
6
use GuzzleHttp\Handler\MockHandler;
7
use GuzzleHttp\HandlerStack;
8
9
class Guzzle6Mock extends \PHPUnit_Framework_TestCase
10
{
11
12
    /**
13
     * Guzzle6Mock constructor.
14
     */
15
    /**
16
     * Guzzle6Mock constructor.
17
     * @param array $responseCollection new Response(200, ['X-Foo' => 'Bar']),
18
    new Response(202, ['Content-Length' => 0]),
19
    new RequestException("Error Communicating with Server", new Request('GET', 'test'))
20
     */
21
    public function __construct(array $responseCollection)
22
    {
23
        $mock = new MockHandler($responseCollection);
24
        $handler = HandlerStack::create($mock);
25
26
        return GuzzleFactory::createGuzzle('', ['handler' => $handler]);
0 ignored issues
show
Bug introduced by
Constructors do not have meaningful return values, anything that is returned from here is discarded. Are you sure this is correct?
Loading history...
27
    }
28
}
29