minor changes for unit-tests

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-21 16:32:44 +01:00
parent 1ba4164028
commit 0a28ef2af6
33 changed files with 199 additions and 196 deletions

View File

@@ -104,8 +104,8 @@ class FroxlorRPC
}
// simply check for file-existance, as we do not want to use our autoloader because this way
// it will recognize non-api classes+methods as valid commands
$apiclass = \Froxlor\Froxlor::getInstallDir() . '/lib/Froxlor/Api/Commands/' . $command[0] . '.php';
if (! file_exists($apiclass) || ! @method_exists($command[0], $command[1])) {
$apiclass = '\\Froxlor\\Api\\Commands\\' . $command[0];
if (! class_exists($apiclass) || ! @method_exists($apiclass, $command[1])) {
throw new \Exception("Unknown command", 400);
}
return array(