| @@ 206-223 (lines=18) @@ | ||
| 203 | $I->dontSeeFileFound('j/k/m/m.txt'); |
|
| 204 | } |
|
| 205 | ||
| 206 | public function toCreateDirViaCollection(CliGuy $I) |
|
| 207 | { |
|
| 208 | // Set up a collection to add tasks to |
|
| 209 | $collection = $I->collectionBuilder(); |
|
| 210 | ||
| 211 | // Set up a filesystem stack |
|
| 212 | $collection->taskFilesystemStack() |
|
| 213 | ->mkdir('log') |
|
| 214 | ->touch('log/error.txt'); |
|
| 215 | ||
| 216 | // FilesystemStack has not run yet, so file should not be found. |
|
| 217 | $I->dontSeeFileFound('log/error.txt'); |
|
| 218 | ||
| 219 | // Run the task collection; now the files should be present |
|
| 220 | $collection->run(); |
|
| 221 | $I->seeFileFound('log/error.txt'); |
|
| 222 | $I->seeDirFound('log'); |
|
| 223 | } |
|
| 224 | ||
| 225 | public function toUseATmpDirAndConfirmItIsDeleted(CliGuy $I) |
|
| 226 | { |
|
| @@ 13-29 (lines=17) @@ | ||
| 10 | $I->amInPath(codecept_data_dir().'sandbox'); |
|
| 11 | } |
|
| 12 | ||
| 13 | public function toSimulateDirCreation(CliGuy $I) |
|
| 14 | { |
|
| 15 | // Set up a collection to add tasks to |
|
| 16 | $collection = $I->collectionBuilder(); |
|
| 17 | $collection->simulated(true); |
|
| 18 | ||
| 19 | // Set up a filesystem stack |
|
| 20 | $collection->taskFilesystemStack() |
|
| 21 | ->mkdir('simulatedir') |
|
| 22 | ->touch('simulatedir/error.txt'); |
|
| 23 | ||
| 24 | // Run the task collection; now the files should be present |
|
| 25 | $collection->run(); |
|
| 26 | // Nothing should be created in simulated mode |
|
| 27 | $I->dontSeeFileFound('simulatedir/error.txt'); |
|
| 28 | $I->seeInOutput('[Simulator] Simulating Filesystem\FilesystemStack()'); |
|
| 29 | } |
|
| 30 | } |
|
| 31 | ||