TestConfig.class.inc in Rocket.Chat 8
File
modules/rocket_chat_api/src/RocketChat/TestConfig.class.inc
View source
<?php
namespace Drupal\rocket_chat_api\RocketChat {
class Test7Config extends Drupal8Config {
private $userId;
private $userToken;
private $server = "http://127.0.0.1:3000";
public function getElement($elementName, $default = NULL) {
switch ($elementName) {
case "rocket_chat_uid":
return $this->userId;
case "rocket_chat_uit":
return $this->userToken;
case "rocket_chat_url":
return $this->server;
default:
return $default;
}
}
public function setElement($elementName, $newValue) {
switch ($elementName) {
case "rocket_chat_uid":
$this->userId = $newValue;
break;
case "rocket_chat_uit":
$this->userToken = $newValue;
break;
case "rocket_chat_url":
$this->server = $newValue;
break;
default:
fwrite(STDERR, "TEST SET [{$elementName}=>{$newValue}]\n");
}
}
public function isDebug() {
return FALSE;
}
public function notify($message, $type) {
return fwrite(STDERR, "Message [{$type}=>{$message}]\n");
}
}
}
namespace {
function drupal_json_decode($json) {
return \GuzzleHttp\json_decode($json, TRUE);
}
}