2019-12-30 19:42:46 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests;
|
|
|
|
|
|
|
|
trait TestsApi
|
|
|
|
{
|
|
|
|
|
|
|
|
protected $apiTokenId = 'apitoken';
|
|
|
|
protected $apiTokenSecret = 'password';
|
|
|
|
|
|
|
|
protected function errorResponse(string $messge, int $code)
|
|
|
|
{
|
|
|
|
return ["error" => ["code" => $code, "message" => $messge]];
|
|
|
|
}
|
|
|
|
|
2019-12-30 19:51:41 +00:00
|
|
|
protected function apiAuthHeader()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
"Authorization" => "Token {$this->apiTokenId}:{$this->apiTokenSecret}"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2019-12-30 19:42:46 +00:00
|
|
|
}
|