|
@@ 73-81 (lines=9) @@
|
| 70 |
|
/** |
| 71 |
|
* @dataProvider fetchDataProvider |
| 72 |
|
*/ |
| 73 |
|
public function testFetchWithCA($url, array $params){ |
| 74 |
|
$this->response = $this->requestWithCA->fetch(new URL($url, $params)); |
| 75 |
|
|
| 76 |
|
$this->assertEquals(0, $this->response->error->code); |
| 77 |
|
$this->assertEquals(200, $this->response->info->http_code); |
| 78 |
|
$this->assertEquals('*', $this->response->headers->{'access-control-allow-origin'}); |
| 79 |
|
$this->assertEquals(self::GW2_ACC_ID, $this->response->json->id); |
| 80 |
|
$this->assertEquals('application/json; charset=utf-8', $this->response->body->content_type); |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
/** |
| 84 |
|
* @dataProvider fetchDataProvider |
|
@@ 86-94 (lines=9) @@
|
| 83 |
|
/** |
| 84 |
|
* @dataProvider fetchDataProvider |
| 85 |
|
*/ |
| 86 |
|
public function testFetchNoCA($url, array $params){ |
| 87 |
|
$this->response = $this->requestNoCA->fetch(new URL($url, $params)); |
| 88 |
|
|
| 89 |
|
$this->assertEquals(0, $this->response->error->code); |
| 90 |
|
$this->assertEquals(200, $this->response->info->http_code); |
| 91 |
|
$this->assertEquals('*', $this->response->headers->{'access-control-allow-origin'}); |
| 92 |
|
$this->assertEquals(self::GW2_ACC_ID, $this->response->json->id); |
| 93 |
|
$this->assertEquals('application/json; charset=utf-8', $this->response->body->content_type); |
| 94 |
|
} |
| 95 |
|
|
| 96 |
|
/** |
| 97 |
|
* @expectedException \chillerlan\TinyCurl\RequestException |