1 | <?php //[STAMP] 9ad924d28182d5b9b12e8a90964178dd |
||
11 | trait UnitTesterActions |
||
12 | { |
||
13 | /** |
||
14 | * @return \Codeception\Scenario |
||
15 | */ |
||
16 | abstract protected function getScenario(); |
||
17 | |||
18 | |||
19 | /** |
||
20 | * [!] Method is generated. Documentation taken from corresponding module. |
||
21 | * |
||
22 | * Checks that two variables are equal. |
||
23 | * |
||
24 | * @param $expected |
||
25 | * @param $actual |
||
26 | * @param string $message |
||
27 | * @see \Codeception\Module\Asserts::assertEquals() |
||
28 | */ |
||
29 | public function assertEquals($expected, $actual, $message = null) { |
||
32 | |||
33 | |||
34 | /** |
||
35 | * [!] Method is generated. Documentation taken from corresponding module. |
||
36 | * |
||
37 | * Checks that two variables are not equal |
||
38 | * |
||
39 | * @param $expected |
||
40 | * @param $actual |
||
41 | * @param string $message |
||
42 | * @see \Codeception\Module\Asserts::assertNotEquals() |
||
43 | */ |
||
44 | public function assertNotEquals($expected, $actual, $message = null) { |
||
47 | |||
48 | |||
49 | /** |
||
50 | * [!] Method is generated. Documentation taken from corresponding module. |
||
51 | * |
||
52 | * Checks that two variables are same |
||
53 | * |
||
54 | * @param $expected |
||
55 | * @param $actual |
||
56 | * @param string $message |
||
57 | * @return mixed|void |
||
58 | * @see \Codeception\Module\Asserts::assertSame() |
||
59 | */ |
||
60 | public function assertSame($expected, $actual, $message = null) { |
||
63 | |||
64 | |||
65 | /** |
||
66 | * [!] Method is generated. Documentation taken from corresponding module. |
||
67 | * |
||
68 | * Checks that two variables are not same |
||
69 | * |
||
70 | * @param $expected |
||
71 | * @param $actual |
||
72 | * @param string $message |
||
73 | * @see \Codeception\Module\Asserts::assertNotSame() |
||
74 | */ |
||
75 | public function assertNotSame($expected, $actual, $message = null) { |
||
78 | |||
79 | |||
80 | /** |
||
81 | * [!] Method is generated. Documentation taken from corresponding module. |
||
82 | * |
||
83 | * Checks that actual is greater than expected |
||
84 | * |
||
85 | * @param $expected |
||
86 | * @param $actual |
||
87 | * @param string $message |
||
88 | * @see \Codeception\Module\Asserts::assertGreaterThan() |
||
89 | */ |
||
90 | public function assertGreaterThan($expected, $actual, $message = null) { |
||
93 | |||
94 | |||
95 | /** |
||
96 | * [!] Method is generated. Documentation taken from corresponding module. |
||
97 | * |
||
98 | * @deprecated |
||
99 | * @see \Codeception\Module\Asserts::assertGreaterThen() |
||
100 | */ |
||
101 | public function assertGreaterThen($expected, $actual, $message = null) { |
||
104 | |||
105 | |||
106 | /** |
||
107 | * [!] Method is generated. Documentation taken from corresponding module. |
||
108 | * |
||
109 | * Checks that actual is greater or equal than expected |
||
110 | * |
||
111 | * @param $expected |
||
112 | * @param $actual |
||
113 | * @param string $message |
||
114 | * @see \Codeception\Module\Asserts::assertGreaterThanOrEqual() |
||
115 | */ |
||
116 | public function assertGreaterThanOrEqual($expected, $actual, $message = null) { |
||
119 | |||
120 | |||
121 | /** |
||
122 | * [!] Method is generated. Documentation taken from corresponding module. |
||
123 | * |
||
124 | * @deprecated |
||
125 | * @see \Codeception\Module\Asserts::assertGreaterThenOrEqual() |
||
126 | */ |
||
127 | public function assertGreaterThenOrEqual($expected, $actual, $message = null) { |
||
130 | |||
131 | |||
132 | /** |
||
133 | * [!] Method is generated. Documentation taken from corresponding module. |
||
134 | * |
||
135 | * Checks that actual is less than expected |
||
136 | * |
||
137 | * @param $expected |
||
138 | * @param $actual |
||
139 | * @param string $message |
||
140 | * @see \Codeception\Module\Asserts::assertLessThan() |
||
141 | */ |
||
142 | public function assertLessThan($expected, $actual, $message = null) { |
||
145 | |||
146 | |||
147 | /** |
||
148 | * [!] Method is generated. Documentation taken from corresponding module. |
||
149 | * |
||
150 | * Checks that actual is less or equal than expected |
||
151 | * |
||
152 | * @param $expected |
||
153 | * @param $actual |
||
154 | * @param string $message |
||
155 | * @see \Codeception\Module\Asserts::assertLessThanOrEqual() |
||
156 | */ |
||
157 | public function assertLessThanOrEqual($expected, $actual, $message = null) { |
||
160 | |||
161 | |||
162 | /** |
||
163 | * [!] Method is generated. Documentation taken from corresponding module. |
||
164 | * |
||
165 | * Checks that haystack contains needle |
||
166 | * |
||
167 | * @param $needle |
||
168 | * @param $haystack |
||
169 | * @param string $message |
||
170 | * @see \Codeception\Module\Asserts::assertContains() |
||
171 | */ |
||
172 | public function assertContains($needle, $haystack, $message = null) { |
||
175 | |||
176 | |||
177 | /** |
||
178 | * [!] Method is generated. Documentation taken from corresponding module. |
||
179 | * |
||
180 | * Checks that haystack doesn't contain needle. |
||
181 | * |
||
182 | * @param $needle |
||
183 | * @param $haystack |
||
184 | * @param string $message |
||
185 | * @see \Codeception\Module\Asserts::assertNotContains() |
||
186 | */ |
||
187 | public function assertNotContains($needle, $haystack, $message = null) { |
||
190 | |||
191 | |||
192 | /** |
||
193 | * [!] Method is generated. Documentation taken from corresponding module. |
||
194 | * |
||
195 | * Checks that string match with pattern |
||
196 | * |
||
197 | * @param string $pattern |
||
198 | * @param string $string |
||
199 | * @param string $message |
||
200 | * @see \Codeception\Module\Asserts::assertRegExp() |
||
201 | */ |
||
202 | public function assertRegExp($pattern, $string, $message = null) { |
||
205 | |||
206 | |||
207 | /** |
||
208 | * [!] Method is generated. Documentation taken from corresponding module. |
||
209 | * |
||
210 | * Checks that string not match with pattern |
||
211 | * |
||
212 | * @param string $pattern |
||
213 | * @param string $string |
||
214 | * @param string $message |
||
215 | * @see \Codeception\Module\Asserts::assertNotRegExp() |
||
216 | */ |
||
217 | public function assertNotRegExp($pattern, $string, $message = null) { |
||
220 | |||
221 | |||
222 | /** |
||
223 | * [!] Method is generated. Documentation taken from corresponding module. |
||
224 | * |
||
225 | * Checks that variable is empty. |
||
226 | * |
||
227 | * @param $actual |
||
228 | * @param string $message |
||
229 | * @see \Codeception\Module\Asserts::assertEmpty() |
||
230 | */ |
||
231 | public function assertEmpty($actual, $message = null) { |
||
234 | |||
235 | |||
236 | /** |
||
237 | * [!] Method is generated. Documentation taken from corresponding module. |
||
238 | * |
||
239 | * Checks that variable is not empty. |
||
240 | * |
||
241 | * @param $actual |
||
242 | * @param string $message |
||
243 | * @see \Codeception\Module\Asserts::assertNotEmpty() |
||
244 | */ |
||
245 | public function assertNotEmpty($actual, $message = null) { |
||
248 | |||
249 | |||
250 | /** |
||
251 | * [!] Method is generated. Documentation taken from corresponding module. |
||
252 | * |
||
253 | * Checks that variable is NULL |
||
254 | * |
||
255 | * @param $actual |
||
256 | * @param string $message |
||
257 | * @see \Codeception\Module\Asserts::assertNull() |
||
258 | */ |
||
259 | public function assertNull($actual, $message = null) { |
||
262 | |||
263 | |||
264 | /** |
||
265 | * [!] Method is generated. Documentation taken from corresponding module. |
||
266 | * |
||
267 | * Checks that variable is not NULL |
||
268 | * |
||
269 | * @param $actual |
||
270 | * @param string $message |
||
271 | * @see \Codeception\Module\Asserts::assertNotNull() |
||
272 | */ |
||
273 | public function assertNotNull($actual, $message = null) { |
||
276 | |||
277 | |||
278 | /** |
||
279 | * [!] Method is generated. Documentation taken from corresponding module. |
||
280 | * |
||
281 | * Checks that condition is positive. |
||
282 | * |
||
283 | * @param $condition |
||
284 | * @param string $message |
||
285 | * @see \Codeception\Module\Asserts::assertTrue() |
||
286 | */ |
||
287 | public function assertTrue($condition, $message = null) { |
||
290 | |||
291 | |||
292 | /** |
||
293 | * [!] Method is generated. Documentation taken from corresponding module. |
||
294 | * |
||
295 | * Checks that condition is negative. |
||
296 | * |
||
297 | * @param $condition |
||
298 | * @param string $message |
||
299 | * @see \Codeception\Module\Asserts::assertFalse() |
||
300 | */ |
||
301 | public function assertFalse($condition, $message = null) { |
||
304 | |||
305 | |||
306 | /** |
||
307 | * [!] Method is generated. Documentation taken from corresponding module. |
||
308 | * |
||
309 | * Checks if file exists |
||
310 | * |
||
311 | * @param string $filename |
||
312 | * @param string $message |
||
313 | * @see \Codeception\Module\Asserts::assertFileExists() |
||
314 | */ |
||
315 | public function assertFileExists($filename, $message = null) { |
||
318 | |||
319 | |||
320 | /** |
||
321 | * [!] Method is generated. Documentation taken from corresponding module. |
||
322 | * |
||
323 | * Checks if file doesn't exist |
||
324 | * |
||
325 | * @param string $filename |
||
326 | * @param string $message |
||
327 | * @see \Codeception\Module\Asserts::assertFileNotExists() |
||
328 | */ |
||
329 | public function assertFileNotExists($filename, $message = null) { |
||
332 | |||
333 | |||
334 | /** |
||
335 | * [!] Method is generated. Documentation taken from corresponding module. |
||
336 | * |
||
337 | * @param $expected |
||
338 | * @param $actual |
||
339 | * @param $description |
||
340 | * @see \Codeception\Module\Asserts::assertGreaterOrEquals() |
||
341 | */ |
||
342 | public function assertGreaterOrEquals($expected, $actual, $description = null) { |
||
345 | |||
346 | |||
347 | /** |
||
348 | * [!] Method is generated. Documentation taken from corresponding module. |
||
349 | * |
||
350 | * @param $expected |
||
351 | * @param $actual |
||
352 | * @param $description |
||
353 | * @see \Codeception\Module\Asserts::assertLessOrEquals() |
||
354 | */ |
||
355 | public function assertLessOrEquals($expected, $actual, $description = null) { |
||
358 | |||
359 | |||
360 | /** |
||
361 | * [!] Method is generated. Documentation taken from corresponding module. |
||
362 | * |
||
363 | * @param $actual |
||
364 | * @param $description |
||
365 | * @see \Codeception\Module\Asserts::assertIsEmpty() |
||
366 | */ |
||
367 | public function assertIsEmpty($actual, $description = null) { |
||
370 | |||
371 | |||
372 | /** |
||
373 | * [!] Method is generated. Documentation taken from corresponding module. |
||
374 | * |
||
375 | * @param $key |
||
376 | * @param $actual |
||
377 | * @param $description |
||
378 | * @see \Codeception\Module\Asserts::assertArrayHasKey() |
||
379 | */ |
||
380 | public function assertArrayHasKey($key, $actual, $description = null) { |
||
383 | |||
384 | |||
385 | /** |
||
386 | * [!] Method is generated. Documentation taken from corresponding module. |
||
387 | * |
||
388 | * @param $key |
||
389 | * @param $actual |
||
390 | * @param $description |
||
391 | * @see \Codeception\Module\Asserts::assertArrayNotHasKey() |
||
392 | */ |
||
393 | public function assertArrayNotHasKey($key, $actual, $description = null) { |
||
396 | |||
397 | |||
398 | /** |
||
399 | * [!] Method is generated. Documentation taken from corresponding module. |
||
400 | * |
||
401 | * @param $class |
||
402 | * @param $actual |
||
403 | * @param $description |
||
404 | * @see \Codeception\Module\Asserts::assertInstanceOf() |
||
405 | */ |
||
406 | public function assertInstanceOf($class, $actual, $description = null) { |
||
409 | |||
410 | |||
411 | /** |
||
412 | * [!] Method is generated. Documentation taken from corresponding module. |
||
413 | * |
||
414 | * @param $class |
||
415 | * @param $actual |
||
416 | * @param $description |
||
417 | * @see \Codeception\Module\Asserts::assertNotInstanceOf() |
||
418 | */ |
||
419 | public function assertNotInstanceOf($class, $actual, $description = null) { |
||
422 | |||
423 | |||
424 | /** |
||
425 | * [!] Method is generated. Documentation taken from corresponding module. |
||
426 | * |
||
427 | * @param $type |
||
428 | * @param $actual |
||
429 | * @param $description |
||
430 | * @see \Codeception\Module\Asserts::assertInternalType() |
||
431 | */ |
||
432 | public function assertInternalType($type, $actual, $description = null) { |
||
435 | |||
436 | |||
437 | /** |
||
438 | * [!] Method is generated. Documentation taken from corresponding module. |
||
439 | * |
||
440 | * Fails the test with message. |
||
441 | * |
||
442 | * @param $message |
||
443 | * @see \Codeception\Module\Asserts::fail() |
||
444 | */ |
||
445 | public function fail($message) { |
||
448 | |||
449 | |||
450 | /** |
||
451 | * [!] Method is generated. Documentation taken from corresponding module. |
||
452 | * |
||
453 | * Handles and checks exception called inside callback function. |
||
454 | * Either exception class name or exception instance should be provided. |
||
455 | * |
||
456 | * ```php |
||
457 | * <?php |
||
458 | * $I->expectException(MyException::class, function() { |
||
459 | * $this->doSomethingBad(); |
||
460 | * }); |
||
461 | * |
||
462 | * $I->expectException(new MyException(), function() { |
||
463 | * $this->doSomethingBad(); |
||
464 | * }); |
||
465 | * ``` |
||
466 | * If you want to check message or exception code, you can pass them with exception instance: |
||
467 | * ```php |
||
468 | * <?php |
||
469 | * // will check that exception MyException is thrown with "Don't do bad things" message |
||
470 | * $I->expectException(new MyException("Don't do bad things"), function() { |
||
471 | * $this->doSomethingBad(); |
||
472 | * }); |
||
473 | * ``` |
||
474 | * |
||
475 | * @param $exception string or \Exception |
||
476 | * @param $callback |
||
477 | * @see \Codeception\Module\Asserts::expectException() |
||
478 | */ |
||
479 | public function expectException($exception, $callback) { |
||
482 | } |
||
483 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.