forked from Wavyzz/dolibarr
Fix phpunit
This commit is contained in:
@@ -146,7 +146,7 @@ class PaypalTest extends PHPUnit\Framework\TestCase
|
||||
$urltotest=getPaypalPaymentUrl(0, 'free');
|
||||
print "urltotest=".$urltotest."\n";
|
||||
|
||||
$result=getURLContent($urltotest, 'GET');
|
||||
$result=getURLContent($urltotest, 'GET', '', 1, array(), array('http', 'https'), 2);
|
||||
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertLessThanOrEqual($result, 0);
|
||||
|
||||
@@ -120,7 +120,7 @@ class RestAPIDocumentTest extends PHPUnit\Framework\TestCase
|
||||
$password = 'admin';
|
||||
$url = $this->api_url.'/login?login='.$login.'&password='.$password;
|
||||
// Call the API login method to save api_key for this test class
|
||||
$result = getURLContent($url, 'GET', '', 1, array());
|
||||
$result = getURLContent($url, 'GET', '', 1, array(), array('http', 'https'), 2);
|
||||
echo __METHOD__.' result = '.var_export($result, true)."\n";
|
||||
echo __METHOD__.' curl_error_no: '.$result['curl_error_no']."\n";
|
||||
$this->assertEquals($result['curl_error_no'], '');
|
||||
@@ -171,7 +171,7 @@ class RestAPIDocumentTest extends PHPUnit\Framework\TestCase
|
||||
'fileencoding'=>""
|
||||
);
|
||||
|
||||
$result = getURLContent($url, 'POST', $data, 1);
|
||||
$result = getURLContent($url, 'POST', $data, 1,array(), array('http', 'https'), 2);
|
||||
echo __METHOD__.' Result for sending document: '.var_export($result, true)."\n";
|
||||
echo __METHOD__.' curl_error_no: '.$result['curl_error_no']."\n";
|
||||
$object = json_decode($result['content'], true);
|
||||
@@ -192,7 +192,7 @@ class RestAPIDocumentTest extends PHPUnit\Framework\TestCase
|
||||
'fileencoding'=>""
|
||||
);
|
||||
|
||||
$result2 = getURLContent($url, 'POST', $data, 1);
|
||||
$result2 = getURLContent($url, 'POST', $data, 1, array(), array('http', 'https'), 2);
|
||||
echo __METHOD__.' Result for sending document: '.var_export($result2, true)."\n";
|
||||
echo __METHOD__.' curl_error_no: '.$result2['curl_error_no']."\n";
|
||||
$object2 = json_decode($result2['content'], true);
|
||||
|
||||
@@ -125,7 +125,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
|
||||
$password='admin';
|
||||
$url=$this->api_url.'/login?login='.$login.'&password='.$password;
|
||||
// Call the API login method to save api_key for this test class
|
||||
$result=getURLContent($url, 'GET', '', 1, array());
|
||||
$result=getURLContent($url, 'GET', '', 1, array(), array('http', 'https'), 2);
|
||||
print __METHOD__." result = ".var_export($result, true)."\n";
|
||||
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
|
||||
$this->assertEquals($result['curl_error_no'], '');
|
||||
@@ -163,7 +163,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
|
||||
//$addheaders=array('Content-Type: application/json');
|
||||
|
||||
print __METHOD__." Request GET url=".$url."\n";
|
||||
$result=getURLContent($url, 'GET', '', 1, array());
|
||||
$result=getURLContent($url, 'GET', '', 1, array(), array('http', 'https'), 2);
|
||||
//print __METHOD__." Result for unexisting user: ".var_export($result, true)."\n";
|
||||
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
|
||||
$this->assertEquals($result['curl_error_no'], '');
|
||||
@@ -174,7 +174,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
|
||||
$url = $this->api_url.'/users/1?api_key='.$this->api_key;
|
||||
|
||||
print __METHOD__." Request GET url=".$url."\n";
|
||||
$result=getURLContent($url, 'GET', '', 1, array());
|
||||
$result=getURLContent($url, 'GET', '', 1, array(), array('http', 'https'), 2);
|
||||
//print __METHOD__." Result for existing user user: ".var_export($result, true)."\n";
|
||||
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
|
||||
$this->assertEquals($result['curl_error_no'], '');
|
||||
@@ -203,7 +203,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
|
||||
$body = json_encode($bodyobj);
|
||||
|
||||
print __METHOD__." Request POST url=".$url."\n";
|
||||
$result=getURLContent($url, 'POST', $body, 1, $addheaders);
|
||||
$result=getURLContent($url, 'POST', $body, 1, $addheaders, array('http', 'https'), 2);
|
||||
//print __METHOD__." Result for creating incomplete user".var_export($result, true)."\n";
|
||||
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
|
||||
$this->assertEquals($result['curl_error_no'], '');
|
||||
@@ -221,7 +221,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
|
||||
);
|
||||
$body = json_encode($bodyobj);
|
||||
print __METHOD__." Request POST url=".$url."\n";
|
||||
$result=getURLContent($url, 'POST', $body, 1, $addheaders);
|
||||
$result=getURLContent($url, 'POST', $body, 1, $addheaders, array('http', 'https'), 2);
|
||||
print __METHOD__." Result code for creating user ".var_export($result, true)."\n";
|
||||
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
|
||||
$this->assertEquals($result['curl_error_no'], '');
|
||||
@@ -231,7 +231,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
|
||||
|
||||
// attempt to create duplicated user
|
||||
print __METHOD__." Request POST url=".$url."\n";
|
||||
$result=getURLContent($url, 'POST', $body, 1, $addheaders);
|
||||
$result=getURLContent($url, 'POST', $body, 1, $addheaders, array('http', 'https'), 2);
|
||||
//print __METHOD__." Result for creating duplicate user".var_export($result, true)."\n";
|
||||
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
|
||||
$this->assertEquals($result['curl_error_no'], '');
|
||||
|
||||
Reference in New Issue
Block a user