/** * Checks, that page doesn't contain text matching specified pattern. * * @Then /^(?:|I )should not see text matching (?P<pattern>"(?:[^"]|\\")*")$/ */ public function assertPageNotMatchesText($pattern) { $actual = $this->getSession()->getPage()->getText(); try { assertNotRegExp($pattern, $actual); } catch (AssertException $e) { $message = sprintf('The pattern %s was found in the text of the current page, but it should not.', $pattern); throw new ResponseTextException($message, $this->getSession(), $e); } }
public function unlike($exp, $regex, $message = '') { assertNotRegExp($regex, $exp); }
/** * Checks that response body doesn't contains specific text. * * @param string $text * * @Then /^(?:the )?response should not contain "([^"]*)"$/ */ public function theResponseShouldNotContain($text) { assertNotRegExp('/' . preg_quote($text) . '/', $this->browser->getLastResponse()->getContent()); }
/** * @Then Assert the value :arg1 does not match a given regex :arg2. * * @param $string * @param $pattern */ public function assertNotRegExp($string, $pattern) { assertNotRegExp($pattern, $string, sprintf("Assert the value [%s] does not match a given regex [%s]", $string, $pattern)); }