/** * @param $name * @dataProvider nameProvider */ public function testDirPaths($name) { $txtFile = $this->getTextFile(); $this->share->mkdir($this->root . '/' . $name); $this->share->put($txtFile, $this->root . '/' . $name . '/' . $name); unlink($txtFile); $content = $this->share->dir($this->root . '/' . $name); $this->assertCount(1, $content); $this->assertEquals($name, $content[0]->getName()); }
/** * 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); } } }
public function testStatRoot() { $info = $this->share->stat('/'); $this->assertInstanceOf('\\Icewind\\SMB\\IFileInfo', $info); }