test for api version

This commit is contained in:
kremsy 2017-03-22 18:21:33 +01:00
parent 496039a627
commit a1373b4e7c
2 changed files with 28 additions and 0 deletions

View File

@ -42,6 +42,7 @@ class LibXmlRpcCallbacks implements CallbackListener {
* @param mixed $data * @param mixed $data
*/ */
public function handleScriptCallback($name, $data) { public function handleScriptCallback($name, $data) {
var_dump($name);
switch ($name) { switch ($name) {
//New callbacks //New callbacks
case 'XmlRpc.CallbacksList': case 'XmlRpc.CallbacksList':

View File

@ -30,6 +30,13 @@ class ModeScriptEventManager {
*/ */
public function enableCallbacks() { public function enableCallbacks() {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.EnableCallbacks', array('true')); $this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.EnableCallbacks', array('true'));
$this->setApiVersion();
$this->getAllApiVersions();
$this->getCallbacksList(); //TODO verify why this does not work
var_dump("test");
} }
/** /**
@ -38,4 +45,24 @@ class ModeScriptEventManager {
public function disableCallbacks() { public function disableCallbacks() {
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.EnableCallbacks', array('false')); $this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.EnableCallbacks', array('false'));
} }
/**
* @param string $responseId
* Triggers a Callback List Callback
*/
public function getCallbacksList($responseId = "DefaultResponseId"){
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetCallbacksList', array($responseId));
}
/**
* Sets the Api Version
* @param string $version
*/
public function setApiVersion($version = "1.2.3-beta.4.5.6+build789"){ //TODO constant of API Versions
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.SetApiVersion', array($version));
}
public function getAllApiVersions($responseId = "DefaultResponseId"){
$this->maniaControl->getClient()->triggerModeScriptEvent('XmlRpc.GetAllApiVersions', array($responseId));
}
} }