| @@ 13-21 (lines=9) @@ | ||
| 10 | ||
| 11 | class CurlClientTest extends TestCase |
|
| 12 | { |
|
| 13 | public function testSend() |
|
| 14 | { |
|
| 15 | $curl = $this->createMock(Curl::class); |
|
| 16 | $curl->method('getInfo')->willReturn(200); |
|
| 17 | $client = new CurlClient($curl); |
|
| 18 | $response = $client->send(new Request('GET')); |
|
| 19 | ||
| 20 | self::assertSame(200, $response->getStatusCode()); |
|
| 21 | } |
|
| 22 | ||
| 23 | public function testSendRequest() |
|
| 24 | { |
|
| @@ 38-46 (lines=9) @@ | ||
| 35 | self::assertSame(200, $response->getStatusCode()); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function testSendError() |
|
| 39 | { |
|
| 40 | $curl = $this->createMock(Curl::class); |
|
| 41 | $curl->method('errno')->willReturn(1); |
|
| 42 | $client = new CurlClient($curl); |
|
| 43 | ||
| 44 | $this->expectException(PostpayException::class); |
|
| 45 | $client->send(new Request('POST')); |
|
| 46 | } |
|
| 47 | ||
| 48 | public function testGetRequestHeaders() |
|
| 49 | { |
|