class ElementNotFoundException in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/behat/mink/src/Exception/ElementNotFoundException.php \Behat\Mink\Exception\ElementNotFoundException
Exception thrown when an expected element is not found.
@author Konstantin Kudryashov <ever.zet@gmail.com>
Hierarchy
- class \Behat\Mink\Exception\Exception
- class \Behat\Mink\Exception\Exception
- class \Behat\Mink\Exception\ExpectationException
- class \Behat\Mink\Exception\ElementNotFoundException
- class \Behat\Mink\Exception\ExpectationException
- class \Behat\Mink\Exception\Exception
Expanded class hierarchy of ElementNotFoundException
6 files declare their use of ElementNotFoundException
- Element.php in vendor/
behat/ mink/ src/ Element/ Element.php - ElementNotFoundExceptionTest.php in vendor/
behat/ mink/ tests/ Exception/ ElementNotFoundExceptionTest.php - NodeElement.php in vendor/
behat/ mink/ src/ Element/ NodeElement.php - TraversableElement.php in vendor/
behat/ mink/ src/ Element/ TraversableElement.php - WebAssert.php in vendor/
behat/ mink/ src/ WebAssert.php
File
- vendor/
behat/ mink/ src/ Exception/ ElementNotFoundException.php, line 21
Namespace
Behat\Mink\ExceptionView source
class ElementNotFoundException extends ExpectationException {
/**
* Initializes exception.
*
* @param DriverInterface|Session $driver driver instance
* @param string $type element type
* @param string $selector element selector type
* @param string $locator element locator
*/
public function __construct($driver, $type = null, $selector = null, $locator = null) {
$message = '';
if (null !== $type) {
$message .= ucfirst($type);
}
else {
$message .= 'Tag';
}
if (null !== $locator) {
if (null === $selector || in_array($selector, array(
'css',
'xpath',
))) {
$selector = 'matching ' . ($selector ?: 'locator');
}
else {
$selector = 'with ' . $selector;
}
$message .= ' ' . $selector . ' "' . $locator . '"';
}
$message .= ' not found.';
parent::__construct($message, $driver);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ElementNotFoundException:: |
public | function |
Initializes exception. Overrides ExpectationException:: |
|
ExpectationException:: |
private | property | ||
ExpectationException:: |
private | property | ||
ExpectationException:: |
protected | function | Gets the context rendered for this exception. | 2 |
ExpectationException:: |
protected | function | Returns driver. | |
ExpectationException:: |
protected | function | Returns response information string. | |
ExpectationException:: |
protected | function | Returns exception session. | |
ExpectationException:: |
protected | function | Prepends every line in a string with pipe (|). | |
ExpectationException:: |
protected | function | Removes response header/footer, letting only <body /> content. | |
ExpectationException:: |
protected | function | Trims string to specified number of chars. | |
ExpectationException:: |
public | function | Returns exception message with additional context info. |