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

Guzzle6Mock   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 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