public function testRecusiveDelete() { $fullPath = sys_get_temp_dir() . Directory::DS . 'PhavourTests'; mkdir($fullPath); touch($fullPath . Directory::DS . '1'); $this->assertFileExists($fullPath . Directory::DS . '1'); @mkdir($fullPath . Directory::DS . 'dir'); touch($fullPath . Directory::DS . 'dir' . Directory::DS . '2'); $this->assertFileExists($fullPath . Directory::DS . 'dir' . Directory::DS . '2'); @mkdir($fullPath . Directory::DS . 'dir'); $dir = new Directory(); $dir->recursivelyDeleteFromDirectory($fullPath . Directory::DS . '1'); $dir->recursivelyDeleteFromDirectory($fullPath); $this->assertFileNotExists($fullPath . Directory::DS . '1'); $this->assertFileNotExists($fullPath . Directory::DS . 'dir' . Directory::DS . '2'); }
/** * Flush all existing Cache. * @return boolean */ public function flush() { try { $this->helper->recursivelyDeleteFromDirectory($this->path); return true; // @codeCoverageIgnoreStart } catch (\Exception $e) { } return false; // @codeCoverageIgnoreEnd }