ResponseTextException example


  public function pageTextContainsOnce($text) {
    $regex = '/' . preg_quote($text, '/') . '/ui';
    try {
      $this->pageTextMatchesCount(1, $regex);
    }
    catch (AssertionFailedError $e) {
      throw new ResponseTextException($e->getMessage()$this->session->getDriver());
    }
  }

  /** * Asserts that each HTML ID is used for just a single element on the page. * * @throws \Behat\Mink\Exception\ExpectationException */
  public function pageContainsNoDuplicateId() {
    $seen_ids = [];
    foreach ($this->session->getPage()->findAll('xpath', '//*[@id]') as $element) {
      
Home | Imprint | This part of the site doesn't use cookies.