Finish unit tests for all server services
This commit is contained in:
parent
3add44d342
commit
acbc52506c
21 changed files with 1609 additions and 206 deletions
|
@ -88,11 +88,13 @@ class BaseRepository implements BaseRepositoryInterface
|
|||
public function getHttpClient($headers = [])
|
||||
{
|
||||
if (! is_null($this->accessServer)) {
|
||||
$headers[] = ['X-Access-Server' => $this->getAccessServer()];
|
||||
$headers['X-Access-Server'] = $this->getAccessServer();
|
||||
}
|
||||
|
||||
if (! is_null($this->accessToken)) {
|
||||
$headers[] = ['X-Access-Token' => $this->getAccessToken()];
|
||||
$headers['X-Access-Token'] = $this->getAccessToken();
|
||||
} elseif (! is_null($this->node)) {
|
||||
$headers['X-Access-Token'] = $this->getNode()->daemonSecret;
|
||||
}
|
||||
|
||||
return new Client([
|
||||
|
|
|
@ -83,4 +83,14 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
|||
'json' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function update(array $data)
|
||||
{
|
||||
return $this->getHttpClient()->request('PATCH', '/server', [
|
||||
'json' => $data,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue