diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php index c3e382a85e7..787a6086c27 100755 --- a/test/phpunit/WebservicesOrdersTest.php +++ b/test/phpunit/WebservicesOrdersTest.php @@ -174,183 +174,5 @@ class WebservicesOrdersTest extends PHPUnit_Framework_TestCase return $result; } - - - /** - * testWSOtherGetVersions - * - * @return int - */ - public function testWSOtherGetVersions() - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - $WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_other.php'; - $WS_METHOD = 'getVersions'; - $ns='http://www.dolibarr.org/ns/'; - - // Set the WebService URL - print __METHOD__." create nusoap_client for URL=".$WS_DOL_URL."\n"; - $soapclient = new nusoap_client($WS_DOL_URL); - if ($soapclient) - { - $soapclient->soap_defencoding='UTF-8'; - $soapclient->decodeUTF8(false); - } - - // Call the WebService method and store its result in $result. - $authentication=array( - 'dolibarrkey'=>$conf->global->WEBSERVICES_KEY, - 'sourceapplication'=>'DEMO', - 'login'=>'admin', - 'password'=>'admin', - 'entity'=>''); - - // Test URL - $result=''; - if ($WS_METHOD) - { - $parameters = array('authentication'=>$authentication); - print __METHOD__." call method ".$WS_METHOD."\n"; - $result = $soapclient->call($WS_METHOD,$parameters,$ns,''); - if (! $result) - { - //var_dump($soapclient); - print $soapclient->error_str; - print "
\n\n"; - print $soapclient->request; - print "
\n\n"; - print $soapclient->response; - } - - print __METHOD__." result=".$result."\n"; - $this->assertEquals('OK',$result['result']['result_code']); - } - - return $result; - } - - - /** - * testWSThirdparty - * - * @return int - */ - public function testWSThirdparty() - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - $WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php'; - $WS_METHOD = ''; - $ns='http://www.dolibarr.org/ns/'; - - // Set the WebService URL - print __METHOD__."create nusoap_client for URL=".$WS_DOL_URL."\n"; - $soapclient = new nusoap_client($WS_DOL_URL); - if ($soapclient) - { - $soapclient->soap_defencoding='UTF-8'; - $soapclient->decodeUTF8(false); - } - - // Call the WebService method and store its result in $result. - $authentication=array( - 'dolibarrkey'=>$conf->global->WEBSERVICES_KEY, - 'sourceapplication'=>'DEMO', - 'login'=>'admin', - 'password'=>'admin', - 'entity'=>''); - - // Test URL - $result=''; - if ($WS_METHOD) - { - $parameters = array('authentication'=>$authentication); - print __METHOD__." call method ".$WS_METHOD."\n"; - $result = $soapclient->call($WS_METHOD,$parameters,$ns,''); - if (! $result) - { - //var_dump($soapclient); - print $soapclient->error_str; - print "
\n\n"; - print $soapclient->request; - print "
\n\n"; - print $soapclient->response; - } - - print __METHOD__." result=".$result."\n"; - $this->assertEquals('OK',$result['result']['result_code']); - } - - return $result; - } - - - /** - * testWSUser - * - * @return int - */ - public function testWSUser() - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - $WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_user.php'; - $WS_METHOD = ''; - $ns='http://www.dolibarr.org/ns/'; - - // Set the WebService URL - print __METHOD__." create nusoap_client for URL=".$WS_DOL_URL."\n"; - $soapclient = new nusoap_client($WS_DOL_URL); - if ($soapclient) - { - $soapclient->soap_defencoding='UTF-8'; - $soapclient->decodeUTF8(false); - } - - // Call the WebService method and store its result in $result. - $authentication=array( - 'dolibarrkey'=>$conf->global->WEBSERVICES_KEY, - 'sourceapplication'=>'DEMO', - 'login'=>'admin', - 'password'=>'admin', - 'entity'=>''); - - // Test URL - $result=''; - if ($WS_METHOD) - { - $parameters = array('authentication'=>$authentication); - print __METHOD__." call method ".$WS_METHOD."\n"; - $result = $soapclient->call($WS_METHOD,$parameters,$ns,''); - if (! $result) - { - //var_dump($soapclient); - print $soapclient->error_str; - print "
\n\n"; - print $soapclient->request; - print "
\n\n"; - print $soapclient->response; - } - - print __METHOD__." result=".$result."\n"; - //$this->assertEquals('OK',$result['result']['result_code']); - } - - return $result; - } - } ?> \ No newline at end of file