public function testUsesProxyEnvironmentVariables() { $http = getenv('HTTP_PROXY'); $https = getenv('HTTPS_PROXY'); $client = new Client(); $this->assertNull($client->getDefaultOption('proxy')); putenv('HTTP_PROXY=127.0.0.1'); $client = new Client(); $this->assertEquals(['http' => '127.0.0.1'], $client->getDefaultOption('proxy')); putenv('HTTPS_PROXY=127.0.0.2'); $client = new Client(); $this->assertEquals(['http' => '127.0.0.1', 'https' => '127.0.0.2'], $client->getDefaultOption('proxy')); putenv("HTTP_PROXY={$http}"); putenv("HTTPS_PROXY={$https}"); }