|
1
|
|
|
<?php //[STAMP] 3b936e50bd5dfb74ed6638d35c7876f2 |
|
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\Filesystem; |
|
9
|
|
|
use Codeception\Module\FunctionalHelper; |
|
10
|
|
|
|
|
11
|
|
|
trait FunctionalTesterActions |
|
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
|
|
|
* Enters a directory In local filesystem. |
|
23
|
|
|
* Project root directory is used by default |
|
24
|
|
|
* |
|
25
|
|
|
* @param $path |
|
26
|
|
|
* @see \Codeception\Module\Filesystem::amInPath() |
|
27
|
|
|
*/ |
|
28
|
|
|
public function amInPath($path) { |
|
|
|
|
|
|
29
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amInPath', func_get_args())); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
35
|
|
|
* |
|
36
|
|
|
* Opens a file and stores it's content. |
|
37
|
|
|
* |
|
38
|
|
|
* Usage: |
|
39
|
|
|
* |
|
40
|
|
|
* ``` php |
|
41
|
|
|
* <?php |
|
42
|
|
|
* $I->openFile('composer.json'); |
|
43
|
|
|
* $I->seeInThisFile('codeception/codeception'); |
|
44
|
|
|
* ?> |
|
45
|
|
|
* ``` |
|
46
|
|
|
* |
|
47
|
|
|
* @param $filename |
|
48
|
|
|
* @see \Codeception\Module\Filesystem::openFile() |
|
49
|
|
|
*/ |
|
50
|
|
|
public function openFile($filename) { |
|
|
|
|
|
|
51
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('openFile', func_get_args())); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
57
|
|
|
* |
|
58
|
|
|
* Deletes a file |
|
59
|
|
|
* |
|
60
|
|
|
* ``` php |
|
61
|
|
|
* <?php |
|
62
|
|
|
* $I->deleteFile('composer.lock'); |
|
63
|
|
|
* ?> |
|
64
|
|
|
* ``` |
|
65
|
|
|
* |
|
66
|
|
|
* @param $filename |
|
67
|
|
|
* @see \Codeception\Module\Filesystem::deleteFile() |
|
68
|
|
|
*/ |
|
69
|
|
|
public function deleteFile($filename) { |
|
|
|
|
|
|
70
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteFile', func_get_args())); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
76
|
|
|
* |
|
77
|
|
|
* Deletes directory with all subdirectories |
|
78
|
|
|
* |
|
79
|
|
|
* ``` php |
|
80
|
|
|
* <?php |
|
81
|
|
|
* $I->deleteDir('vendor'); |
|
82
|
|
|
* ?> |
|
83
|
|
|
* ``` |
|
84
|
|
|
* |
|
85
|
|
|
* @param $dirname |
|
86
|
|
|
* @see \Codeception\Module\Filesystem::deleteDir() |
|
87
|
|
|
*/ |
|
88
|
|
|
public function deleteDir($dirname) { |
|
|
|
|
|
|
89
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteDir', func_get_args())); |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
|
|
93
|
|
|
/** |
|
94
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
95
|
|
|
* |
|
96
|
|
|
* Copies directory with all contents |
|
97
|
|
|
* |
|
98
|
|
|
* ``` php |
|
99
|
|
|
* <?php |
|
100
|
|
|
* $I->copyDir('vendor','old_vendor'); |
|
101
|
|
|
* ?> |
|
102
|
|
|
* ``` |
|
103
|
|
|
* |
|
104
|
|
|
* @param $src |
|
105
|
|
|
* @param $dst |
|
106
|
|
|
* @see \Codeception\Module\Filesystem::copyDir() |
|
107
|
|
|
*/ |
|
108
|
|
|
public function copyDir($src, $dst) { |
|
|
|
|
|
|
109
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('copyDir', func_get_args())); |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
115
|
|
|
* |
|
116
|
|
|
* Checks If opened file has `text` in it. |
|
117
|
|
|
* |
|
118
|
|
|
* Usage: |
|
119
|
|
|
* |
|
120
|
|
|
* ``` php |
|
121
|
|
|
* <?php |
|
122
|
|
|
* $I->openFile('composer.json'); |
|
123
|
|
|
* $I->seeInThisFile('codeception/codeception'); |
|
124
|
|
|
* ?> |
|
125
|
|
|
* ``` |
|
126
|
|
|
* |
|
127
|
|
|
* @param $text |
|
128
|
|
|
* Conditional Assertion: Test won't be stopped on fail |
|
129
|
|
|
* @see \Codeception\Module\Filesystem::seeInThisFile() |
|
130
|
|
|
*/ |
|
131
|
|
|
public function canSeeInThisFile($text) { |
|
|
|
|
|
|
132
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args())); |
|
133
|
|
|
} |
|
134
|
|
|
/** |
|
135
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
136
|
|
|
* |
|
137
|
|
|
* Checks If opened file has `text` in it. |
|
138
|
|
|
* |
|
139
|
|
|
* Usage: |
|
140
|
|
|
* |
|
141
|
|
|
* ``` php |
|
142
|
|
|
* <?php |
|
143
|
|
|
* $I->openFile('composer.json'); |
|
144
|
|
|
* $I->seeInThisFile('codeception/codeception'); |
|
145
|
|
|
* ?> |
|
146
|
|
|
* ``` |
|
147
|
|
|
* |
|
148
|
|
|
* @param $text |
|
149
|
|
|
* @see \Codeception\Module\Filesystem::seeInThisFile() |
|
150
|
|
|
*/ |
|
151
|
|
|
public function seeInThisFile($text) { |
|
|
|
|
|
|
152
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args())); |
|
153
|
|
|
} |
|
154
|
|
|
|
|
155
|
|
|
|
|
156
|
|
|
/** |
|
157
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
158
|
|
|
* |
|
159
|
|
|
* Checks the strict matching of file contents. |
|
160
|
|
|
* Unlike `seeInThisFile` will fail if file has something more than expected lines. |
|
161
|
|
|
* Better to use with HEREDOC strings. |
|
162
|
|
|
* Matching is done after removing "\r" chars from file content. |
|
163
|
|
|
* |
|
164
|
|
|
* ``` php |
|
165
|
|
|
* <?php |
|
166
|
|
|
* $I->openFile('process.pid'); |
|
167
|
|
|
* $I->seeFileContentsEqual('3192'); |
|
168
|
|
|
* ?> |
|
169
|
|
|
* ``` |
|
170
|
|
|
* |
|
171
|
|
|
* @param $text |
|
172
|
|
|
* Conditional Assertion: Test won't be stopped on fail |
|
173
|
|
|
* @see \Codeception\Module\Filesystem::seeFileContentsEqual() |
|
174
|
|
|
*/ |
|
175
|
|
|
public function canSeeFileContentsEqual($text) { |
|
|
|
|
|
|
176
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args())); |
|
177
|
|
|
} |
|
178
|
|
|
/** |
|
179
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
180
|
|
|
* |
|
181
|
|
|
* Checks the strict matching of file contents. |
|
182
|
|
|
* Unlike `seeInThisFile` will fail if file has something more than expected lines. |
|
183
|
|
|
* Better to use with HEREDOC strings. |
|
184
|
|
|
* Matching is done after removing "\r" chars from file content. |
|
185
|
|
|
* |
|
186
|
|
|
* ``` php |
|
187
|
|
|
* <?php |
|
188
|
|
|
* $I->openFile('process.pid'); |
|
189
|
|
|
* $I->seeFileContentsEqual('3192'); |
|
190
|
|
|
* ?> |
|
191
|
|
|
* ``` |
|
192
|
|
|
* |
|
193
|
|
|
* @param $text |
|
194
|
|
|
* @see \Codeception\Module\Filesystem::seeFileContentsEqual() |
|
195
|
|
|
*/ |
|
196
|
|
|
public function seeFileContentsEqual($text) { |
|
|
|
|
|
|
197
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args())); |
|
198
|
|
|
} |
|
199
|
|
|
|
|
200
|
|
|
|
|
201
|
|
|
/** |
|
202
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
203
|
|
|
* |
|
204
|
|
|
* Checks If opened file doesn't contain `text` in it |
|
205
|
|
|
* |
|
206
|
|
|
* ``` php |
|
207
|
|
|
* <?php |
|
208
|
|
|
* $I->openFile('composer.json'); |
|
209
|
|
|
* $I->dontSeeInThisFile('codeception/codeception'); |
|
210
|
|
|
* ?> |
|
211
|
|
|
* ``` |
|
212
|
|
|
* |
|
213
|
|
|
* @param $text |
|
214
|
|
|
* Conditional Assertion: Test won't be stopped on fail |
|
215
|
|
|
* @see \Codeception\Module\Filesystem::dontSeeInThisFile() |
|
216
|
|
|
*/ |
|
217
|
|
|
public function cantSeeInThisFile($text) { |
|
|
|
|
|
|
218
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args())); |
|
219
|
|
|
} |
|
220
|
|
|
/** |
|
221
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
222
|
|
|
* |
|
223
|
|
|
* Checks If opened file doesn't contain `text` in it |
|
224
|
|
|
* |
|
225
|
|
|
* ``` php |
|
226
|
|
|
* <?php |
|
227
|
|
|
* $I->openFile('composer.json'); |
|
228
|
|
|
* $I->dontSeeInThisFile('codeception/codeception'); |
|
229
|
|
|
* ?> |
|
230
|
|
|
* ``` |
|
231
|
|
|
* |
|
232
|
|
|
* @param $text |
|
233
|
|
|
* @see \Codeception\Module\Filesystem::dontSeeInThisFile() |
|
234
|
|
|
*/ |
|
235
|
|
|
public function dontSeeInThisFile($text) { |
|
|
|
|
|
|
236
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args())); |
|
237
|
|
|
} |
|
238
|
|
|
|
|
239
|
|
|
|
|
240
|
|
|
/** |
|
241
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
242
|
|
|
* |
|
243
|
|
|
* Deletes a file |
|
244
|
|
|
* @see \Codeception\Module\Filesystem::deleteThisFile() |
|
245
|
|
|
*/ |
|
246
|
|
|
public function deleteThisFile() { |
|
247
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args())); |
|
248
|
|
|
} |
|
249
|
|
|
|
|
250
|
|
|
|
|
251
|
|
|
/** |
|
252
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
253
|
|
|
* |
|
254
|
|
|
* Checks if file exists in path. |
|
255
|
|
|
* Opens a file when it's exists |
|
256
|
|
|
* |
|
257
|
|
|
* ``` php |
|
258
|
|
|
* <?php |
|
259
|
|
|
* $I->seeFileFound('UserModel.php','app/models'); |
|
260
|
|
|
* ?> |
|
261
|
|
|
* ``` |
|
262
|
|
|
* |
|
263
|
|
|
* @param $filename |
|
264
|
|
|
* @param string $path |
|
265
|
|
|
* Conditional Assertion: Test won't be stopped on fail |
|
266
|
|
|
* @see \Codeception\Module\Filesystem::seeFileFound() |
|
267
|
|
|
*/ |
|
268
|
|
|
public function canSeeFileFound($filename, $path = null) { |
|
|
|
|
|
|
269
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args())); |
|
270
|
|
|
} |
|
271
|
|
|
/** |
|
272
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
273
|
|
|
* |
|
274
|
|
|
* Checks if file exists in path. |
|
275
|
|
|
* Opens a file when it's exists |
|
276
|
|
|
* |
|
277
|
|
|
* ``` php |
|
278
|
|
|
* <?php |
|
279
|
|
|
* $I->seeFileFound('UserModel.php','app/models'); |
|
280
|
|
|
* ?> |
|
281
|
|
|
* ``` |
|
282
|
|
|
* |
|
283
|
|
|
* @param $filename |
|
284
|
|
|
* @param string $path |
|
285
|
|
|
* @see \Codeception\Module\Filesystem::seeFileFound() |
|
286
|
|
|
*/ |
|
287
|
|
|
public function seeFileFound($filename, $path = null) { |
|
|
|
|
|
|
288
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args())); |
|
289
|
|
|
} |
|
290
|
|
|
|
|
291
|
|
|
|
|
292
|
|
|
/** |
|
293
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
294
|
|
|
* |
|
295
|
|
|
* Checks if file does not exists in path |
|
296
|
|
|
* |
|
297
|
|
|
* @param $filename |
|
298
|
|
|
* @param string $path |
|
299
|
|
|
* Conditional Assertion: Test won't be stopped on fail |
|
300
|
|
|
* @see \Codeception\Module\Filesystem::dontSeeFileFound() |
|
301
|
|
|
*/ |
|
302
|
|
|
public function cantSeeFileFound($filename, $path = null) { |
|
|
|
|
|
|
303
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args())); |
|
304
|
|
|
} |
|
305
|
|
|
/** |
|
306
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
307
|
|
|
* |
|
308
|
|
|
* Checks if file does not exists in path |
|
309
|
|
|
* |
|
310
|
|
|
* @param $filename |
|
311
|
|
|
* @param string $path |
|
312
|
|
|
* @see \Codeception\Module\Filesystem::dontSeeFileFound() |
|
313
|
|
|
*/ |
|
314
|
|
|
public function dontSeeFileFound($filename, $path = null) { |
|
|
|
|
|
|
315
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args())); |
|
316
|
|
|
} |
|
317
|
|
|
|
|
318
|
|
|
|
|
319
|
|
|
/** |
|
320
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
321
|
|
|
* |
|
322
|
|
|
* Erases directory contents |
|
323
|
|
|
* |
|
324
|
|
|
* ``` php |
|
325
|
|
|
* <?php |
|
326
|
|
|
* $I->cleanDir('logs'); |
|
327
|
|
|
* ?> |
|
328
|
|
|
* ``` |
|
329
|
|
|
* |
|
330
|
|
|
* @param $dirname |
|
331
|
|
|
* @see \Codeception\Module\Filesystem::cleanDir() |
|
332
|
|
|
*/ |
|
333
|
|
|
public function cleanDir($dirname) { |
|
|
|
|
|
|
334
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('cleanDir', func_get_args())); |
|
335
|
|
|
} |
|
336
|
|
|
|
|
337
|
|
|
|
|
338
|
|
|
/** |
|
339
|
|
|
* [!] Method is generated. Documentation taken from corresponding module. |
|
340
|
|
|
* |
|
341
|
|
|
* Saves contents to file |
|
342
|
|
|
* |
|
343
|
|
|
* @param $filename |
|
344
|
|
|
* @param $contents |
|
345
|
|
|
* @see \Codeception\Module\Filesystem::writeToFile() |
|
346
|
|
|
*/ |
|
347
|
|
|
public function writeToFile($filename, $contents) { |
|
|
|
|
|
|
348
|
|
|
return $this->getScenario()->runStep(new \Codeception\Step\Action('writeToFile', func_get_args())); |
|
349
|
|
|
} |
|
350
|
|
|
} |
|
351
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.