1 | <?php |
||
10 | class Configuration |
||
11 | { |
||
12 | /** |
||
13 | * @var boolean |
||
14 | */ |
||
15 | protected $colorsEnabled = true; |
||
16 | |||
17 | /** |
||
18 | * @var boolean |
||
19 | */ |
||
20 | protected $colorsEnableExplicit = false; |
||
21 | |||
22 | /** |
||
23 | * @var string|null |
||
24 | */ |
||
25 | protected $focusPattern; |
||
26 | |||
27 | /** |
||
28 | * @var string|null |
||
29 | */ |
||
30 | protected $skipPattern; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $grep = '*.spec.php'; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $reporter = 'spec'; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $path; |
||
46 | |||
47 | /** |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $paths; |
||
51 | |||
52 | /** |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $configurationFile; |
||
56 | |||
57 | /** |
||
58 | * @var string |
||
59 | */ |
||
60 | protected $dsl; |
||
61 | |||
62 | /** |
||
63 | * @var bool |
||
64 | */ |
||
65 | protected $stopOnFailure = false; |
||
66 | |||
67 | public function __construct() |
||
74 | |||
75 | /** |
||
76 | * Set the pattern used to load tests |
||
77 | * |
||
78 | * @param string $grep |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function setGrep($grep) |
||
85 | |||
86 | /** |
||
87 | * Returns the pattern used to load tests |
||
88 | * |
||
89 | * @return string |
||
90 | */ |
||
91 | public function getGrep() |
||
95 | |||
96 | /** |
||
97 | * Set the pattern used to focus tests |
||
98 | * |
||
99 | * @param string|null $pattern |
||
100 | * @return $this |
||
101 | */ |
||
102 | public function setFocusPattern($pattern) |
||
106 | |||
107 | /** |
||
108 | * Returns the pattern used to focus tests |
||
109 | * |
||
110 | * @return string|null |
||
111 | */ |
||
112 | public function getFocusPattern() |
||
116 | |||
117 | /** |
||
118 | * Set the pattern used to skip tests |
||
119 | * |
||
120 | * @param string|null $pattern |
||
121 | * @return $this |
||
122 | */ |
||
123 | public function setSkipPattern($pattern) |
||
127 | |||
128 | /** |
||
129 | * Returns the pattern used to skip tests |
||
130 | * |
||
131 | * @return string|null |
||
132 | */ |
||
133 | public function getSkipPattern() |
||
137 | |||
138 | /** |
||
139 | * Set the name of the reporter to use |
||
140 | * |
||
141 | * @param string $reporter |
||
142 | * @return $this |
||
143 | */ |
||
144 | public function setReporter($reporter) |
||
148 | |||
149 | /** |
||
150 | * Return the name of the reporter configured for use |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | public function getReporter() |
||
158 | |||
159 | /** |
||
160 | * Set the path to load tests from |
||
161 | * |
||
162 | * @param string $path |
||
163 | * @return $this |
||
164 | */ |
||
165 | public function setPath($path) |
||
169 | |||
170 | /** |
||
171 | * Return the path being searched for tests |
||
172 | * |
||
173 | * @return string |
||
174 | */ |
||
175 | public function getPath() |
||
179 | |||
180 | /** |
||
181 | * Set the paths to load tests from |
||
182 | * |
||
183 | * @param array $paths |
||
184 | * @return $this |
||
185 | */ |
||
186 | public function setPaths(array $paths) |
||
194 | |||
195 | /** |
||
196 | * Return the paths being searched for tests |
||
197 | * |
||
198 | * @return array |
||
199 | */ |
||
200 | public function getPaths() |
||
204 | |||
205 | /** |
||
206 | * Disable output colors |
||
207 | * |
||
208 | * @return $this |
||
209 | */ |
||
210 | public function disableColors() |
||
218 | |||
219 | /** |
||
220 | * Force output colors even without TTY support. |
||
221 | * |
||
222 | * @return $this |
||
223 | */ |
||
224 | public function enableColorsExplicit() |
||
230 | |||
231 | /** |
||
232 | * Check if output colors are disabled |
||
233 | * |
||
234 | * @return boolean |
||
235 | */ |
||
236 | public function areColorsEnabled() |
||
240 | |||
241 | /** |
||
242 | * Check if output colors are explicitly enabled. |
||
243 | * |
||
244 | * @return boolean |
||
245 | */ |
||
246 | public function areColorsEnabledExplicit() |
||
250 | |||
251 | /** |
||
252 | * Stop the suite runner when a failure occurs |
||
253 | * |
||
254 | * @return $this |
||
255 | */ |
||
256 | public function stopOnFailure() |
||
260 | |||
261 | /** |
||
262 | * Check if the suite runner should stop on failure |
||
263 | * |
||
264 | * @return bool |
||
265 | */ |
||
266 | public function shouldStopOnFailure() |
||
270 | |||
271 | /** |
||
272 | * Set the path to a Peridot configuration file |
||
273 | * |
||
274 | * @param string $configurationFile |
||
275 | * @return $this |
||
276 | */ |
||
277 | public function setConfigurationFile($configurationFile) |
||
290 | |||
291 | /** |
||
292 | * Return the path to the Peridot configuration file. Returns a relative |
||
293 | * path if it exists, otherwise return the provided value |
||
294 | * |
||
295 | * @return string |
||
296 | */ |
||
297 | public function getConfigurationFile() |
||
301 | |||
302 | /** |
||
303 | * Set the path to a DSL file for defining |
||
304 | * the test language used |
||
305 | * |
||
306 | * @param string $dsl |
||
307 | * @return $this |
||
308 | */ |
||
309 | public function setDsl($dsl) |
||
313 | |||
314 | /** |
||
315 | * Get the path to a DSL file containing |
||
316 | * test functions to use |
||
317 | * |
||
318 | * @return string |
||
319 | */ |
||
320 | public function getDsl() |
||
324 | |||
325 | /** |
||
326 | * Write a configuration value and persist it to the current |
||
327 | * environment. |
||
328 | * |
||
329 | * @param string $varName |
||
330 | * @param string $value |
||
331 | * @return $this |
||
332 | */ |
||
333 | protected function write($varName, $value) |
||
341 | |||
342 | /** |
||
343 | * Write the paths and persist them to the current environment. |
||
344 | * |
||
345 | * @param array $paths |
||
346 | * @return $this |
||
347 | */ |
||
348 | protected function writePaths(array $paths) |
||
355 | |||
356 | /** |
||
357 | * Normalize the supplied regular expression pattern. |
||
358 | * |
||
359 | * @param string $pattern |
||
360 | * @return string |
||
361 | */ |
||
362 | protected function normalizeRegexPattern($pattern) |
||
376 | } |
||
377 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: