Пример #1
0
 public function it_should_throw_on_delete_if_got_unexpected_response(HttpClient $client)
 {
     $client->delete('News/Delete', ['feedId' => $this->getPrimaryKeyValue()])->shouldBeCalled()->willReturn(Helper::trueResponse());
     $this->shouldThrow('\\Pisa\\GizmoAPI\\Exceptions\\UnexpectedResponseException')->duringDelete();
     $client->delete('News/Delete', ['feedId' => $this->getPrimaryKeyValue()])->shouldBeCalled()->willReturn(Helper::internalServerErrorResponse());
     $this->shouldThrow('\\Pisa\\GizmoAPI\\Exceptions\\UnexpectedResponseException')->duringDelete();
 }
Пример #2
0
 public function it_should_logout_on_delete_if_user_is_logged_in(HttpClient $client)
 {
     $client->get('Users/GetLoginState', ['userId' => $this->getPrimaryKeyValue()])->willReturn(Helper::oneResponse());
     $client->post('Users/UserLogout', ['userId' => $this->getPrimaryKeyValue()])->shouldBeCalled()->willReturn(Helper::noContentResponse());
     $client->delete('Users/Delete', ['userId' => $this->getPrimaryKeyValue()])->shouldBeCalled()->willReturn(Helper::noContentResponse());
     $this->delete()->shouldReturn($this);
 }