Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ExpectationException.php

function ExpectationException::__toString

Returns exception message with additional context info.

Return value

string

File

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

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal