1 | <?php //[STAMP] afa4f0350422fae145b4236dce66191a |
||
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 | * Checks that actual is greater or equal than expected |
||
99 | * |
||
100 | * @param $expected |
||
101 | * @param $actual |
||
102 | * @param string $message |
||
103 | * @see \Codeception\Module\Asserts::assertGreaterThanOrEqual() |
||
104 | */ |
||
105 | public function assertGreaterThanOrEqual($expected, $actual, $message = null) { |
||
108 | |||
109 | |||
110 | /** |
||
111 | * [!] Method is generated. Documentation taken from corresponding module. |
||
112 | * |
||
113 | * Checks that actual is less than expected |
||
114 | * |
||
115 | * @param $expected |
||
116 | * @param $actual |
||
117 | * @param string $message |
||
118 | * @see \Codeception\Module\Asserts::assertLessThan() |
||
119 | */ |
||
120 | public function assertLessThan($expected, $actual, $message = null) { |
||
123 | |||
124 | |||
125 | /** |
||
126 | * [!] Method is generated. Documentation taken from corresponding module. |
||
127 | * |
||
128 | * Checks that actual is less or equal than expected |
||
129 | * |
||
130 | * @param $expected |
||
131 | * @param $actual |
||
132 | * @param string $message |
||
133 | * @see \Codeception\Module\Asserts::assertLessThanOrEqual() |
||
134 | */ |
||
135 | public function assertLessThanOrEqual($expected, $actual, $message = null) { |
||
138 | |||
139 | |||
140 | /** |
||
141 | * [!] Method is generated. Documentation taken from corresponding module. |
||
142 | * |
||
143 | * Checks that haystack contains needle |
||
144 | * |
||
145 | * @param $needle |
||
146 | * @param $haystack |
||
147 | * @param string $message |
||
148 | * @see \Codeception\Module\Asserts::assertContains() |
||
149 | */ |
||
150 | public function assertContains($needle, $haystack, $message = null) { |
||
153 | |||
154 | |||
155 | /** |
||
156 | * [!] Method is generated. Documentation taken from corresponding module. |
||
157 | * |
||
158 | * Checks that haystack doesn't contain needle. |
||
159 | * |
||
160 | * @param $needle |
||
161 | * @param $haystack |
||
162 | * @param string $message |
||
163 | * @see \Codeception\Module\Asserts::assertNotContains() |
||
164 | */ |
||
165 | public function assertNotContains($needle, $haystack, $message = null) { |
||
168 | |||
169 | |||
170 | /** |
||
171 | * [!] Method is generated. Documentation taken from corresponding module. |
||
172 | * |
||
173 | * Checks that string match with pattern |
||
174 | * |
||
175 | * @param string $pattern |
||
176 | * @param string $string |
||
177 | * @param string $message |
||
178 | * @see \Codeception\Module\Asserts::assertRegExp() |
||
179 | */ |
||
180 | public function assertRegExp($pattern, $string, $message = null) { |
||
183 | |||
184 | |||
185 | /** |
||
186 | * [!] Method is generated. Documentation taken from corresponding module. |
||
187 | * |
||
188 | * Checks that string not match with pattern |
||
189 | * |
||
190 | * @param string $pattern |
||
191 | * @param string $string |
||
192 | * @param string $message |
||
193 | * @see \Codeception\Module\Asserts::assertNotRegExp() |
||
194 | */ |
||
195 | public function assertNotRegExp($pattern, $string, $message = null) { |
||
198 | |||
199 | |||
200 | /** |
||
201 | * [!] Method is generated. Documentation taken from corresponding module. |
||
202 | * |
||
203 | * Checks that variable is empty. |
||
204 | * |
||
205 | * @param $actual |
||
206 | * @param string $message |
||
207 | * @see \Codeception\Module\Asserts::assertEmpty() |
||
208 | */ |
||
209 | public function assertEmpty($actual, $message = null) { |
||
212 | |||
213 | |||
214 | /** |
||
215 | * [!] Method is generated. Documentation taken from corresponding module. |
||
216 | * |
||
217 | * Checks that variable is not empty. |
||
218 | * |
||
219 | * @param $actual |
||
220 | * @param string $message |
||
221 | * @see \Codeception\Module\Asserts::assertNotEmpty() |
||
222 | */ |
||
223 | public function assertNotEmpty($actual, $message = null) { |
||
226 | |||
227 | |||
228 | /** |
||
229 | * [!] Method is generated. Documentation taken from corresponding module. |
||
230 | * |
||
231 | * Checks that variable is NULL |
||
232 | * |
||
233 | * @param $actual |
||
234 | * @param string $message |
||
235 | * @see \Codeception\Module\Asserts::assertNull() |
||
236 | */ |
||
237 | public function assertNull($actual, $message = null) { |
||
240 | |||
241 | |||
242 | /** |
||
243 | * [!] Method is generated. Documentation taken from corresponding module. |
||
244 | * |
||
245 | * Checks that variable is not NULL |
||
246 | * |
||
247 | * @param $actual |
||
248 | * @param string $message |
||
249 | * @see \Codeception\Module\Asserts::assertNotNull() |
||
250 | */ |
||
251 | public function assertNotNull($actual, $message = null) { |
||
254 | |||
255 | |||
256 | /** |
||
257 | * [!] Method is generated. Documentation taken from corresponding module. |
||
258 | * |
||
259 | * Checks that condition is positive. |
||
260 | * |
||
261 | * @param $condition |
||
262 | * @param string $message |
||
263 | * @see \Codeception\Module\Asserts::assertTrue() |
||
264 | */ |
||
265 | public function assertTrue($condition, $message = null) { |
||
268 | |||
269 | |||
270 | /** |
||
271 | * [!] Method is generated. Documentation taken from corresponding module. |
||
272 | * |
||
273 | * Checks that condition is negative. |
||
274 | * |
||
275 | * @param $condition |
||
276 | * @param string $message |
||
277 | * @see \Codeception\Module\Asserts::assertFalse() |
||
278 | */ |
||
279 | public function assertFalse($condition, $message = null) { |
||
282 | |||
283 | |||
284 | /** |
||
285 | * [!] Method is generated. Documentation taken from corresponding module. |
||
286 | * |
||
287 | * Checks if file exists |
||
288 | * |
||
289 | * @param string $filename |
||
290 | * @param string $message |
||
291 | * @see \Codeception\Module\Asserts::assertFileExists() |
||
292 | */ |
||
293 | public function assertFileExists($filename, $message = null) { |
||
296 | |||
297 | |||
298 | /** |
||
299 | * [!] Method is generated. Documentation taken from corresponding module. |
||
300 | * |
||
301 | * Checks if file doesn't exist |
||
302 | * |
||
303 | * @param string $filename |
||
304 | * @param string $message |
||
305 | * @see \Codeception\Module\Asserts::assertFileNotExists() |
||
306 | */ |
||
307 | public function assertFileNotExists($filename, $message = null) { |
||
310 | |||
311 | |||
312 | /** |
||
313 | * [!] Method is generated. Documentation taken from corresponding module. |
||
314 | * |
||
315 | * @param $expected |
||
316 | * @param $actual |
||
317 | * @param $description |
||
318 | * @see \Codeception\Module\Asserts::assertGreaterOrEquals() |
||
319 | */ |
||
320 | public function assertGreaterOrEquals($expected, $actual, $description = null) { |
||
323 | |||
324 | |||
325 | /** |
||
326 | * [!] Method is generated. Documentation taken from corresponding module. |
||
327 | * |
||
328 | * @param $expected |
||
329 | * @param $actual |
||
330 | * @param $description |
||
331 | * @see \Codeception\Module\Asserts::assertLessOrEquals() |
||
332 | */ |
||
333 | public function assertLessOrEquals($expected, $actual, $description = null) { |
||
336 | |||
337 | |||
338 | /** |
||
339 | * [!] Method is generated. Documentation taken from corresponding module. |
||
340 | * |
||
341 | * @param $actual |
||
342 | * @param $description |
||
343 | * @see \Codeception\Module\Asserts::assertIsEmpty() |
||
344 | */ |
||
345 | public function assertIsEmpty($actual, $description = null) { |
||
348 | |||
349 | |||
350 | /** |
||
351 | * [!] Method is generated. Documentation taken from corresponding module. |
||
352 | * |
||
353 | * @param $key |
||
354 | * @param $actual |
||
355 | * @param $description |
||
356 | * @see \Codeception\Module\Asserts::assertArrayHasKey() |
||
357 | */ |
||
358 | public function assertArrayHasKey($key, $actual, $description = null) { |
||
361 | |||
362 | |||
363 | /** |
||
364 | * [!] Method is generated. Documentation taken from corresponding module. |
||
365 | * |
||
366 | * @param $key |
||
367 | * @param $actual |
||
368 | * @param $description |
||
369 | * @see \Codeception\Module\Asserts::assertArrayNotHasKey() |
||
370 | */ |
||
371 | public function assertArrayNotHasKey($key, $actual, $description = null) { |
||
374 | |||
375 | |||
376 | /** |
||
377 | * [!] Method is generated. Documentation taken from corresponding module. |
||
378 | * |
||
379 | * @param $expectedCount |
||
380 | * @param $actual |
||
381 | * @param $description |
||
382 | * @see \Codeception\Module\Asserts::assertCount() |
||
383 | */ |
||
384 | public function assertCount($expectedCount, $actual, $description = null) { |
||
387 | |||
388 | |||
389 | /** |
||
390 | * [!] Method is generated. Documentation taken from corresponding module. |
||
391 | * |
||
392 | * @param $class |
||
393 | * @param $actual |
||
394 | * @param $description |
||
395 | * @see \Codeception\Module\Asserts::assertInstanceOf() |
||
396 | */ |
||
397 | public function assertInstanceOf($class, $actual, $description = null) { |
||
400 | |||
401 | |||
402 | /** |
||
403 | * [!] Method is generated. Documentation taken from corresponding module. |
||
404 | * |
||
405 | * @param $class |
||
406 | * @param $actual |
||
407 | * @param $description |
||
408 | * @see \Codeception\Module\Asserts::assertNotInstanceOf() |
||
409 | */ |
||
410 | public function assertNotInstanceOf($class, $actual, $description = null) { |
||
413 | |||
414 | |||
415 | /** |
||
416 | * [!] Method is generated. Documentation taken from corresponding module. |
||
417 | * |
||
418 | * @param $type |
||
419 | * @param $actual |
||
420 | * @param $description |
||
421 | * @see \Codeception\Module\Asserts::assertInternalType() |
||
422 | */ |
||
423 | public function assertInternalType($type, $actual, $description = null) { |
||
426 | |||
427 | |||
428 | /** |
||
429 | * [!] Method is generated. Documentation taken from corresponding module. |
||
430 | * |
||
431 | * Fails the test with message. |
||
432 | * |
||
433 | * @param $message |
||
434 | * @see \Codeception\Module\Asserts::fail() |
||
435 | */ |
||
436 | public function fail($message) { |
||
439 | |||
440 | |||
441 | /** |
||
442 | * [!] Method is generated. Documentation taken from corresponding module. |
||
443 | * |
||
444 | * Handles and checks exception called inside callback function. |
||
445 | * Either exception class name or exception instance should be provided. |
||
446 | * |
||
447 | * ```php |
||
448 | * <?php |
||
449 | * $I->expectException(MyException::class, function() { |
||
450 | * $this->doSomethingBad(); |
||
451 | * }); |
||
452 | * |
||
453 | * $I->expectException(new MyException(), function() { |
||
454 | * $this->doSomethingBad(); |
||
455 | * }); |
||
456 | * ``` |
||
457 | * If you want to check message or exception code, you can pass them with exception instance: |
||
458 | * ```php |
||
459 | * <?php |
||
460 | * // will check that exception MyException is thrown with "Don't do bad things" message |
||
461 | * $I->expectException(new MyException("Don't do bad things"), function() { |
||
462 | * $this->doSomethingBad(); |
||
463 | * }); |
||
464 | * ``` |
||
465 | * |
||
466 | * @param $exception string or \Exception |
||
467 | * @param $callback |
||
468 | * @see \Codeception\Module\Asserts::expectException() |
||
469 | */ |
||
470 | public function expectException($exception, $callback) { |
||
473 | } |
||
474 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.