|
@@ -67,7 +67,7 @@ class StreamContextFactoryTest extends \PHPUnit_Framework_TestCase
|
|
'proxy' => 'tcp://proxyserver.net:3128',
|
|
'proxy' => 'tcp://proxyserver.net:3128',
|
|
'request_fulluri' => true,
|
|
'request_fulluri' => true,
|
|
'method' => 'GET',
|
|
'method' => 'GET',
|
|
- 'header' => "Proxy-Authorization: Basic " . base64_encode('username:password') . "\r\n"
|
|
|
|
|
|
+ 'header' => array("Proxy-Authorization: Basic " . base64_encode('username:password'))
|
|
)), $options);
|
|
)), $options);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -75,14 +75,14 @@ class StreamContextFactoryTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
{
|
|
$_SERVER['http_proxy'] = 'http://username:password@proxyserver.net:3128/';
|
|
$_SERVER['http_proxy'] = 'http://username:password@proxyserver.net:3128/';
|
|
|
|
|
|
- $context = StreamContextFactory::getContext(array('http' => array('method' => 'GET', 'header' => "X-Foo: bar\r\n", 'request_fulluri' => false)));
|
|
|
|
|
|
+ $context = StreamContextFactory::getContext(array('http' => array('method' => 'GET', 'header' => array("X-Foo: bar"), 'request_fulluri' => false)));
|
|
$options = stream_context_get_options($context);
|
|
$options = stream_context_get_options($context);
|
|
|
|
|
|
$this->assertEquals(array('http' => array(
|
|
$this->assertEquals(array('http' => array(
|
|
'proxy' => 'tcp://proxyserver.net:3128',
|
|
'proxy' => 'tcp://proxyserver.net:3128',
|
|
'request_fulluri' => false,
|
|
'request_fulluri' => false,
|
|
'method' => 'GET',
|
|
'method' => 'GET',
|
|
- 'header' => "X-Foo: bar\r\nProxy-Authorization: Basic " . base64_encode('username:password') . "\r\n"
|
|
|
|
|
|
+ 'header' => array("X-Foo: bar", "Proxy-Authorization: Basic " . base64_encode('username:password'))
|
|
)), $options);
|
|
)), $options);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -97,7 +97,7 @@ class StreamContextFactoryTest extends \PHPUnit_Framework_TestCase
|
|
'proxy' => 'tcp://proxyserver.net:80',
|
|
'proxy' => 'tcp://proxyserver.net:80',
|
|
'request_fulluri' => true,
|
|
'request_fulluri' => true,
|
|
'method' => 'GET',
|
|
'method' => 'GET',
|
|
- 'header' => "Proxy-Authorization: Basic " . base64_encode('username:password') . "\r\n"
|
|
|
|
|
|
+ 'header' => array("Proxy-Authorization: Basic " . base64_encode('username:password'))
|
|
)), $options);
|
|
)), $options);
|
|
}
|
|
}
|
|
|
|
|