2
0
forked from Wavyzz/dolibarr

Log for debug

This commit is contained in:
Laurent Destailleur
2020-12-24 01:53:36 +01:00
parent 88e441412c
commit e590fb36ad

View File

@@ -164,11 +164,11 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
print __METHOD__." Request GET url=".$url."\n"; print __METHOD__." Request GET url=".$url."\n";
$result=getURLContent($url, 'GET', '', 1, array(), array('http', 'https'), 2); $result=getURLContent($url, 'GET', '', 1, array(), array('http', 'https'), 2);
//print __METHOD__." Result for unexisting user: ".var_export($result, true)."\n"; print __METHOD__." result for get on unexisting user: ".var_export($result, true)."\n";
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n"; print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
$this->assertEquals($result['curl_error_no'], ''); $this->assertEquals($result['curl_error_no'], '');
$object=json_decode($result['content'], true); $object=json_decode($result['content'], true);
$this->assertNotNull($object, "Parsing of json result must no be null"); $this->assertNotNull($object, "Parsing of json result must not be null");
$this->assertEquals(404, $object['error']['code']); $this->assertEquals(404, $object['error']['code']);
$url = $this->api_url.'/users/1?api_key='.$this->api_key; $url = $this->api_url.'/users/1?api_key='.$this->api_key;
@@ -179,7 +179,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n"; print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
$this->assertEquals($result['curl_error_no'], ''); $this->assertEquals($result['curl_error_no'], '');
$object=json_decode($result['content'], true); $object=json_decode($result['content'], true);
$this->assertNotNull($object, "Parsing of json result must no be null"); $this->assertNotNull($object, "Parsing of json result must not be null");
$this->assertEquals(1, $object['statut']); $this->assertEquals(1, $object['statut']);
} }
@@ -222,7 +222,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
$body = json_encode($bodyobj); $body = json_encode($bodyobj);
print __METHOD__." Request POST url=".$url."\n"; print __METHOD__." Request POST url=".$url."\n";
$result=getURLContent($url, 'POST', $body, 1, $addheaders, array('http', 'https'), 2); $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__." rclsesult code for creating user ".var_export($result, true)."\n";
print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n"; print __METHOD__." curl_error_no: ".$result['curl_error_no']."\n";
$this->assertEquals($result['curl_error_no'], ''); $this->assertEquals($result['curl_error_no'], '');
$resid=json_decode($result['content'], true); $resid=json_decode($result['content'], true);