Add test cases for invalid server configurations

This commit is contained in:
Robin Appelman 2013-05-01 16:38:42 +02:00
commit 190ac9501d
2 changed files with 25 additions and 6 deletions

View file

@ -32,4 +32,20 @@ class Server extends \PHPUnit_Framework_TestCase {
$server = new \SMB\Server($this->config->host, uniqid(), $this->config->password);
$server->listShares();
}
/**
* @expectedException \SMB\AuthenticationException
*/
public function testWrongPassword() {
$server = new \SMB\Server($this->config->host, $this->config->user, uniqid());
$server->listShares();
}
/**
* @expectedException \SMB\InvalidHostException
*/
public function testWrongHost() {
$server = new \SMB\Server(uniqid(), $this->config->user, $this->config->password);
$server->listShares();
}
}