Total Complexity | 13 |
Total Lines | 71 |
Duplicated Lines | 0 % |
Coverage | 96.97% |
Changes | 0 |
1 | <?php |
||
5 | class CheckExpectations |
||
6 | { |
||
7 | private $chain; |
||
8 | |||
9 | private $phpunit; |
||
10 | |||
11 | /** |
||
12 | * CheckExpectations constructor. |
||
13 | * |
||
14 | * @param $chain |
||
15 | * @param $phpunit |
||
16 | */ |
||
17 | 38 | public function __construct(Chain $chain, $phpunit) |
|
21 | 38 | } |
|
22 | |||
23 | 38 | public function check() |
|
28 | 37 | } |
|
29 | |||
30 | 37 | private function checkResponse() |
|
36 | 37 | } |
|
37 | |||
38 | /** |
||
39 | * @return mixed |
||
40 | */ |
||
41 | 37 | private function sendRequest() |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * @param $response |
||
56 | */ |
||
57 | 37 | private function checkResponses($response) |
|
58 | { |
||
59 | 37 | foreach ($this->chain->assertion as $assertion) { |
|
60 | 29 | $type = $assertion['type']; |
|
61 | 29 | $response->$type($assertion['value']); |
|
62 | } |
||
63 | 37 | } |
|
64 | |||
65 | 38 | private function fireEvents() |
|
66 | { |
||
67 | 38 | if ($this->chain->event) { |
|
68 | 1 | event($this->chain->event); |
|
69 | } |
||
70 | 37 | } |
|
71 | |||
72 | 38 | private function expectExceptions() |
|
76 | } |
||
77 | 38 | } |
|
78 | } |
||
79 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.