public function testProperlyHandlesRedirectHeaders() { $rawHeader = $this->fakeRawRedirectHeader . $this->fakeRawHeader; $this->curlMock->shouldReceive('getinfo')->with(CURLINFO_HEADER_SIZE)->once()->andReturn(mb_strlen($rawHeader)); $this->curlMock->shouldReceive('version')->once()->andReturn(['version_number' => self::CURL_VERSION_STABLE]); $this->curlMock->shouldReceive('exec')->once()->andReturn($rawHeader . $this->fakeRawBody); $this->curlClient->sendRequest(); list($rawHeaders, $rawBody) = $this->curlClient->extractResponseHeadersAndBody(); $this->assertEquals($rawHeaders, trim($rawHeader)); $this->assertEquals($rawBody, $this->fakeRawBody); }