function it_gets_my_badges(Client $client) { $client->get('/me/badges', ['site' => 'stackoverflow', 'sort' => 'rank', 'order' => 'desc'])->shouldBeCalled()->willReturn($this->response); $this->getMyBadges()->shouldBeArray(); }
/** * Allows an application to de-authorize itself for a set of users. * * More info: https://api.stackexchange.com/docs/application-de-authenticate * * @param string[] $accessTokens The array which contains the accessTokens delimited by semicolon * @param string[] $params QueryString parameter(s), it admits page and pagesize; by default is null * * @return array<BenatEspina\StackExchangeApiClient\Model\AccessTokenInterface> */ public function getDeAuthenticateAccessTokens($accessTokens, $params = []) { return $this->responseToAccessToken($this->client->get($this->prefix . '/' . implode(';', $accessTokens) . '/de-authenticate', $params)); }
function it_undo_accept_an_answer(Client $client) { $client->post('/answers/answer-id/accept/undo', [], ['site' => 'StackApps'])->shouldBeCalled()->willReturn($this->response); $this->postUndoAccept('answer-id', ['site' => 'StackApps'])->shouldReturnAnInstanceOf('BenatEspina\\StackExchangeApiClient\\Model\\Interfaces\\AnswerInterface'); }
function it_gets_de_authenticate_access_tokens(Client $client) { $client->get('/access-tokens/access-token-1;access-token-2/de-authenticate', [])->shouldBeCalled()->willReturn($this->response); $this->getDeAuthenticateAccessTokens(['access-token-1', 'access-token-2'])->shouldBeArray(); }
function it_gets_all_errors(Client $client) { $client->get('/errors', [])->shouldBeCalled()->willReturn($this->response); $this->getAll()->shouldBeArray(); }
function it_gets_filters(Client $client) { $client->get('/filters/filter-1;filter-2')->shouldBeCalled()->willReturn($this->response); $this->getFilters(['filter-1', 'filter-2'])->shouldBeArray(); }
/** * Returns the fields included by the given filters, and the "safeness" of those filters. * * More info: https://api.stackexchange.com/docs/read-filter * * @param string[] $filters The array which contains the filters delimited by semicolon * * @return array<BenatEspina\StackExchangeApiClient\Model\Interfaces\FilterInterface> */ public function getFilters($filters) { return $this->responseToFilter($this->client->get($this->prefix . '/' . implode(';', $filters))); }
/** * Returns the comments mentioning the user associated with the given access_token. * * More info: https://api.stackexchange.com/docs/me-mentioned * * @param string[] $params QueryString parameter(s), by default, the basic to work: * array('site' => 'stackoverflow', 'sort' => 'creation', 'order' => 'desc') * * @return array<BenatEspina\StackExchangeApiClient\Model\Interfaces\CommentInterface> */ public function getMyMentions($params = ['site' => 'stackoverflow', 'sort' => 'creation']) { return $this->responseToArray($this->client->get('/me/mentioned', $params)); }
/** * Get all users, in alphabetical order. * * More info: https://api.stackexchange.com/docs/users * * @param string[] $params QueryString parameter(s), by default, the basic to work: * array('site' => 'stackoverflow', 'sort' => 'name', 'order' => 'desc') * * @return array<BenatEspina\StackExchangeApiClient\Model\Interfaces\UserInterface> */ public function getByIds($ids, $params = ['site' => 'stackoverflow', 'sort' => 'name', 'order' => 'desc']) { return $this->client->get($this->prefix . '/' . implode(';', $ids), $params)['items']; }
/** * Undoes an accept vote on the given answer. * * More info: https://api.stackexchange.com/docs/undo-accept-answer * * @param string $id The id of question * @param string[] $request The array which contains the required parameters as 'site' * * @return \BenatEspina\StackExchangeApiClient\Model\Interfaces\AnswerInterface */ public function postUndoAccept($id, $request = []) { return $this->responseToAnswer($this->client->post($this->prefix . '/' . $id . '/accept/undo', [], $request)); }
function it_gets_my_mention_comments(Client $client) { $client->get('/me/mentioned', ['site' => 'stackoverflow', 'sort' => 'creation'])->shouldBeCalled()->willReturn($this->response); $this->getMyMentions(['site' => 'stackoverflow', 'sort' => 'creation'])->shouldBeArray(); }
/** * Get descriptions of all the errors that the API could return. * * More info: https://api.stackexchange.com/docs/errors * * @param string[] $params QueryString parameter(s), it admits page and pagesize; by default is null * * @return array<BenatEspina\StackExchangeApiClient\Model\AccessTokenInterface> */ public function getAll($params = []) { return $this->responseToArray($this->client->get($this->prefix, $params)); }
/** * Returns the badges earned by the user associated with the given access_token. * * More info: https://api.stackexchange.com/docs/me-badges * * @param string[] $params QueryString parameter(s), by default, the basic to work: * array('site' => 'stackoverflow', 'sort' => 'rank', 'order' => 'desc') * * @return array<BenatEspina\StackExchangeApiClient\Model\Interfaces\BadgeInterface> */ public function getMyBadges($params = ['site' => 'stackoverflow', 'sort' => 'rank', 'order' => 'desc']) { return $this->responseToBadge($this->client->get('/me' . $this->prefix, $params)); }