- * Assert that a given string is seen inside an element.
- *
- * @param bool|string|null $element
- * @param integer $position
- * @param string $text
- * @param bool $negate
- * @return $this
- */
- protected function seeInNthElement($element, $position, $text, $negate = false)
- {
- $method = $negate ? 'assertNotRegExp' : 'assertRegExp';
-
- $rawPattern = preg_quote($text, '/');
-
- $escapedPattern = preg_quote(e($text), '/');
-
- $content = $this->crawler->filter($element)->eq($position)->html();
-
- $pattern = $rawPattern == $escapedPattern
- ? $rawPattern : "({$rawPattern}|{$escapedPattern})";
-
- $this->$method("/$pattern/i", $content);
-
- return $this;
- }
-
- /**
- * Assert that the current page matches a given URI.
- *
- * @param string $uri
- * @return $this
- */
- protected function seePageUrlIs($uri)
- {
- $this->assertEquals(
- $uri, $this->currentUri, "Did not land on expected page [{$uri}].\n"
- );
-
- return $this;
- }
-
- /**
- * Do a forced visit that does not error out on exception.
- * @param string $uri
- * @param array $parameters
- * @param array $cookies
- * @param array $files
- * @return $this