[SoapClient] Fixed tests if proxy exists in environment variables

This commit is contained in:
Francis Besset 2014-08-18 10:29:49 +02:00
parent 29170576c2
commit 33d641de4e
11 changed files with 35 additions and 14 deletions

View File

@ -28,6 +28,7 @@ class MtomAxisInteropTest extends TestCase
'base64Binary' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\base64Binary', 'base64Binary' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\base64Binary',
'AttachmentRequest' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\AttachmentRequest', 'AttachmentRequest' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\AttachmentRequest',
), ),
'proxy_host' => false,
); );
public function testAttachment() public function testAttachment()

View File

@ -37,6 +37,7 @@ class SwaAxisInteropTest extends TestCase
'uploadFile' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\uploadFile', 'uploadFile' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\uploadFile',
'uploadFileResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\uploadFileResponse', 'uploadFileResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\uploadFileResponse',
), ),
'proxy_host' => false,
); );
public function testUploadDownloadText() public function testUploadDownloadText()

View File

@ -32,6 +32,7 @@ class WsAddressingAxisInteropTest extends TestCase
private $options = array( private $options = array(
'soap_version' => SOAP_1_2, 'soap_version' => SOAP_1_2,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
'proxy_host' => false,
); );
public function testSession() public function testSession()

View File

@ -64,6 +64,7 @@ class WsSecuritySigEncAxisInteropTest extends TestCase
'addBookResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBookResponse', 'addBookResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBookResponse',
'BookInformation' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\BookInformation', 'BookInformation' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\BookInformation',
), ),
'proxy_host' => false,
); );
public function testSigEnc() public function testSigEnc()

View File

@ -40,6 +40,7 @@ class WsSecurityUserPassAxisInteropTest extends TestCase
'addBookResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBookResponse', 'addBookResponse' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\addBookResponse',
'BookInformation' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\BookInformation', 'BookInformation' => 'BeSimple\SoapClient\Tests\AxisInterop\Fixtures\BookInformation',
), ),
'proxy_host' => false,
); );
public function testUserPassText() public function testUserPassText()

View File

@ -74,7 +74,9 @@ class CurlTest extends AbstractWebserverTest
public function testGetResponseBody() public function testGetResponseBody()
{ {
$curl = new Curl(); $curl = new Curl(array(
'proxy_host' => false,
));
$curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT)); $curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT));
$this->assertEquals('This is a testfile for cURL.', $curl->getResponseBody()); $this->assertEquals('This is a testfile for cURL.', $curl->getResponseBody());
@ -82,7 +84,9 @@ class CurlTest extends AbstractWebserverTest
public function testGetResponseContentType() public function testGetResponseContentType()
{ {
$curl = new Curl(); $curl = new Curl(array(
'proxy_host' => false,
));
$curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT)); $curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT));
$this->assertEquals('text/plain; charset=UTF-8', $curl->getResponseContentType()); $this->assertEquals('text/plain; charset=UTF-8', $curl->getResponseContentType());
@ -93,7 +97,9 @@ class CurlTest extends AbstractWebserverTest
public function testGetResponseHeaders() public function testGetResponseHeaders()
{ {
$curl = new Curl(); $curl = new Curl(array(
'proxy_host' => false,
));
$curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT)); $curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT));
$this->assertEquals(117 + self::$websererPortLength, strlen($curl->getResponseHeaders())); $this->assertEquals(117 + self::$websererPortLength, strlen($curl->getResponseHeaders()));
@ -104,7 +110,9 @@ class CurlTest extends AbstractWebserverTest
public function testGetResponseStatusCode() public function testGetResponseStatusCode()
{ {
$curl = new Curl(); $curl = new Curl(array(
'proxy_host' => false,
));
$curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT)); $curl->exec(sprintf('http://localhost:%d/curl.txt', WEBSERVER_PORT));
$this->assertEquals(200, $curl->getResponseStatusCode()); $this->assertEquals(200, $curl->getResponseStatusCode());

View File

@ -20,6 +20,7 @@ class MtomServerInteropTest extends TestCase
'base64Binary' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\base64Binary', 'base64Binary' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\base64Binary',
'AttachmentRequest' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\AttachmentRequest', 'AttachmentRequest' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\AttachmentRequest',
), ),
'proxy_host' => false,
); );
public function testAttachment() public function testAttachment()

View File

@ -23,6 +23,7 @@ class SwaServerInteropTest extends TestCase
'uploadFile' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFile', 'uploadFile' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFile',
'uploadFileResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFileResponse', 'uploadFileResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\uploadFileResponse',
), ),
'proxy_host' => false,
); );
public function testUploadDownloadText() public function testUploadDownloadText()

View File

@ -30,6 +30,7 @@ class WsSecuritySigEncServerInteropTest extends TestCase
'addBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse', 'addBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse',
'BookInformation' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation', 'BookInformation' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation',
), ),
'proxy_host' => false,
); );
public function testSigEnc() public function testSigEnc()

View File

@ -29,6 +29,7 @@ class WsSecurityUserPassServerInteropTest extends TestCase
'addBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse', 'addBookResponse' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\addBookResponse',
'BookInformation' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation', 'BookInformation' => 'BeSimple\SoapClient\Tests\ServerInterop\Fixtures\BookInformation',
), ),
'proxy_host' => false,
); );
public function testUserPassText() public function testUserPassText()

View File

@ -115,7 +115,9 @@ class WsdlDownloaderTest extends AbstractWebserverTest
Cache::setDirectory($wsdlCacheUrl); Cache::setDirectory($wsdlCacheUrl);
$cacheDirForRegExp = preg_quote($wsdlCacheUrl, '#'); $cacheDirForRegExp = preg_quote($wsdlCacheUrl, '#');
$wsdlDownloader = new WsdlDownloader(new Curl()); $wsdlDownloader = new WsdlDownloader(new Curl(array(
'proxy_host' => false,
)));
$r = new \ReflectionClass($wsdlDownloader); $r = new \ReflectionClass($wsdlDownloader);
$m = $r->getMethod('resolveRemoteIncludes'); $m = $r->getMethod('resolveRemoteIncludes');
$m->setAccessible(true); $m->setAccessible(true);
@ -178,7 +180,9 @@ class WsdlDownloaderTest extends AbstractWebserverTest
Cache::setDirectory($wsdlCacheUrl); Cache::setDirectory($wsdlCacheUrl);
$cacheDirForRegExp = preg_quote($wsdlCacheUrl, '#'); $cacheDirForRegExp = preg_quote($wsdlCacheUrl, '#');
$wsdlDownloader = new WsdlDownloader(new Curl()); $wsdlDownloader = new WsdlDownloader(new Curl(array(
'proxy_host' => false,
)));
$r = new \ReflectionClass($wsdlDownloader); $r = new \ReflectionClass($wsdlDownloader);
$m = $r->getMethod('resolveRemoteIncludes'); $m = $r->getMethod('resolveRemoteIncludes');
$m->setAccessible(true); $m->setAccessible(true);