Test phpunit

This commit is contained in:
Laurent Destailleur
2023-08-25 23:44:55 +02:00
parent a296751543
commit a0455c72a3

View File

@@ -237,6 +237,8 @@ class RestAPIUserTest extends PHPUnit\Framework\TestCase
$this->assertEquals($result['curl_error_no'], '');
$object = json_decode($result['content'], true); // If success content is just an id, if not an array
print_r('--------------------');
print_r($object);
$this->assertNotNull($object, "Parsing of json result must no be null");
$this->assertNotEquals(500, ((is_scalar($object) || empty($object['error']) || empty($object['error']['code'])) ? 0 : $object['error']['code']), (string) $object['error']['message']);
$this->assertGreaterThan(0, $object, 'ID returned is no > 0');