handle invalid handles in Share->get

This commit is contained in:
Robin Appelman 2016-01-19 18:28:42 +01:00
commit 1fb6581c8d
4 changed files with 45 additions and 1 deletions

View file

@ -230,6 +230,20 @@ abstract class AbstractShare extends TestCase {
unlink($targetFile);
}
/**
* @expectedException \Icewind\SMB\Exception\InvalidResourceException
*/
public function testGetInvalidTarget() {
$name = 'test.txt';
$text = 'dummy';
$tmpFile = $this->getTextFile($text);
$this->share->put($tmpFile, $this->root . '/' . $name);
unlink($tmpFile);
$this->share->get($this->root . '/' . $name, '/non/existing/file');
}
/**
* @dataProvider nameProvider
*/