@@ 144-156 (lines=13) @@ | ||
141 | * @dataProvider checkAnswerErrorResponseData |
|
142 | * @covers ::checkAnswer |
|
143 | */ |
|
144 | public function checkAnswerErrorResponse($hashKey, GuzzleResponse $guzzleResponse, $message) |
|
145 | { |
|
146 | $guzzleRequest = $this->getMockForAbstractClass('\Guzzle\Http\Message\RequestInterface'); |
|
147 | $guzzleRequest->expects($this->once())->method('send')->will($this->returnValue($guzzleResponse)); |
|
148 | ||
149 | $guzzleClient = $this->getMockForAbstractClass('\Guzzle\Http\ClientInterface'); |
|
150 | $guzzleClient->expects($this->once())->method('post')->will($this->returnValue($guzzleRequest)); |
|
151 | ||
152 | $service = new Service($guzzleClient, 'notest', 'notest', $hashKey); |
|
153 | $response = $service->checkAnswer('notest', 'foo', 'bar'); |
|
154 | $this->assertFalse($response->valid()); |
|
155 | $this->assertSame($message, $response->getMessage()); |
|
156 | } |
|
157 | ||
158 | public function checkAnswerErrorResponseData() |
|
159 | { |
|
@@ 177-188 (lines=12) @@ | ||
174 | * @dataProvider checkAnswerValidResponseData |
|
175 | * @covers ::checkAnswer |
|
176 | */ |
|
177 | public function checkAnswerValidResponse($hashKey, GuzzleResponse $guzzleResponse) |
|
178 | { |
|
179 | $guzzleRequest = $this->getMockForAbstractClass('\Guzzle\Http\Message\RequestInterface'); |
|
180 | $guzzleRequest->expects($this->once())->method('send')->will($this->returnValue($guzzleResponse)); |
|
181 | ||
182 | $guzzleClient = $this->getMockForAbstractClass('\Guzzle\Http\ClientInterface'); |
|
183 | $guzzleClient->expects($this->once())->method('post')->will($this->returnValue($guzzleRequest)); |
|
184 | ||
185 | $service = new Service($guzzleClient, 'notest', 'notest', $hashKey); |
|
186 | $response = $service->checkAnswer('notest', 'foo', 'bar'); |
|
187 | $this->assertTrue($response->valid()); |
|
188 | } |
|
189 | ||
190 | public function checkAnswerValidResponseData() |
|
191 | { |