| @@ 55-70 (lines=16) @@ | ||
| 52 | /** |
|
| 53 | * @test |
|
| 54 | */ |
|
| 55 | public function canResolvePathWithNonLeadingSlash() |
|
| 56 | { |
|
| 57 | $query = ['foo' => 'bar']; |
|
| 58 | ||
| 59 | $this->mockClient() |
|
| 60 | ->request( |
|
| 61 | 'GET', |
|
| 62 | $this->url('/foo'), |
|
| 63 | ['query' => $query] |
|
| 64 | ) |
|
| 65 | ->willReturn($this->fooBarResponse()); |
|
| 66 | ||
| 67 | $data = $this->client->get('foo', $query); |
|
| 68 | ||
| 69 | $this->assertFooBarResponse($data); |
|
| 70 | } |
|
| 71 | ||
| 72 | ||
| 73 | /** |
|
| @@ 85-100 (lines=16) @@ | ||
| 82 | /** |
|
| 83 | * @test |
|
| 84 | */ |
|
| 85 | public function canMakeGetRequests() |
|
| 86 | { |
|
| 87 | $query = ['foo' => 'bar']; |
|
| 88 | ||
| 89 | $this->mockClient()->request( |
|
| 90 | 'GET', |
|
| 91 | $this->url('/foo'), |
|
| 92 | [ |
|
| 93 | 'query' => $query, |
|
| 94 | ] |
|
| 95 | )->willReturn($this->fooBarResponse()); |
|
| 96 | ||
| 97 | $data = $this->client->get('/foo', $query); |
|
| 98 | ||
| 99 | $this->assertFooBarResponse($data); |
|
| 100 | } |
|
| 101 | ||
| 102 | /** |
|
| 103 | * @test |
|
| @@ 151-166 (lines=16) @@ | ||
| 148 | /** |
|
| 149 | * @test |
|
| 150 | */ |
|
| 151 | public function canMakePostRequests() |
|
| 152 | { |
|
| 153 | $postData = ['foo' => 'bar']; |
|
| 154 | ||
| 155 | $this->mockClient()->request( |
|
| 156 | 'POST', |
|
| 157 | $this->url('/foo'), |
|
| 158 | [ |
|
| 159 | 'form_params' => $postData, |
|
| 160 | ] |
|
| 161 | )->willReturn($this->fooBarResponse()); |
|
| 162 | ||
| 163 | $data = $this->client->post('/foo', $postData); |
|
| 164 | ||
| 165 | $this->assertFooBarResponse($data); |
|
| 166 | } |
|
| 167 | ||
| 168 | /** |
|
| 169 | * @test |
|
| @@ 171-186 (lines=16) @@ | ||
| 168 | /** |
|
| 169 | * @test |
|
| 170 | */ |
|
| 171 | public function canMakePutRequest() |
|
| 172 | { |
|
| 173 | $putData = ['foo' => 'bar']; |
|
| 174 | ||
| 175 | $this->mockClient()->request( |
|
| 176 | 'PUT', |
|
| 177 | $this->url('/foo'), |
|
| 178 | [ |
|
| 179 | 'json' => $putData, |
|
| 180 | ] |
|
| 181 | )->willReturn($this->fooBarResponse()); |
|
| 182 | ||
| 183 | $data = $this->client->put('/foo', $putData); |
|
| 184 | ||
| 185 | $this->assertFooBarResponse($data); |
|
| 186 | } |
|
| 187 | ||
| 188 | /** |
|
| 189 | * @test |
|