1 | <?php |
||
15 | trait MinkAwareTrait |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * The Mink sessions manager. |
||
20 | * |
||
21 | * @var \Behat\Mink\Mink |
||
22 | */ |
||
23 | protected $mink; |
||
24 | |||
25 | /** |
||
26 | * The parameters for the Mink extension. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $minkParameters; |
||
31 | |||
32 | /** |
||
33 | * Sets the Mink sessions manager. |
||
34 | * |
||
35 | * @param \Behat\Mink\Mink $mink |
||
36 | * The Mink sessions manager. |
||
37 | */ |
||
38 | public function setMink(Mink $mink) |
||
42 | |||
43 | /** |
||
44 | * Returns the Mink sessions manager. |
||
45 | * |
||
46 | * @return \Behat\Mink\Mink |
||
47 | * The Mink sessions manager. |
||
48 | */ |
||
49 | public function getMink() |
||
53 | |||
54 | /** |
||
55 | * Returns the Mink session. |
||
56 | * |
||
57 | * @param string|null $name |
||
58 | * The name of the session to return. If omitted the active session will |
||
59 | * be returned. |
||
60 | * |
||
61 | * @return \Behat\Mink\Session |
||
62 | * The Mink session. |
||
63 | */ |
||
64 | public function getSession($name = null) |
||
68 | |||
69 | /** |
||
70 | * Returns the parameters provided for Mink. |
||
71 | * |
||
72 | * @return array |
||
73 | */ |
||
74 | public function getMinkParameters() |
||
78 | |||
79 | /** |
||
80 | * Sets parameters provided for Mink. |
||
81 | * |
||
82 | * @param array $parameters |
||
83 | */ |
||
84 | public function setMinkParameters(array $parameters) |
||
88 | |||
89 | /** |
||
90 | * Returns a specific mink parameter. |
||
91 | * |
||
92 | * @param string $name |
||
93 | * |
||
94 | * @return mixed |
||
95 | */ |
||
96 | public function getMinkParameter($name) |
||
100 | |||
101 | /** |
||
102 | * Applies the given parameter to the Mink configuration. |
||
103 | * |
||
104 | * Consider that this will only be applied in scope of the class that is |
||
105 | * using this trait. |
||
106 | * |
||
107 | * @param string $name The key of the parameter |
||
108 | * @param string $value The value of the parameter |
||
109 | */ |
||
110 | public function setMinkParameter($name, $value) |
||
114 | |||
115 | /** |
||
116 | * Returns Mink session assertion tool. |
||
117 | * |
||
118 | * @param string|null $name |
||
119 | * The name of the session to return. If omitted the active session will |
||
120 | * be returned. |
||
121 | * |
||
122 | * @return \Behat\Mink\WebAssert |
||
123 | */ |
||
124 | public function assertSession($name = null) |
||
128 | |||
129 | /** |
||
130 | * Visits provided relative path using provided or default session. |
||
131 | * |
||
132 | * @param string $path |
||
133 | * @param string|null $sessionName |
||
134 | */ |
||
135 | public function visitPath($path, $sessionName = null) |
||
139 | |||
140 | /** |
||
141 | * Locates url, based on provided path. |
||
142 | * Override to provide custom routing mechanism. |
||
143 | * |
||
144 | * @param string $path |
||
145 | * |
||
146 | * @return string |
||
147 | */ |
||
148 | public function locatePath($path) |
||
154 | |||
155 | /** |
||
156 | * Save a screenshot of the current window to the file system. |
||
157 | * |
||
158 | * @param string $filename |
||
159 | * Desired filename, defaults to <browser>_<ISO 8601 date>_<randomId>.png. |
||
160 | * @param string $filepath |
||
161 | * Desired filepath, defaults to upload_tmp_dir, falls back to |
||
162 | * sys_get_temp_dir(). |
||
163 | */ |
||
164 | public function saveScreenshot($filename = null, $filepath = null) |
||
172 | } |
||
173 |