diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index e68ecb8bc1d..eb377b7685e 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -314,11 +314,13 @@ class Users extends DolibarrApi /** * Update account * - * @param int $id Id of account to update - * @param array $request_data Datas - * @return array + * @param int $id Id of account to update + * @param array $request_data Datas + * @return array|mixed Record after update * - * @throws RestException + * @throws RestException 401 Not allowed + * @throws RestException 404 Not found + * @throws RestException 500 System error */ public function put($id, $request_data = null) { diff --git a/test/phpunit/RestAPIUserTest.php b/test/phpunit/RestAPIUserTest.php index 979daa521b9..d74ecb5534f 100644 --- a/test/phpunit/RestAPIUserTest.php +++ b/test/phpunit/RestAPIUserTest.php @@ -169,7 +169,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase $this->assertEquals($result['curl_error_no'], ''); $object=json_decode($result['content'], true); $this->assertNotNull($object, "Parsing of json result must not be null"); - $this->assertEquals(404, $object['error']['code']); + $this->assertEquals(404, $object['error']['code'], 'Error code is not 404'); $url = $this->api_url.'/users/1?api_key='.$this->api_key;