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