Total Complexity | 2 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | trait AssertArrayValues |
||
6 | { |
||
7 | // todo: add tests |
||
8 | |||
9 | /** |
||
10 | * Assert that an array has a value. |
||
11 | * |
||
12 | * @param $needle |
||
13 | * @param array $haystack |
||
14 | */ |
||
15 | public function assertArrayHasValue($needle, array $haystack) |
||
16 | { |
||
17 | $this->assertTrue( |
||
|
|||
18 | in_array($needle, array_values($haystack)), |
||
19 | "Could not find '{$needle}' in the array ".json_encode($haystack)); |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * Assert that an array does not have a value. |
||
24 | * |
||
25 | * @param $needle |
||
26 | * @param array $haystack |
||
27 | */ |
||
28 | public function assertArrayNotHasValue($needle, array $haystack) |
||
33 | } |
||
34 | } |
||
35 |