check if we can find smbclient in path

This commit is contained in:
Robin Appelman 2016-12-01 13:04:56 +01:00
commit 7ddcd96e47
3 changed files with 24 additions and 3 deletions

View file

@ -33,4 +33,20 @@ class Share extends AbstractShare {
$share = $this->server->getShare($this->config->share);
$share->dir($this->root);
}
/**
* @expectedException \Icewind\SMB\Exception\DependencyException
*/
public function testNoSmbclient() {
$system = $this->getMockBuilder('\Icewind\SMB\System')
->setMethods(['getSmbclientPath'])
->getMock();
$share = new \Icewind\SMB\Share($this->server, 'dummy', $system);
$system->expects($this->any())
->method('getSmbclientPath')
->will($this->returnValue(''));
$share->mkdir('');
}
}