|
@@ 164-170 (lines=7) @@
|
| 161 |
|
* |
| 162 |
|
* @Then /^(?:the )?response should contain "([^"]*)"$/ |
| 163 |
|
*/ |
| 164 |
|
public function theResponseShouldContain($text): void |
| 165 |
|
{ |
| 166 |
|
$expectedRegexp = '/'.preg_quote($text).'/i'; |
| 167 |
|
$bodyResponse = (string) $this->getResponse()->getBody(); |
| 168 |
|
|
| 169 |
|
Assert::assertRegExp($expectedRegexp, $bodyResponse); |
| 170 |
|
} |
| 171 |
|
|
| 172 |
|
/** |
| 173 |
|
* Checks that response body doesn't contains specific text. |
|
@@ 179-185 (lines=7) @@
|
| 176 |
|
* |
| 177 |
|
* @Then /^(?:the )?response should not contain "([^"]*)"$/ |
| 178 |
|
*/ |
| 179 |
|
public function theResponseShouldNotContain($text): void |
| 180 |
|
{ |
| 181 |
|
$expectedRegexp = '/'.preg_quote($text).'/'; |
| 182 |
|
$bodyResponse = (string) $this->getResponse()->getBody(); |
| 183 |
|
|
| 184 |
|
Assert::assertNotRegExp($expectedRegexp, $bodyResponse); |
| 185 |
|
} |
| 186 |
|
|
| 187 |
|
/** |
| 188 |
|
* Checks that response body contains JSON from PyString. |