server factory tests

This commit is contained in:
Robin Appelman 2018-07-13 13:03:47 +02:00
commit fc9f0bd408
4 changed files with 93 additions and 2 deletions

View file

@ -54,4 +54,11 @@ interface ISystem {
* @return string|bool
*/
public function getStdBufPath();
/**
* Whether or not the smbclient php extension is enabled
*
* @return bool
*/
public function libSmbclientAvailable();
}

View file

@ -61,6 +61,6 @@ class NativeServer extends AbstractServer {
* @return bool
*/
public static function available(ISystem $system) {
return function_exists('smbclient_state_new');
return $system->libSmbclientAvailable();
}
}

View file

@ -45,7 +45,11 @@ class System implements ISystem {
return $this->getBinaryPath('stdbuf');
}
private function getBinaryPath($binary) {
public function libSmbclientAvailable() {
return function_exists('smbclient_state_new');
}
protected function getBinaryPath($binary) {
if (!isset($this->paths[$binary])) {
$result = null;
$output = array();