diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index 428db9e8ef5..650e391587b 100644 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -255,8 +255,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase print __METHOD__." call method ".$WS_METHOD."\n"; try { $result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, ''); - } catch (SoapFault $exception) - { + } catch (SoapFault $exception) { echo $exception; $result=0; } diff --git a/test/phpunit/WebservicesProductsTest.php b/test/phpunit/WebservicesProductsTest.php index 132f3363608..7b90fcbbd88 100644 --- a/test/phpunit/WebservicesProductsTest.php +++ b/test/phpunit/WebservicesProductsTest.php @@ -202,7 +202,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase print "\n"; } - print __METHOD__." count(result)=".count($result)."\n"; + print __METHOD__." count(result)=".(is_array($result) ? count($result) : '')."\n"; $this->assertEquals('OK', $result['result']['result_code']); return $result['id']; diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index 285fc6d5ddb..cf56066ba6a 100644 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -56,8 +56,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase protected $savdb; protected $soapclient; - private $_WS_DOL_URL; - private $_ns='http://www.dolibarr.org/ns/'; + private $ns='http://www.dolibarr.org/ns/'; @@ -79,11 +78,11 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase $this->savlangs=$langs; $this->savdb=$db; - $this->_WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php'; + $WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php'; // Set the WebService URL - print __METHOD__." create nusoap_client for URL=".$this->_WS_DOL_URL."\n"; - $this->soapclient = new nusoap_client($this->_WS_DOL_URL); + print __METHOD__." create nusoap_client for URL=".$WS_DOL_URL."\n"; + $this->soapclient = new nusoap_client($WS_DOL_URL); if ($this->soapclient) { $this->soapclient->soap_defencoding='UTF-8'; $this->soapclient->decodeUTF8(false); @@ -267,7 +266,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase $parameters = array('authentication'=>$authentication, 'id'=>$id); print __METHOD__." call method ".$WS_METHOD."\n"; try { - $result = $this->soapclient->call($WS_METHOD, $parameters, $this->_ns, ''); + $result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, ''); } catch (SoapFault $exception) { echo $exception; $result=0; @@ -329,7 +328,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase $parameters = array('authentication'=>$authentication, 'id'=>'', 'ref'=>'', 'ref_ext'=>'12'); print __METHOD__." call method ".$WS_METHOD."\n"; try { - $result = $this->soapclient->call($WS_METHOD, $parameters, $this->_ns, ''); + $result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, ''); } catch (SoapFault $exception) { echo $exception; $result=0; @@ -389,7 +388,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase $parameters = array('authentication'=>$authentication, 'id'=>$id, 'ref'=>'', 'ref_ext'=>''); print __METHOD__." call method ".$WS_METHOD."\n"; try { - $result = $this->soapclient->call($WS_METHOD, $parameters, $this->_ns, ''); + $result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, ''); } catch (SoapFault $exception) { echo $exception; $result=0;