X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fbehat%2Fmink%2Fsrc%2FException%2FElementNotFoundException.php;fp=vendor%2Fbehat%2Fmink%2Fsrc%2FException%2FElementNotFoundException.php;h=6716ab3ff70b252614f01cfadaa434707806e0b2;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/vendor/behat/mink/src/Exception/ElementNotFoundException.php b/vendor/behat/mink/src/Exception/ElementNotFoundException.php new file mode 100644 index 000000000..6716ab3ff --- /dev/null +++ b/vendor/behat/mink/src/Exception/ElementNotFoundException.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Behat\Mink\Exception; + +use Behat\Mink\Driver\DriverInterface; +use Behat\Mink\Session; + +/** + * Exception thrown when an expected element is not found. + * + * @author Konstantin Kudryashov + */ +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); + } +}