Ejemplo n.º 1
0
 /**
  * @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);
 }
Ejemplo n.º 2
0
 /**
  * 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)];
 }
Ejemplo n.º 3
0
 /**
  * @dataProvider invalidPathProvider
  * @expectedException \Icewind\SMB\Exception\InvalidPathException
  */
 public function testReadStreamInvalidPath($name)
 {
     $this->share->read($name);
 }