Fix warning

This commit is contained in:
Laurent Destailleur 2020-12-17 17:11:25 +01:00
parent eed14bd9af
commit c040002d6e
3 changed files with 9 additions and 11 deletions

View File

@ -255,8 +255,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n"; print __METHOD__." call method ".$WS_METHOD."\n";
try { try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, ''); $result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, '');
} catch (SoapFault $exception) } catch (SoapFault $exception) {
{
echo $exception; echo $exception;
$result=0; $result=0;
} }

View File

@ -202,7 +202,7 @@ class WebservicesProductsTest extends PHPUnit\Framework\TestCase
print "\n"; 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']); $this->assertEquals('OK', $result['result']['result_code']);
return $result['id']; return $result['id'];

View File

@ -56,8 +56,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase
protected $savdb; protected $savdb;
protected $soapclient; 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->savlangs=$langs;
$this->savdb=$db; $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 // Set the WebService URL
print __METHOD__." create nusoap_client for URL=".$this->_WS_DOL_URL."\n"; print __METHOD__." create nusoap_client for URL=".$WS_DOL_URL."\n";
$this->soapclient = new nusoap_client($this->_WS_DOL_URL); $this->soapclient = new nusoap_client($WS_DOL_URL);
if ($this->soapclient) { if ($this->soapclient) {
$this->soapclient->soap_defencoding='UTF-8'; $this->soapclient->soap_defencoding='UTF-8';
$this->soapclient->decodeUTF8(false); $this->soapclient->decodeUTF8(false);
@ -267,7 +266,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase
$parameters = array('authentication'=>$authentication, 'id'=>$id); $parameters = array('authentication'=>$authentication, 'id'=>$id);
print __METHOD__." call method ".$WS_METHOD."\n"; print __METHOD__." call method ".$WS_METHOD."\n";
try { try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->_ns, ''); $result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, '');
} catch (SoapFault $exception) { } catch (SoapFault $exception) {
echo $exception; echo $exception;
$result=0; $result=0;
@ -329,7 +328,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase
$parameters = array('authentication'=>$authentication, 'id'=>'', 'ref'=>'', 'ref_ext'=>'12'); $parameters = array('authentication'=>$authentication, 'id'=>'', 'ref'=>'', 'ref_ext'=>'12');
print __METHOD__." call method ".$WS_METHOD."\n"; print __METHOD__." call method ".$WS_METHOD."\n";
try { try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->_ns, ''); $result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, '');
} catch (SoapFault $exception) { } catch (SoapFault $exception) {
echo $exception; echo $exception;
$result=0; $result=0;
@ -389,7 +388,7 @@ class WebservicesThirdpartyTest extends PHPUnit\Framework\TestCase
$parameters = array('authentication'=>$authentication, 'id'=>$id, 'ref'=>'', 'ref_ext'=>''); $parameters = array('authentication'=>$authentication, 'id'=>$id, 'ref'=>'', 'ref_ext'=>'');
print __METHOD__." call method ".$WS_METHOD."\n"; print __METHOD__." call method ".$WS_METHOD."\n";
try { try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->_ns, ''); $result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, '');
} catch (SoapFault $exception) { } catch (SoapFault $exception) {
echo $exception; echo $exception;
$result=0; $result=0;