HttpInteraction::setUp()   A
last analyzed

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
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: cesinha
5
 * Date: 31/07/17
6
 * Time: 08:15
7
 */
8
9
namespace Preetender\Routing\Testing;
10
use GuzzleHttp\Client;
11
use Psr\Http\Message\ResponseInterface;
12
13
/**
14
 * Trait HttpInteraction
15
 * @package Preetender\Routing\Testing
16
 */
17
trait HttpInteraction
18
{
19
    /** @var string  */
20
    protected $baseUrl = 'http://routing_v1_2.app';
21
22
    /** @var float  */
23
    protected $timeout = 2.0;
24
25
    /** @var Client */
26
    protected $http;
27
28
    /**
29
     * @param ResponseInterface $response
30
     * @return ResponseInterface
31
     */
32
    protected function getResponse(ResponseInterface $response)
33
    {
34
        return $response;
35
    }
36
37
    /**
38
     * ....
39
     *
40
     * @inheritdoc
41
     */
42
    public function setUp()
43
    {
44
        $this->http = new Client([
45
            'base_uri' => $this->baseUrl,
46
            'timeout' => $this->timeout
47
        ]);
48
    }
49
}