Completed
Pull Request — master (#63)
by Iman
14:50 queued 09:28
created

Chain   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 10
dl 0
loc 40
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __destruct() 0 3 1
A http() 0 3 1
A addAssertion() 0 3 1
1
<?php
2
3
namespace Imanghafoori\HeyMan\MakeSure;
4
5
class Chain
6
{
7
    private $phpunit;
8
9 38
    public function __construct($phpunit)
10
    {
11 38
        $this->phpunit = $phpunit;
12 38
    }
13
14
    public $http = [];
15
16
    public $assertion = [];
17
18
    public $event;
19
20
    public $exception;
21
22 38
    public function __destruct()
23
    {
24 38
        (new CheckExpectations($this, $this->phpunit))->check();
25 37
    }
26
27
    /**
28
     * @param $uri
29
     * @param array $data
30
     * @param array $headers
31
     * @param $method
32
     */
33 37
    public function http($uri, array $data, array $headers, $method)
34
    {
35 37
        $this->http = get_defined_vars();
36 37
    }
37
38
    /**
39
     * @param $value
40
     * @param $type
41
     */
42 29
    public function addAssertion($type, $value = null)
43
    {
44 29
        $this->assertion[] = get_defined_vars();
45 29
    }
46
}
47