You are here

public function ExpectationException::__toString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/src/Exception/ExpectationException.php \Behat\Mink\Exception\ExpectationException::__toString()

Returns exception message with additional context info.

Return value

string

File

vendor/behat/mink/src/Exception/ExpectationException.php, line 61

Class

ExpectationException
Exception thrown for failed expectations.

Namespace

Behat\Mink\Exception

Code

public function __toString() {
  try {
    $pageText = $this
      ->pipeString($this
      ->trimString($this
      ->getContext()) . "\n");
    $string = sprintf("%s\n\n%s%s", $this
      ->getMessage(), $this
      ->getResponseInfo(), $pageText);
  } catch (\Exception $e) {
    return $this
      ->getMessage();
  }
  return $string;
}