Code Duplication    Length = 17-17 lines in 2 locations

shared/tests/N98/Util/FilesystemTest.php 2 locations

@@ 137-153 (lines=17) @@
134
        $this->assertFileNotExists($basePath);
135
    }
136
137
    public function testRecursiveRemove()
138
    {
139
        $tmp = sys_get_temp_dir();
140
        $basePath = $tmp . "/n98_testdir";
141
        $folder1 = $basePath . "/folder1";
142
        $folder2 = $basePath . "/folder2";
143
        $file1 = $folder1 . "/file1.txt";
144
        $file2 = $folder2 . "/file2.txt";
145
146
        @mkdir($folder1, 0777, true);
147
        @mkdir($folder2, 0777, true);
148
        touch($file1);
149
        touch($file2);
150
151
        $this->fileSystem->recursiveRemoveDirectory($basePath);
152
        $this->assertFileNotExists($basePath);
153
    }
154
155
    public function testRecursiveRemoveWithTrailingSlash()
156
    {
@@ 155-171 (lines=17) @@
152
        $this->assertFileNotExists($basePath);
153
    }
154
155
    public function testRecursiveRemoveWithTrailingSlash()
156
    {
157
        $tmp = sys_get_temp_dir();
158
        $basePath = $tmp . "/n98_testdir";
159
        $folder1 = $basePath . "/folder1";
160
        $folder2 = $basePath . "/folder2";
161
        $file1 = $folder1 . "/file1.txt";
162
        $file2 = $folder2 . "/file2.txt";
163
164
        @mkdir($folder1, 0777, true);
165
        @mkdir($folder2, 0777, true);
166
        touch($file1);
167
        touch($file2);
168
169
        $this->fileSystem->recursiveRemoveDirectory($basePath . "/");
170
        $this->assertFileNotExists($basePath);
171
    }
172
173
    public function testFalseIsReturnedIfDirectoryNotExist()
174
    {