From 24cad7cfdf191f87a70f6121867897102f2b6c3f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Dec 2016 14:57:00 +0100 Subject: [PATCH] Fix return code REST similar for all api with POST --- test/phpunit/RestAPIUserTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/phpunit/RestAPIUserTest.php b/test/phpunit/RestAPIUserTest.php index a92bc80ed63..a79739fef43 100644 --- a/test/phpunit/RestAPIUserTest.php +++ b/test/phpunit/RestAPIUserTest.php @@ -207,9 +207,9 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase 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'],''); - $object=json_decode($result['content'], true); - $this->assertNotNull($object, "Parsing of json result must no be null"); - $this->assertGreaterThan(0, $object['id'], $object['error']['code'].' '.$object['error']['message']); + $resid=json_decode($result['content'], true); + $this->assertNotNull($resid, "Parsing of json result must no be null"); + $this->assertGreaterThan(0, $resid, $object['error']['code'].' '.$object['error']['message']); // attempt to create duplicated user print __METHOD__." Request POST url=".$url."\n";