$this->addContent($return);
}
+ /**
+ * Wrapper around exit() for JSON only responses
+ *
+ * @param array $data
+ */
+ public function exitWithJson(array $data)
+ {
+ $this->exit('content', ['content' => $data], static::TYPE_JSON);
+ }
+
/**
* Quit execution with the message that the endpoint isn't implemented
*
// @todo Support the source property,
$account = DI::mstdnAccount()->createFromContactId($cdata['user'], $uid);
- $this->response->exit('account', ['account' => $account->toArray()]);
+ $this->response->exitWithJson($account->toArray());
}
}
*/
public function testApiStatusShowWithJson()
{
- self::markTestIncomplete('Needs Stastuses to not set header during call (like at BaseApi::setLinkHeader');
+ self::markTestIncomplete('Needs Statuses to not set header during call (like at BaseApi::setLinkHeader');
// $result = api_status_show('json', 1);
// self::assertStatus($result['status']);
*/
public function testApiStatusShowWithXml()
{
- self::markTestIncomplete('Needs Stastuses to not set header during call (like at BaseApi::setLinkHeader');
+ self::markTestIncomplete('Needs Statuses to not set header during call (like at BaseApi::setLinkHeader');
// $result = api_status_show('xml', 1);
// self::assertXml($result, 'statuses');