You are here

protected function ExpectationException::getResponseInfo 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::getResponseInfo()

Returns response information string.

Return value

string

1 call to ExpectationException::getResponseInfo()
ExpectationException::__toString in vendor/behat/mink/src/Exception/ExpectationException.php
Returns exception message with additional context info.

File

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

Class

ExpectationException
Exception thrown for failed expectations.

Namespace

Behat\Mink\Exception

Code

protected function getResponseInfo() {
  $driver = basename(str_replace('\\', '/', get_class($this->driver)));
  $info = '+--[ ';
  try {
    $info .= 'HTTP/1.1 ' . $this->driver
      ->getStatusCode() . ' | ';
  } catch (UnsupportedDriverActionException $e) {

    // Ignore the status code when not supported
  }
  $info .= $this->driver
    ->getCurrentUrl() . ' | ' . $driver . " ]\n|\n";
  return $info;
}