public function it_should_throw_on_is_logged_in_if_got_unexpected_response(HttpClient $client) { $client->get('Users/GetLoginState', ['userId' => $this->getPrimaryKeyValue()])->shouldBeCalled()->willReturn(Helper::falseResponse()); $this->shouldThrow('\\Pisa\\GizmoAPI\\Exceptions\\UnexpectedResponseException')->duringIsLoggedIn(); }
public function it_should_check_if_loginname_exists(HttpClient $client) { $loginName = '*****@*****.**'; $client->get('Users/LoginNameExist', ['loginName' => $loginName])->shouldBeCalled()->willReturn(Helper::trueResponse()); $this->hasLoginName($loginName)->shouldReturn(true); $client->get('Users/LoginNameExist', ['loginName' => $loginName])->shouldBeCalled()->willReturn(Helper::falseResponse()); $this->hasLoginName($loginName)->shouldReturn(false); }