class ElementHtmlException
Exception thrown when an expectation on the HTML of an element fails.
@author Konstantin Kudryashov <ever.zet@gmail.com>
Hierarchy
- class \Behat\Mink\Exception\Exception extends \Behat\Mink\Exception\Exception
- class \Behat\Mink\Exception\Exception extends \Behat\Mink\Exception\Exception
- class \Behat\Mink\Exception\ExpectationException extends \Behat\Mink\Exception\Exception
- class \Behat\Mink\Exception\ElementHtmlException extends \Behat\Mink\Exception\ExpectationException
- class \Behat\Mink\Exception\ExpectationException extends \Behat\Mink\Exception\Exception
- class \Behat\Mink\Exception\Exception extends \Behat\Mink\Exception\Exception
Expanded class hierarchy of ElementHtmlException
1 file declares its use of ElementHtmlException
- WebAssert.php in vendor/
behat/ mink/ src/ WebAssert.php
File
-
vendor/
behat/ mink/ src/ Exception/ ElementHtmlException.php, line 22
Namespace
Behat\Mink\ExceptionView source
class ElementHtmlException extends ExpectationException {
/**
* Element instance.
*
* @var Element
*/
protected $element;
/**
* Initializes exception.
*
* @param string $message optional message
* @param DriverInterface|Session $driver driver instance
* @param Element $element element
* @param \Throwable|null $exception expectation exception
*/
public function __construct(string $message, $driver, Element $element, ?\Throwable $exception = null) {
$this->element = $element;
parent::__construct($message, $driver, $exception);
}
protected function getContext() {
return $this->element
->getOuterHtml();
}
}
Members
Title Sort descending | Deprecated | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|---|
ElementHtmlException::$element | protected | property | Element instance. | |||
ElementHtmlException::getContext | protected | function | Gets the context rendered for this exception. | Overrides ExpectationException::getContext | 1 | |
ElementHtmlException::__construct | public | function | Initializes exception. | Overrides ExpectationException::__construct | ||
ExpectationException::$driver | private | property | ||||
ExpectationException::$session | private | property | ||||
ExpectationException::getDriver | protected | function | Returns driver. | |||
ExpectationException::getResponseInfo | protected | function | Returns response information string. | |||
ExpectationException::getSession | Deprecated | protected | function | Returns exception session. | ||
ExpectationException::pipeString | protected | function | Prepends every line in a string with pipe (|). | |||
ExpectationException::trimBody | protected | function | Removes response header/footer, letting only <body /> content. | |||
ExpectationException::trimString | protected | function | Trims string to specified number of chars. | |||
ExpectationException::__toString | public | function | Returns exception message with additional context info. |