Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit 5176d6f

Browse files
committed
Merge branch 'hotfix/connection-establish'
2 parents 2f0e3a6 + 8a7726c commit 5176d6f

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

test/Client/CurlTest.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -513,21 +513,28 @@ public function testTimeoutWithStream()
513513

514514
/**
515515
* @see https://github.com/zendframework/zend-http/pull/184
516-
*
517516
*/
518517
public function testMustRemoveProxyConnectionEstablishedLine()
519518
{
520-
$this->client->setUri($this->baseuri . 'testProxyResponse.php');
519+
$proxy = getenv('TESTS_ZEND_HTTP_CLIENT_HTTP_PROXY');
520+
if (! $proxy) {
521+
$this->markTestSkipped('Proxy is not configured');
522+
}
521523

522-
$adapter = new Adapter\Curl();
524+
list($proxyHost, $proxyPort) = explode(':', $proxy);
523525

524-
$this->client->setAdapter($adapter);
526+
$this->client->setAdapter(new Adapter\Curl());
527+
$this->client->setOptions([
528+
'proxyhost' => $proxyHost,
529+
'proxyport' => $proxyPort,
530+
]);
531+
$this->client->setUri('https://framework.zend.com');
525532
$this->client->setMethod('GET');
526533
$this->client->send();
527534

528535
$response = $this->client->getResponse();
529536

530-
$this->assertEquals(200, $response->getStatusCode());
531-
$this->assertEquals('work', $response->getBody());
537+
$this->assertSame(200, $response->getStatusCode());
538+
$this->assertSame('HTTP/1.1 200 OK', trim(strstr($response, "\n", true)));
532539
}
533540
}

test/Client/_files/testProxyResponse.php

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)