@@ 219-231 (lines=13) @@ | ||
216 | $this->assertEquals($expected, $return); |
|
217 | } |
|
218 | ||
219 | public function testSendApiRequestReturnValueCurlPhp() |
|
220 | { |
|
221 | $this->connCurlPhp->method('isApplicable')->willReturn(true); |
|
222 | ||
223 | $return = $this->api->sendApiRequest("http://payone.de"); |
|
224 | $expected = [ |
|
225 | 'status' => 'APPROVED', |
|
226 | 'txid' => '42', |
|
227 | 'userid' => '0815', |
|
228 | 3 => 'test' |
|
229 | ]; |
|
230 | $this->assertEquals($expected, $return); |
|
231 | } |
|
232 | ||
233 | public function testSendApiRequestReturnValueCurlCli() |
|
234 | { |
|
@@ 233-246 (lines=14) @@ | ||
230 | $this->assertEquals($expected, $return); |
|
231 | } |
|
232 | ||
233 | public function testSendApiRequestReturnValueCurlCli() |
|
234 | { |
|
235 | $this->connCurlPhp->method('isApplicable')->willReturn(false); |
|
236 | $this->connCurlCli->method('isApplicable')->willReturn(true); |
|
237 | ||
238 | $return = $this->api->sendApiRequest("http://payone.de"); |
|
239 | $expected = [ |
|
240 | 'status' => 'APPROVED', |
|
241 | 'txid' => '42', |
|
242 | 'userid' => '0815', |
|
243 | 3 => 'test' |
|
244 | ]; |
|
245 | $this->assertEquals($expected, $return); |
|
246 | } |
|
247 | ||
248 | public function testSendApiRequestReturnValueFsockopen() |
|
249 | { |
|
@@ 248-261 (lines=14) @@ | ||
245 | $this->assertEquals($expected, $return); |
|
246 | } |
|
247 | ||
248 | public function testSendApiRequestReturnValueFsockopen() |
|
249 | { |
|
250 | $this->connCurlPhp->method('isApplicable')->willReturn(false); |
|
251 | $this->connCurlCli->method('isApplicable')->willReturn(false); |
|
252 | ||
253 | $return = $this->api->sendApiRequest("http://payone.de"); |
|
254 | $expected = [ |
|
255 | 'status' => 'APPROVED', |
|
256 | 'txid' => '42', |
|
257 | 'userid' => '0815', |
|
258 | 3 => 'test' |
|
259 | ]; |
|
260 | $this->assertEquals($expected, $return); |
|
261 | } |
|
262 | } |
|
263 |