コード例 #1
0
ファイル: NewsSpec.php プロジェクト: Zachu/GizmoAPI
 public function it_should_throw_on_update_if_got_unexpected_response(HttpClient $client)
 {
     $this->Title = 'NewTitle';
     $client->post('News/Update', $this->getAttributes())->shouldBeCalled()->willReturn(Helper::trueResponse());
     $this->shouldThrow('\\Pisa\\GizmoAPI\\Exceptions\\UnexpectedResponseException')->duringSave();
     $client->post('News/Update', $this->getAttributes())->shouldBeCalled()->willReturn(Helper::internalServerErrorResponse());
     $this->shouldThrow('\\Pisa\\GizmoAPI\\Exceptions\\UnexpectedResponseException')->duringSave();
 }
コード例 #2
0
ファイル: HostSpec.php プロジェクト: Zachu/GizmoAPI
 public function it_should_throw_on_out_of_order_if_got_unexpected_response(HttpClient $client)
 {
     $client->post("Host/SetOrderState", ['hostId' => $this->getPrimaryKeyValue(), 'inOrder' => "false"])->shouldBeCalled()->willReturn(Helper::trueResponse());
     $this->shouldThrow('\\Pisa\\GizmoAPI\\Exceptions\\UnexpectedResponseException')->duringSetOrderState(true);
 }
コード例 #3
0
ファイル: UserSpec.php プロジェクト: Zachu/GizmoAPI
 public function it_should_throw_on_set_user_group_when_got_unexpected_reply(HttpClient $client)
 {
     $newUserGroup = $this->getAttribute('GroupId')->getWrappedObject() + 1;
     $client->post('Users/SetUserGroup', ['userId' => $this->getPrimaryKeyValue(), 'newUserGroup' => $newUserGroup])->shouldBeCalled()->willReturn(Helper::trueResponse());
     $this->shouldThrow('\\Pisa\\GizmoAPI\\Exceptions\\UnexpectedResponseException')->duringSetUserGroup($newUserGroup);
     $this->GroupId->shouldNotBe($newUserGroup);
 }