/** * @dataProvider nameAndDataProvider */ public function testReadStream($name, $text) { $sourceFile = $this->getTextFile($text); $this->share->put($sourceFile, $this->root . '/' . $name); $fh = $this->share->read($this->root . '/' . $name); $content = stream_get_contents($fh); fclose($fh); $this->share->del($this->root . '/' . $name); $this->assertEquals(file_get_contents($sourceFile), $content); }
/** * Read a file as a stream. * * @param string $path * @return array */ public function readStream($path) { $fullPath = $this->applyPathPrefix($path); return ['stream' => $this->share->read($fullPath)]; }
/** * @dataProvider invalidPathProvider * @expectedException \Icewind\SMB\Exception\InvalidPathException */ public function testReadStreamInvalidPath($name) { $this->share->read($name); }