Several WS and CS fixes

This commit is contained in:
Andreas Schamberger 2012-01-15 11:42:21 +01:00
parent efc6500ead
commit 7f96a20f66
9 changed files with 38 additions and 27 deletions

View File

@ -77,7 +77,7 @@ class SoapClient extends \SoapClient
private $lastResponse = ''; private $lastResponse = '';
/** /**
* Last response. * Soap kernel.
* *
* @var \BeSimple\SoapCommon\SoapKernel * @var \BeSimple\SoapCommon\SoapKernel
*/ */

View File

@ -13,6 +13,7 @@
namespace BeSimple\SoapClient; namespace BeSimple\SoapClient;
use BeSimple\SoapCommon\AbstractSoapBuilder; use BeSimple\SoapCommon\AbstractSoapBuilder;
use BeSimple\SoapCommon\Helper;
/** /**
* Fluent interface builder for SoapClient instance. * Fluent interface builder for SoapClient instance.

View File

@ -5,7 +5,21 @@ use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
require '../bootstrap.php'; require '../bootstrap.php';
echo '<pre>'; class base64Binary
{
public $_;
public $contentType;
}
class AttachmentType
{
public $fileName;
public $binaryData;
}
class AttachmentRequest extends AttachmentType
{
}
$options = array( $options = array(
'soap_version' => SOAP_1_1, 'soap_version' => SOAP_1_1,

View File

@ -5,8 +5,6 @@ use BeSimple\SoapClient\SoapClient as BeSimpleSoapClient;
require '../bootstrap.php'; require '../bootstrap.php';
echo '<pre>';
$options = array( $options = array(
'soap_version' => SOAP_1_1, 'soap_version' => SOAP_1_1,
'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

View File

@ -5,8 +5,6 @@ use BeSimple\SoapClient\WsAddressingFilter as BeSimpleWsAddressingFilter;
require '../bootstrap.php'; require '../bootstrap.php';
echo '<pre>';
$options = array( $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

View File

@ -5,8 +5,6 @@ use BeSimple\SoapClient\WsSecurityFilter as BeSimpleWsSecurityFilter;
require '../bootstrap.php'; require '../bootstrap.php';
echo '<pre>';
$options = array( $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

View File

@ -23,11 +23,12 @@ class CurlTest extends \PHPUnit_Framework_TestCase
protected function startPhpWebserver() protected function startPhpWebserver()
{ {
if ('Windows' == substr(php_uname('s'), 0, 7 )) { $dir = __DIR__.DIRECTORY_SEPARATOR.'Fixtures';
$powershellCommand = "\$app = start-process php.exe -ArgumentList '-S localhost:8000 -t ".__DIR__.DIRECTORY_SEPARATOR."Fixtures' -WindowStyle 'Hidden' -passthru; Echo \$app.Id;"; if ('Windows' == substr(php_uname('s'), 0, 7)) {
$powershellCommand = "\$app = start-process php.exe -ArgumentList '-S localhost:8000 -t ".$dir."' -WindowStyle 'Hidden' -passthru; Echo \$app.Id;";
$shellCommand = 'powershell -command "& {'.$powershellCommand.'}"'; $shellCommand = 'powershell -command "& {'.$powershellCommand.'}"';
} else { } else {
$shellCommand = "nohup php -S localhost:8000 -t ".__DIR__.DIRECTORY_SEPARATOR."Fixtures &"; $shellCommand = "nohup php -S localhost:8000 -t ".$dir." &";
} }
$output = array(); $output = array();
exec($shellCommand, $output); exec($shellCommand, $output);

View File

@ -24,11 +24,12 @@ class WsdlDownloaderTest extends \PHPUnit_Framework_TestCase
protected function startPhpWebserver() protected function startPhpWebserver()
{ {
if ('Windows' == substr(php_uname('s'), 0, 7 )) { $dir = __DIR__.DIRECTORY_SEPARATOR.'Fixtures';
$powershellCommand = "\$app = start-process php.exe -ArgumentList '-S localhost:8000 -t ".__DIR__.DIRECTORY_SEPARATOR."Fixtures' -WindowStyle 'Hidden' -passthru; Echo \$app.Id;"; if ('Windows' == substr(php_uname('s'), 0, 7)) {
$powershellCommand = "\$app = start-process php.exe -ArgumentList '-S localhost:8000 -t ".$dir."' -WindowStyle 'Hidden' -passthru; Echo \$app.Id;";
$shellCommand = 'powershell -command "& {'.$powershellCommand.'}"'; $shellCommand = 'powershell -command "& {'.$powershellCommand.'}"';
} else { } else {
$shellCommand = "nohup php -S localhost:8000 -t ".__DIR__.DIRECTORY_SEPARATOR."Fixtures &"; $shellCommand = "nohup php -S localhost:8000 -t ".$dir." &";
} }
$output = array(); $output = array();
exec($shellCommand, $output); exec($shellCommand, $output);
@ -38,7 +39,7 @@ class WsdlDownloaderTest extends \PHPUnit_Framework_TestCase
protected function stopPhpWebserver() protected function stopPhpWebserver()
{ {
if (!is_null($this->webserverProcessId)) { if (!is_null($this->webserverProcessId)) {
if ('Windows' == substr(php_uname('s'), 0, 7 )) { if ('Windows' == substr(php_uname('s'), 0, 7)) {
exec('TASKKILL /F /PID ' . $this->webserverProcessId); exec('TASKKILL /F /PID ' . $this->webserverProcessId);
} else { } else {
exec('kill ' . $this->webserverProcessId); exec('kill ' . $this->webserverProcessId);
@ -57,7 +58,7 @@ class WsdlDownloaderTest extends \PHPUnit_Framework_TestCase
$cacheDir = ini_get('soap.wsdl_cache_dir'); $cacheDir = ini_get('soap.wsdl_cache_dir');
if (!is_dir($cacheDir)) { if (!is_dir($cacheDir)) {
$cacheDir = sys_get_temp_dir(); $cacheDir = sys_get_temp_dir();
$cacheDirForRegExp = preg_quote( $cacheDir ); $cacheDirForRegExp = preg_quote($cacheDir);
} }
$tests = array( $tests = array(
@ -82,7 +83,7 @@ class WsdlDownloaderTest extends \PHPUnit_Framework_TestCase
foreach ($tests as $name => $values) { foreach ($tests as $name => $values) {
$cacheFileName = $wd->download($values['source']); $cacheFileName = $wd->download($values['source']);
$result = file_get_contents($cacheFileName); $result = file_get_contents($cacheFileName);
$this->assertRegExp($values['assertRegExp'],$result,$name); $this->assertRegExp($values['assertRegExp'], $result, $name);
unlink($cacheFileName); unlink($cacheFileName);
} }
@ -129,7 +130,7 @@ class WsdlDownloaderTest extends \PHPUnit_Framework_TestCase
$cacheDir = ini_get('soap.wsdl_cache_dir'); $cacheDir = ini_get('soap.wsdl_cache_dir');
if (!is_dir($cacheDir)) { if (!is_dir($cacheDir)) {
$cacheDir = sys_get_temp_dir(); $cacheDir = sys_get_temp_dir();
$cacheDirForRegExp = preg_quote( $cacheDir ); $cacheDirForRegExp = preg_quote($cacheDir);
} }
$remoteUrlAbsolute = 'http://localhost:8000/wsdlinclude/wsdlinctest_absolute.xml'; $remoteUrlAbsolute = 'http://localhost:8000/wsdlinclude/wsdlinctest_absolute.xml';
@ -162,10 +163,10 @@ class WsdlDownloaderTest extends \PHPUnit_Framework_TestCase
); );
foreach ($tests as $name => $values) { foreach ($tests as $name => $values) {
$wsdl = file_get_contents( $values['source'] ); $wsdl = file_get_contents($values['source']);
$method->invoke($wd, $wsdl, $values['cacheFile'],$values['remoteParentUrl']); $method->invoke($wd, $wsdl, $values['cacheFile'], $values['remoteParentUrl']);
$result = file_get_contents($values['cacheFile']); $result = file_get_contents($values['cacheFile']);
$this->assertRegExp($values['assertRegExp'],$result,$name); $this->assertRegExp($values['assertRegExp'], $result, $name);
unlink($values['cacheFile']); unlink($values['cacheFile']);
} }
@ -186,7 +187,7 @@ class WsdlDownloaderTest extends \PHPUnit_Framework_TestCase
$cacheDir = ini_get('soap.wsdl_cache_dir'); $cacheDir = ini_get('soap.wsdl_cache_dir');
if (!is_dir($cacheDir)) { if (!is_dir($cacheDir)) {
$cacheDir = sys_get_temp_dir(); $cacheDir = sys_get_temp_dir();
$cacheDirForRegExp = preg_quote( $cacheDir ); $cacheDirForRegExp = preg_quote($cacheDir);
} }
$remoteUrlAbsolute = 'http://localhost:8000/xsdinclude/xsdinctest_absolute.xml'; $remoteUrlAbsolute = 'http://localhost:8000/xsdinclude/xsdinctest_absolute.xml';
@ -219,10 +220,10 @@ class WsdlDownloaderTest extends \PHPUnit_Framework_TestCase
); );
foreach ($tests as $name => $values) { foreach ($tests as $name => $values) {
$wsdl = file_get_contents( $values['source'] ); $wsdl = file_get_contents($values['source']);
$method->invoke($wd, $wsdl, $values['cacheFile'],$values['remoteParentUrl']); $method->invoke($wd, $wsdl, $values['cacheFile'], $values['remoteParentUrl']);
$result = file_get_contents($values['cacheFile']); $result = file_get_contents($values['cacheFile']);
$this->assertRegExp($values['assertRegExp'],$result,$name); $this->assertRegExp($values['assertRegExp'], $result, $name);
unlink($values['cacheFile']); unlink($values['cacheFile']);
} }