|
@@ 89-103 (lines=15) @@
|
| 86 |
|
/** |
| 87 |
|
* @group functional |
| 88 |
|
*/ |
| 89 |
|
public function testWithEnvironmentalProxy(): void |
| 90 |
|
{ |
| 91 |
|
$this->checkProxy($this->_getProxyUrl()); |
| 92 |
|
\putenv('http_proxy='.$this->_getProxyUrl().'/'); |
| 93 |
|
|
| 94 |
|
$client = $this->_getClient(); |
| 95 |
|
$transferInfo = $client->request('_nodes')->getTransferInfo(); |
| 96 |
|
$this->assertEquals(200, $transferInfo['http_code']); |
| 97 |
|
|
| 98 |
|
$client->getConnection()->setProxy(null); // will not change anything |
| 99 |
|
$transferInfo = $client->request('_nodes')->getTransferInfo(); |
| 100 |
|
$this->assertEquals(200, $transferInfo['http_code']); |
| 101 |
|
|
| 102 |
|
\putenv('http_proxy='); |
| 103 |
|
} |
| 104 |
|
|
| 105 |
|
/** |
| 106 |
|
* @group functional |
|
@@ 108-120 (lines=13) @@
|
| 105 |
|
/** |
| 106 |
|
* @group functional |
| 107 |
|
*/ |
| 108 |
|
public function testWithEnabledEnvironmentalProxy(): void |
| 109 |
|
{ |
| 110 |
|
$this->checkProxy($this->_getProxyUrl403()); |
| 111 |
|
\putenv('http_proxy='.$this->_getProxyUrl403().'/'); |
| 112 |
|
$client = $this->_getClient(); |
| 113 |
|
$transferInfo = $client->request('_nodes')->getTransferInfo(); |
| 114 |
|
$this->assertEquals(403, $transferInfo['http_code']); |
| 115 |
|
$client = $this->_getClient(); |
| 116 |
|
$client->getConnection()->setProxy(''); |
| 117 |
|
$transferInfo = $client->request('_nodes')->getTransferInfo(); |
| 118 |
|
$this->assertEquals(200, $transferInfo['http_code']); |
| 119 |
|
\putenv('http_proxy='); |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
/** |
| 123 |
|
* @group functional |