Total Complexity | 3 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
8 | trait RegexTrait |
||
9 | { |
||
10 | abstract protected function getValue(?string $path); |
||
11 | |||
12 | /** @Then in the json, :path should match :pattern */ |
||
13 | final public function the_json_path_should_match(string $path, string $pattern): void |
||
14 | { |
||
15 | Assert::regex($this->getValue($path), $pattern); |
||
16 | } |
||
17 | |||
18 | /** |
||
19 | * @Then in the json, :path should not match :pattern |
||
20 | * |
||
21 | * ----- |
||
22 | * |
||
23 | * Note :: The body of this assertion should be replaced by a |
||
24 | * `Assert::notRegex` as soon as the Assert's PR |
||
25 | * https://github.com/webmozart/assert/pull/58 is merged and released. |
||
26 | */ |
||
27 | final public function the_json_path_should_not_match(string $path, string $pattern): void |
||
35 | } |
||
36 | } |
||
37 |