8 protected $apiTokenId = 'apitoken';
9 protected $apiTokenSecret = 'password';
12 * Set the API editor role as the current user via the API driver.
14 protected function actingAsApiEditor()
16 $this->actingAs($this->getEditor(), 'api');
21 * Format the given items into a standardised error format.
23 protected function errorResponse(string $message, int $code): array
25 return ["error" => ["code" => $code, "message" => $message]];
29 * Get an approved API auth header.
31 protected function apiAuthHeader(): array
34 "Authorization" => "Token {$this->apiTokenId}:{$this->apiTokenSecret}"