diff --git a/apps/maarch_entreprise/js/angular/app/administration/update-status-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/update-status-administration.component.ts index f6cc7aeb4779d1738305ddb2ff68258a25e103f2..f422bf3ddc0b7c1a87d3a4bf24af3462524cc8f4 100644 --- a/apps/maarch_entreprise/js/angular/app/administration/update-status-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/administration/update-status-administration.component.ts @@ -52,9 +52,9 @@ export class UpdateStatusAdministrationComponent extends AutoCompletePlugin impl "status": this.statusId }; if (this.resId != "") { - body["resId"] = this.resId; + body["resId"] = [this.resId]; } else if (this.chrono != "") { - body["chrono"] = this.chrono; + body["chrono"] = [this.chrono]; } this.http.put(this.coreUrl + "rest/res/resource/status", body) diff --git a/core/Test/ResControllerTest.php b/core/Test/ResControllerTest.php index e15f2704fa72c5f928745c454e0c175b670f17f4..1444ddae4fdec51211c4ec0296556fb83f54b5b4 100755 --- a/core/Test/ResControllerTest.php +++ b/core/Test/ResControllerTest.php @@ -117,7 +117,8 @@ class ResControllerTest extends TestCase $this->assertSame('COU', $res['status']); } - public function testUpdateExternalInfos(){ + public function testUpdateExternalInfos() + { $resController = new \Resource\controllers\ResController(); // UPDATE STATUS @@ -126,7 +127,7 @@ class ResControllerTest extends TestCase //ALL OK $aArgs = [ - 'externalInfos' => [ + 'externalInfos' => [ [ 'res_id' => self::$id, 'external_id' => "BB981212IIYZ", @@ -146,7 +147,7 @@ class ResControllerTest extends TestCase // EXTERNAL INFOS EMPTY AND RES ID IS NOT INTEGER $aArgs = [ - 'externalInfos' => [ + 'externalInfos' => [ [ 'res_id' => "res_id", 'external_id' => "", @@ -194,7 +195,7 @@ class ResControllerTest extends TestCase 'external_link' => "https://publik.nancy.fr/res/BB981212BB65" ] ], - 'status' => NULL + 'status' => null ]; $fullRequest = \httpRequestCustom::addContentInBody($aArgs, $request); @@ -207,7 +208,7 @@ class ResControllerTest extends TestCase //MISSING EXTERNAL INFOS $aArgs = [ - 'externalInfos' => NULL, + 'externalInfos' => null, 'status' => "GRCSENT" ]; @@ -242,7 +243,8 @@ class ResControllerTest extends TestCase $this->assertSame(null, $res); } - public function testGetList(){ + public function testGetList() + { $resController = new \Resource\controllers\ResController(); $environment = \Slim\Http\Environment::mock(['REQUEST_METHOD' => 'POST']); @@ -261,7 +263,7 @@ class ResControllerTest extends TestCase $responseBody = json_decode((string)$response->getBody()); $arr_res = $responseBody->resources; $this->assertNotNull($arr_res[0]->fileBase64Content); - $this->assertSame(100,$arr_res[0]->res_id); + $this->assertInternalType('int', $arr_res[0]->res_id); $aArgs = [ 'select' => 'res_id', @@ -275,8 +277,8 @@ class ResControllerTest extends TestCase $response = $resController->getList($fullRequest, new \Slim\Http\Response()); $responseBody = json_decode((string)$response->getBody()); $arr_res = $responseBody->resources; - $this->assertSame(null,$arr_res[0]->fileBase64Content); - $this->assertSame(100,$arr_res[0]->res_id); + $this->assertSame(null, $arr_res[0]->fileBase64Content); + $this->assertInternalType('int', $arr_res[0]->res_id); $aArgs = [ 'select' => '', @@ -290,7 +292,7 @@ class ResControllerTest extends TestCase $response = $resController->getList($fullRequest, new \Slim\Http\Response()); $responseBody = json_decode((string)$response->getBody()); $arr_res = $responseBody->resources; - $this->assertSame("Bad Request: select parameter not valid",$responseBody->errors); + $this->assertSame("Bad Request: select parameter not valid", $responseBody->errors); $aArgs = [ 'select' => 'res_id', @@ -304,7 +306,6 @@ class ResControllerTest extends TestCase $response = $resController->getList($fullRequest, new \Slim\Http\Response()); $responseBody = json_decode((string)$response->getBody()); $arr_res = $responseBody->resources; - $this->assertSame("Bad Request: clause parameter not valid",$responseBody->errors); + $this->assertSame("Bad Request: clause parameter not valid", $responseBody->errors); } - }