Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Lines | 19 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
27 | View Code Duplication | public function testSimulateDirCreation() |
|
|
|||
28 | { |
||
29 | // Set up a collection to add tasks to |
||
30 | $collection = $this->collectionBuilder(); |
||
31 | $collection->simulated(true); |
||
32 | |||
33 | // Set up a filesystem stack |
||
34 | $collection->taskFilesystemStack() |
||
35 | ->mkdir('simulatedir') |
||
36 | ->touch('simulatedir/error.txt'); |
||
37 | |||
38 | // Run the task collection; the files would be present were this |
||
39 | // operation not simulated. |
||
40 | $result = $collection->run(); |
||
41 | $this->assertTrue($result->wasSuccessful()); |
||
42 | // Nothing should be created in simulated mode |
||
43 | $this->assertFileNotExists('simulatedir/error.txt'); |
||
44 | $this->assertOutputContains('[Simulator] Simulating Filesystem\FilesystemStack()'); |
||
45 | } |
||
46 | |||
50 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.