Code Duplication    Length = 14-14 lines in 4 locations

tests/HttpClients/FacebookCurlHttpClientTest.php 4 locations

@@ 164-177 (lines=14) @@
161
        $this->assertEquals($rawBody, $this->fakeRawBody);
162
    }
163
164
    public function testProperlyHandlesProxyHeaders()
165
    {
166
        $rawHeader = $this->fakeRawProxyHeader . $this->fakeRawHeader;
167
        $this->curlMock
168
            ->shouldReceive('exec')
169
            ->once()
170
            ->andReturn($rawHeader . $this->fakeRawBody);
171
172
        $this->curlClient->sendRequest();
173
        list($rawHeaders, $rawBody) = $this->curlClient->extractResponseHeadersAndBody();
174
175
        $this->assertEquals($rawHeaders, trim($rawHeader));
176
        $this->assertEquals($rawBody, $this->fakeRawBody);
177
    }
178
179
    public function testProperlyHandlesProxyHeadersWithCurlBug()
180
    {
@@ 179-192 (lines=14) @@
176
        $this->assertEquals($rawBody, $this->fakeRawBody);
177
    }
178
179
    public function testProperlyHandlesProxyHeadersWithCurlBug()
180
    {
181
        $rawHeader = $this->fakeRawProxyHeader . $this->fakeRawHeader;
182
        $this->curlMock
183
            ->shouldReceive('exec')
184
            ->once()
185
            ->andReturn($rawHeader . $this->fakeRawBody);
186
187
        $this->curlClient->sendRequest();
188
        list($rawHeaders, $rawBody) = $this->curlClient->extractResponseHeadersAndBody();
189
190
        $this->assertEquals($rawHeaders, trim($rawHeader));
191
        $this->assertEquals($rawBody, $this->fakeRawBody);
192
    }
193
194
    public function testProperlyHandlesProxyHeadersWithCurlBug2()
195
    {
@@ 194-207 (lines=14) @@
191
        $this->assertEquals($rawBody, $this->fakeRawBody);
192
    }
193
194
    public function testProperlyHandlesProxyHeadersWithCurlBug2()
195
    {
196
        $rawHeader = $this->fakeRawProxyHeader2 . $this->fakeRawHeader;
197
        $this->curlMock
198
            ->shouldReceive('exec')
199
            ->once()
200
            ->andReturn($rawHeader . $this->fakeRawBody);
201
202
        $this->curlClient->sendRequest();
203
        list($rawHeaders, $rawBody) = $this->curlClient->extractResponseHeadersAndBody();
204
205
        $this->assertEquals($rawHeaders, trim($rawHeader));
206
        $this->assertEquals($rawBody, $this->fakeRawBody);
207
    }
208
209
    public function testProperlyHandlesRedirectHeaders()
210
    {
@@ 209-222 (lines=14) @@
206
        $this->assertEquals($rawBody, $this->fakeRawBody);
207
    }
208
209
    public function testProperlyHandlesRedirectHeaders()
210
    {
211
        $rawHeader = $this->fakeRawRedirectHeader . $this->fakeRawHeader;
212
        $this->curlMock
213
            ->shouldReceive('exec')
214
            ->once()
215
            ->andReturn($rawHeader . $this->fakeRawBody);
216
217
        $this->curlClient->sendRequest();
218
        list($rawHeaders, $rawBody) = $this->curlClient->extractResponseHeadersAndBody();
219
220
        $this->assertEquals($rawHeaders, trim($rawHeader));
221
        $this->assertEquals($rawBody, $this->fakeRawBody);
222
    }
223
224
    public function testCanSendNormalRequest()
225
    {