1
0
Fork 0

Fix tests

pull/1773/merge
Jordi Boggiano 2013-04-05 12:58:50 +02:00
parent 9a69886a92
commit 784dd0aad0
1 changed files with 14 additions and 6 deletions

View File

@ -45,11 +45,11 @@ class StreamContextFactoryTest extends \PHPUnit_Framework_TestCase
{ {
return array( return array(
array( array(
array(), array(), $a = array('http' => array('follow_location' => 1, 'max_redirects' => 20)), array(),
array('options' => array()), array() array('options' => $a), array()
), ),
array( array(
$a = array('http' => array('method' => 'GET')), $a, $a = array('http' => array('method' => 'GET', 'max_redirects' => 20, 'follow_location' => 1)), array('http' => array('method' => 'GET')),
array('options' => $a, 'notification' => $f = function() {}), array('notification' => $f) array('options' => $a, 'notification' => $f = function() {}), array('notification' => $f)
), ),
); );
@ -67,7 +67,9 @@ 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' => array("Proxy-Authorization: Basic " . base64_encode('username:password')) 'header' => array("Proxy-Authorization: Basic " . base64_encode('username:password')),
'max_redirects' => 20,
'follow_location' => 1,
)), $options); )), $options);
} }
@ -82,7 +84,9 @@ class StreamContextFactoryTest extends \PHPUnit_Framework_TestCase
'proxy' => 'tcp://proxyserver.net:3128', 'proxy' => 'tcp://proxyserver.net:3128',
'request_fulluri' => false, 'request_fulluri' => false,
'method' => 'GET', 'method' => 'GET',
'header' => array("X-Foo: bar", "Proxy-Authorization: Basic " . base64_encode('username:password')) 'header' => array("X-Foo: bar", "Proxy-Authorization: Basic " . base64_encode('username:password')),
'max_redirects' => 20,
'follow_location' => 1,
)), $options); )), $options);
} }
@ -97,7 +101,9 @@ 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' => array("Proxy-Authorization: Basic " . base64_encode('username:password')) 'header' => array("Proxy-Authorization: Basic " . base64_encode('username:password')),
'max_redirects' => 20,
'follow_location' => 1,
)), $options); )), $options);
} }
@ -115,6 +121,8 @@ class StreamContextFactoryTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array('http' => array( $this->assertEquals(array('http' => array(
'proxy' => $expected, 'proxy' => $expected,
'request_fulluri' => true, 'request_fulluri' => true,
'max_redirects' => 20,
'follow_location' => 1,
)), $options); )), $options);
} else { } else {
try { try {