1
|
|
|
<?php //[STAMP] afa4f0350422fae145b4236dce66191a |
2
|
|
|
namespace _generated; |
3
|
|
|
|
4
|
|
|
// This class was automatically generated by build task |
5
|
|
|
// You should not change it manually as it will be overwritten on next build |
6
|
|
|
// @codingStandardsIgnoreFile |
7
|
|
|
|
8
|
|
|
use Codeception\Module\Asserts; |
9
|
|
|
use Helper\Unit; |
10
|
|
|
|
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) { |
|
|
|
|
30
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args())); |
31
|
|
|
} |
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) { |
|
|
|
|
45
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args())); |
46
|
|
|
} |
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) { |
|
|
|
|
61
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSame', func_get_args())); |
62
|
|
|
} |
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) { |
|
|
|
|
76
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args())); |
77
|
|
|
} |
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) { |
|
|
|
|
91
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args())); |
92
|
|
|
} |
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) { |
|
|
|
|
106
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args())); |
107
|
|
|
} |
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) { |
|
|
|
|
121
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args())); |
122
|
|
|
} |
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) { |
|
|
|
|
136
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args())); |
137
|
|
|
} |
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) { |
|
|
|
|
151
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContains', func_get_args())); |
152
|
|
|
} |
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) { |
|
|
|
|
166
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args())); |
167
|
|
|
} |
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) { |
|
|
|
|
181
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertRegExp', func_get_args())); |
182
|
|
|
} |
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) { |
|
|
|
|
196
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotRegExp', func_get_args())); |
197
|
|
|
} |
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) { |
|
|
|
|
210
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args())); |
211
|
|
|
} |
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) { |
|
|
|
|
224
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args())); |
225
|
|
|
} |
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) { |
|
|
|
|
238
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNull', func_get_args())); |
239
|
|
|
} |
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) { |
|
|
|
|
252
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args())); |
253
|
|
|
} |
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) { |
|
|
|
|
266
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertTrue', func_get_args())); |
267
|
|
|
} |
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) { |
|
|
|
|
280
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFalse', func_get_args())); |
281
|
|
|
} |
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) { |
|
|
|
|
294
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileExists', func_get_args())); |
295
|
|
|
} |
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) { |
|
|
|
|
308
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotExists', func_get_args())); |
309
|
|
|
} |
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) { |
|
|
|
|
321
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args())); |
322
|
|
|
} |
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) { |
|
|
|
|
334
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args())); |
335
|
|
|
} |
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) { |
|
|
|
|
346
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args())); |
347
|
|
|
} |
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) { |
|
|
|
|
359
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args())); |
360
|
|
|
} |
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) { |
|
|
|
|
372
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args())); |
373
|
|
|
} |
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) { |
|
|
|
|
385
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertCount', func_get_args())); |
386
|
|
|
} |
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) { |
|
|
|
|
398
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInstanceOf', func_get_args())); |
399
|
|
|
} |
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) { |
|
|
|
|
411
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args())); |
412
|
|
|
} |
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) { |
|
|
|
|
424
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInternalType', func_get_args())); |
425
|
|
|
} |
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) { |
|
|
|
|
437
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args())); |
438
|
|
|
} |
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) { |
|
|
|
|
471
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args())); |
472
|
|
|
} |
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.