public function handle($data) { $method = $data['method']; $restData = Json::decode($data['rest_data']); $class = '\\Tests\\MockSugarServer\\Action\\' . Strings::underscoreToCamelCase($method); $action = new $class($restData); return $action->process()->response(); }
/** * @return array */ public function toJsonArray() { return ['name' => $this->name, 'params' => Json::decode($this->params)]; }
public function getRenderedJsonAsArray() { return Json::decode($this->getActualContent(), true); }
/** * @test * @dataProvider invalidJson * @param string $invalidJson */ public function shouldThrowOnInvalidJson($invalidJson) { // when try { Json::decode($invalidJson); $this->assertTrue(false); } catch (JsonDecodeException $e) { } }
private static function _jsonParameters($content) { if (Strings::equalsIgnoreCase(ContentType::value(), 'application/json')) { return Arrays::toArray(Json::decode($content, true)); } return false; }