comparison vendor/behat/mink/src/Exception/ElementHtmlException.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 /*
4 * This file is part of the Mink package.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11 namespace Behat\Mink\Exception;
12
13 use Behat\Mink\Driver\DriverInterface;
14 use Behat\Mink\Element\Element;
15 use Behat\Mink\Session;
16
17 /**
18 * Exception thrown when an expectation on the HTML of an element fails.
19 *
20 * @author Konstantin Kudryashov <ever.zet@gmail.com>
21 */
22 class ElementHtmlException extends ExpectationException
23 {
24 /**
25 * Element instance.
26 *
27 * @var Element
28 */
29 protected $element;
30
31 /**
32 * Initializes exception.
33 *
34 * @param string $message optional message
35 * @param DriverInterface|Session $driver driver instance
36 * @param Element $element element
37 * @param \Exception $exception expectation exception
38 */
39 public function __construct($message, $driver, Element $element, \Exception $exception = null)
40 {
41 $this->element = $element;
42
43 parent::__construct($message, $driver, $exception);
44 }
45
46 protected function getContext()
47 {
48 return $this->element->getOuterHtml();
49 }
50 }