public function testDelAfterStat() { $name = 'foo.txt'; $txtFile = $this->getTextFile(); $this->share->put($txtFile, $this->root . '/' . $name); unlink($txtFile); $this->share->stat($this->root . '/' . $name); $this->share->del($this->root . '/foo.txt'); }
/** * Delete the contents of a directory. * * @param string $path */ protected function deleteContents($path) { $contents = $this->listContents($path, true) ?: array(); foreach (array_reverse($contents) as $object) { $fullPath = $this->applyPathPrefix($object['path']); if ($object['type'] === 'dir') { $this->share->rmdir($fullPath); } else { $this->share->del($fullPath); } } }