Security update for permissions_by_term
[yaffs-website] / vendor / behat / mink / src / Element / ElementInterface.php
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\Element;
12
13 use Behat\Mink\Session;
14
15 /**
16  * Element interface.
17  *
18  * @author Konstantin Kudryashov <ever.zet@gmail.com>
19  */
20 interface ElementInterface
21 {
22     /**
23      * Returns XPath for handled element.
24      *
25      * @return string
26      */
27     public function getXpath();
28
29     /**
30      * Returns element's session.
31      *
32      * @return Session
33      *
34      * @deprecated Accessing the session from the element is deprecated as of 1.6 and will be impossible in 2.0.
35      */
36     public function getSession();
37
38     /**
39      * Checks whether element with specified selector exists inside the current element.
40      *
41      * @param string       $selector selector engine name
42      * @param string|array $locator  selector locator
43      *
44      * @return Boolean
45      *
46      * @see ElementInterface::findAll for the supported selectors
47      */
48     public function has($selector, $locator);
49
50     /**
51      * Checks if an element still exists in the DOM.
52      *
53      * @return bool
54      */
55     public function isValid();
56
57     /**
58      * Waits for an element(-s) to appear and returns it.
59      *
60      * @param int|float $timeout  Maximal allowed waiting time in seconds.
61      * @param callable  $callback Callback, which result is both used as waiting condition and returned.
62      *                            Will receive reference to `this element` as first argument.
63      *
64      * @return mixed
65      *
66      * @throws \InvalidArgumentException When invalid callback given.
67      */
68     public function waitFor($timeout, $callback);
69
70     /**
71      * Finds first element with specified selector inside the current element.
72      *
73      * @param string       $selector selector engine name
74      * @param string|array $locator  selector locator
75      *
76      * @return NodeElement|null
77      *
78      * @see ElementInterface::findAll for the supported selectors
79      */
80     public function find($selector, $locator);
81
82     /**
83      * Finds all elements with specified selector inside the current element.
84      *
85      * Valid selector engines are named, xpath, css, named_partial and named_exact.
86      *
87      * 'named' is a pseudo selector engine which prefers an exact match but
88      * will return a partial match if no exact match is found.
89      * 'xpath' is a pseudo selector engine supported by SelectorsHandler.
90      *
91      * More selector engines can be registered in the SelectorsHandler.
92      *
93      * @param string       $selector selector engine name
94      * @param string|array $locator  selector locator
95      *
96      * @return NodeElement[]
97      *
98      * @see NamedSelector for the locators supported by the named selectors
99      */
100     public function findAll($selector, $locator);
101
102     /**
103      * Returns element text (inside tag).
104      *
105      * @return string
106      */
107     public function getText();
108
109     /**
110      * Returns element inner html.
111      *
112      * @return string
113      */
114     public function getHtml();
115 }