Пример #1
0
             $target = preg_replace('~^spec~', '', $path);
             expect(file_exists($this->tmpDir . $target))->toBe(false);
         }
         expect(file_exists($this->tmpDir))->toBe(false);
     });
     it("removes a directory recursively respecting the include option", function () {
         Dir::copy('spec/Fixture', $this->tmpDir);
         Dir::remove($this->tmpDir, ['include' => '*.txt']);
         $files = Dir::scan($this->tmpDir, ['type' => 'file']);
         sort($files);
         expect($files)->toBe($this->normalize([$this->tmpDir . '/Fixture/Extensions/file.xml', $this->tmpDir . '/Fixture/Extensions/index.html', $this->tmpDir . '/Fixture/Extensions/index.php']));
     });
     it("removes a directory recursively respecting the exclude option", function () {
         Dir::copy('spec/Fixture', $this->tmpDir);
         Dir::remove($this->tmpDir, ['exclude' => '*.txt']);
         $files = Dir::scan($this->tmpDir, ['type' => 'file']);
         sort($files);
         expect($files)->toBe($this->normalize([$this->tmpDir . '/Fixture/Extensions/Childs/child1.txt', $this->tmpDir . '/Fixture/Nested/Childs/child1.txt', $this->tmpDir . '/Fixture/Nested/nested_file1.txt', $this->tmpDir . '/Fixture/Nested/nested_file2.txt', $this->tmpDir . '/Fixture/file1.txt']));
     });
 });
 describe("::make()", function () {
     beforeEach(function () {
         $this->umask = umask(0);
         $this->tmpDir = Dir::tempnam(sys_get_temp_dir(), 'spec');
     });
     afterEach(function () {
         Dir::remove($this->tmpDir);
         umask($this->umask);
     });
     it("creates a nested directory", function () {
         $path = $this->tmpDir . '/My/Nested/Directory';