1 | <?php |
||
8 | abstract class TestCase extends \PHPUnit\Framework\TestCase { |
||
9 | |||
10 | /** |
||
11 | * Holds drivers fixtures |
||
12 | * @var array |
||
13 | */ |
||
14 | protected static $_drivers = array(); |
||
15 | |||
16 | /** |
||
17 | * Current Driver for this testcase |
||
18 | * @var Openbuildings\Spiderling\Driver |
||
19 | */ |
||
20 | protected $_driver; |
||
21 | |||
22 | /** |
||
23 | * The type of the spiderling driver (kohana, selenium ...) |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $_driver_type; |
||
27 | |||
28 | /** |
||
29 | * The Environment object making sure you can set env variables and restore them after the test |
||
30 | * @var Openbuildings\EnvironmentBackup\Environment |
||
31 | */ |
||
32 | protected $_environment; |
||
33 | |||
34 | /** |
||
35 | * Restore environment and clear the specific driver if its active |
||
36 | */ |
||
37 | public function tearDown() |
||
51 | |||
52 | /** |
||
53 | * Return the current driver. This will use driver_simple, driver_kohana ... methods |
||
54 | * You can override them yourself in order to have custom configs |
||
55 | * |
||
56 | * Drivers are cached as fixtured for the whole testrun and is shared between tests. |
||
57 | * @return Openbuildings\Spiderling\Driver |
||
58 | */ |
||
59 | public function driver() |
||
102 | |||
103 | /** |
||
104 | * Return Openbuildings\Spiderling\Driver_Simple |
||
105 | * override this to configure |
||
106 | * |
||
107 | * @return Openbuildings\Spiderling\Driver_Simple |
||
108 | */ |
||
109 | public function driver_simple() |
||
113 | |||
114 | /** |
||
115 | * Return Openbuildings\Spiderling\Driver_SimpleXML |
||
116 | * override this to configure |
||
117 | * |
||
118 | * @return Openbuildings\Spiderling\Driver_SimpleXML |
||
119 | */ |
||
120 | public function driver_simple_xml() |
||
124 | |||
125 | /** |
||
126 | * Return Openbuildings\Spiderling\Driver_Kohana |
||
127 | * override this to configure |
||
128 | * |
||
129 | * @return Openbuildings\Spiderling\Driver_Kohana |
||
130 | */ |
||
131 | public function driver_kohana() |
||
135 | |||
136 | /** |
||
137 | * Return Openbuildings\Spiderling\Driver_Selenium |
||
138 | * override this to configure |
||
139 | * |
||
140 | * @return Openbuildings\Spiderling\Driver_Selenium |
||
141 | */ |
||
142 | public function driver_selenium() |
||
146 | |||
147 | /** |
||
148 | * Return Openbuildings\Spiderling\Driver_Phantomjs |
||
149 | * override this to configure |
||
150 | * |
||
151 | * @return Openbuildings\Spiderling\Driver_Phantomjs |
||
152 | */ |
||
153 | public function driver_phantomjs() |
||
157 | |||
158 | /** |
||
159 | * Get the type of the driver for the current test. |
||
160 | * Use annotations to change the driver type e.g. @driver selenium |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | public function driver_type() |
||
175 | |||
176 | /** |
||
177 | * return the environment object that handles setting / restoring env variables |
||
178 | * @return Openbuildings\EnvrionmentBackup\Envrionment |
||
179 | */ |
||
180 | public function environment() |
||
192 | |||
193 | /** |
||
194 | * Return true if the driver has been invoked in some way |
||
195 | * @return boolean |
||
196 | */ |
||
197 | public function is_driver_active() |
||
201 | |||
202 | /** |
||
203 | * Return true if the environment has been modified / accessed |
||
204 | * @return boolean |
||
205 | */ |
||
206 | public function is_environment_active() |
||
210 | |||
211 | /** |
||
212 | * Return the root node of the current page, opened by the driver |
||
213 | * Extend it with custom assertions from Assert |
||
214 | * @return Openbuildings\Spiderling\Page |
||
215 | */ |
||
216 | public function page() |
||
223 | |||
224 | /** |
||
225 | * All other methods are handled by the root node of the page |
||
226 | * @param string $method |
||
227 | * @param array $args |
||
228 | * @return mixed |
||
229 | */ |
||
230 | public function __call($method, $args) |
||
234 | } |
||
235 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..