2
0
forked from Wavyzz/dolibarr

Fix phpunit API warnings

This commit is contained in:
Laurent Destailleur
2023-08-25 15:52:31 +02:00
parent 7e062f9391
commit 4c2645147c

View File

@@ -238,7 +238,7 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
$object = json_decode($result['content'], true); // If success content is just an id, if not an array
$this->assertNotNull($object, "Parsing of json result must no be null");
$this->assertNotEquals(500, (empty($object['error']['code']) ? 0 : $object['error']['code']), (string) $object['error']['message']);
$this->assertNotEquals(500, ((empty($object['error']) || empty($object['error']['code'])) ? 0 : $object['error']['code']), (string) $object['error']['message']);
$this->assertGreaterThan(0, $object, 'ID returned is no > 0');
// attempt to create duplicated user
@@ -249,6 +249,6 @@ 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 no be null");
$this->assertEquals(500, (empty($object['error']['code']) ? 0 : $object['error']['code']), (string) $object['error']['message']);
$this->assertEquals(500, ((empty($object['error']) || empty($object['error']['code'])) ? 0 : $object['error']['code']), (string) $object['error']['message']);
}
}