Total Complexity | 3 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
6 | trait CountTrait |
||
7 | { |
||
8 | abstract protected function getValue(?string $path); |
||
9 | |||
10 | /** |
||
11 | * @Then in the json, the root collection should have at least :count element(s) |
||
12 | * @Then in the json, :path collection should have at least :count element(s) |
||
13 | */ |
||
14 | final public function the_json_collection_should_have_at_least_elements(?string $path = null, int $count): void |
||
19 | ; |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @Then in the json, the root collection should have :count element(s) |
||
24 | * @Then in the json, :path collection should have :count element(s) |
||
25 | */ |
||
26 | final public function the_json_path_should_have_elements(?string $path = null, int $count): void |
||
27 | { |
||
28 | Assert::that($this->getValue($path)) |
||
29 | ->isCountable() |
||
30 | ->count($count) |
||
31 | ; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @Then in the json, the root collection should have at most :count element(s) |
||
36 | * @Then in the json, :path collection should have at most :count element(s) |
||
37 | */ |
||
38 | final public function the_json_path_should_have_at_most_elements(?string $path = null, int $count): void |
||
43 | ; |
||
44 | } |
||
46 |