public function pageTextMatchesCount(int
$count, string
$regex, string
$message = ''
): void
{ $actual =
preg_replace('/\s+/u', ' ',
$this->session->
getPage()->
getText());
$matches =
preg_match_all($regex,
$actual);
if ($message === ''
) { $message = "Failed asserting that the page matches the pattern '
$regex'
$count time(s),
$matches found.";
} $constraint =
new IsIdentical($count);
Assert::
assertThat($matches,
$constraint,
$message);
} /**
* Checks that specific button exists on the current page.
*
* @param string $button
* One of id|name|label|value for the button.
* @param \Behat\Mink\Element\TraversableElement $container
* (optional) The document to check against. Defaults to the current page.
*
* @return \Behat\Mink\Element\NodeElement
* The matching element.
*
* @throws \Behat\Mink\Exception\ElementNotFoundException
* When the element doesn't exist.
*/