|
@@ 53-68 (lines=16) @@
|
| 50 |
|
$this->assertEquals('application/json', $responseData->headers->{'Accept'}); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function testPost() |
| 54 |
|
{ |
| 55 |
|
$url = $this->baseUrl . '/post?a=1'; |
| 56 |
|
|
| 57 |
|
$response = JCRequest::post($url, $this->params, $this->headers); |
| 58 |
|
$this->assertEquals(200, $response->status()); |
| 59 |
|
|
| 60 |
|
$responseData = $response->json(); |
| 61 |
|
$this->assertEquals('https://httpbin.org/post?a=1', $responseData->url); |
| 62 |
|
$this->assertEquals(1, $responseData->args->a); |
| 63 |
|
$this->assertEquals(2, $responseData->form->b); |
| 64 |
|
$this->assertEquals(3, $responseData->form->c); |
| 65 |
|
|
| 66 |
|
$this->assertEquals('Jared Chu', $responseData->headers->{'User-Agent'}); |
| 67 |
|
$this->assertEquals('application/json', $responseData->headers->{'Accept'}); |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
public function testPut() |
| 71 |
|
{ |
|
@@ 70-85 (lines=16) @@
|
| 67 |
|
$this->assertEquals('application/json', $responseData->headers->{'Accept'}); |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
public function testPut() |
| 71 |
|
{ |
| 72 |
|
$url = $this->baseUrl . '/put?a=1'; |
| 73 |
|
|
| 74 |
|
$response = JCRequest::put($url, $this->params, $this->headers); |
| 75 |
|
$this->assertEquals(200, $response->status()); |
| 76 |
|
|
| 77 |
|
$responseData = $response->json(); |
| 78 |
|
$this->assertEquals('https://httpbin.org/put?a=1', $responseData->url); |
| 79 |
|
$this->assertEquals(1, $responseData->args->a); |
| 80 |
|
$this->assertEquals(2, $responseData->form->b); |
| 81 |
|
$this->assertEquals(3, $responseData->form->c); |
| 82 |
|
|
| 83 |
|
$this->assertEquals('Jared Chu', $responseData->headers->{'User-Agent'}); |
| 84 |
|
$this->assertEquals('application/json', $responseData->headers->{'Accept'}); |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
public function testPatch() |
| 88 |
|
{ |
|
@@ 87-102 (lines=16) @@
|
| 84 |
|
$this->assertEquals('application/json', $responseData->headers->{'Accept'}); |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
public function testPatch() |
| 88 |
|
{ |
| 89 |
|
$url = $this->baseUrl . '/patch?a=1'; |
| 90 |
|
|
| 91 |
|
$response = JCRequest::patch($url, $this->params, $this->headers); |
| 92 |
|
$this->assertEquals(200, $response->status()); |
| 93 |
|
|
| 94 |
|
$responseData = $response->json(); |
| 95 |
|
$this->assertEquals('https://httpbin.org/patch?a=1', $responseData->url); |
| 96 |
|
$this->assertEquals(1, $responseData->args->a); |
| 97 |
|
$this->assertEquals(2, $responseData->form->b); |
| 98 |
|
$this->assertEquals(3, $responseData->form->c); |
| 99 |
|
|
| 100 |
|
$this->assertEquals('Jared Chu', $responseData->headers->{'User-Agent'}); |
| 101 |
|
$this->assertEquals('application/json', $responseData->headers->{'Accept'}); |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
public function testDelete() |
| 105 |
|
{ |
|
@@ 104-119 (lines=16) @@
|
| 101 |
|
$this->assertEquals('application/json', $responseData->headers->{'Accept'}); |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
public function testDelete() |
| 105 |
|
{ |
| 106 |
|
$url = $this->baseUrl . '/delete?a=1'; |
| 107 |
|
|
| 108 |
|
$response = JCRequest::delete($url, $this->params, $this->headers); |
| 109 |
|
$this->assertEquals(200, $response->status()); |
| 110 |
|
|
| 111 |
|
$responseData = $response->json(); |
| 112 |
|
$this->assertEquals('https://httpbin.org/delete?a=1', $responseData->url); |
| 113 |
|
$this->assertEquals(1, $responseData->args->a); |
| 114 |
|
$this->assertEquals(2, $responseData->form->b); |
| 115 |
|
$this->assertEquals(3, $responseData->form->c); |
| 116 |
|
|
| 117 |
|
$this->assertEquals('Jared Chu', $responseData->headers->{'User-Agent'}); |
| 118 |
|
$this->assertEquals('application/json', $responseData->headers->{'Accept'}); |
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
public function testHead() |
| 122 |
|
{ |