From c8e27ee1955307e882ed178c8e45c76c621eb3a6 Mon Sep 17 00:00:00 2001 From: Guillaume Heurtier <guillaume.heurtier@maarch.org> Date: Mon, 30 Mar 2020 14:59:56 +0200 Subject: [PATCH] FEAT #13676 TIME 1:00 fix unit tests --- .../app/entity/ListInstanceControllerTest.php | 18 +++++++++--------- .../UserFollowedResourceControllerTest.php | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/unitTests/app/entity/ListInstanceControllerTest.php b/test/unitTests/app/entity/ListInstanceControllerTest.php index c360e189033..bfcef2bbfe2 100644 --- a/test/unitTests/app/entity/ListInstanceControllerTest.php +++ b/test/unitTests/app/entity/ListInstanceControllerTest.php @@ -63,7 +63,7 @@ class ListInstanceControllerTest extends TestCase [ 'resId' => self::$resourceId, 'listInstances' => [ - ["item_id" => 19, "requested_signature" => false], + ["item_id" => 17, "requested_signature" => false], ["item_id" => 18, "requested_signature" => true] ] ], @@ -88,14 +88,14 @@ class ListInstanceControllerTest extends TestCase $responseBody = json_decode((string)$response->getBody(), true); - $this->assertSame(19, $responseBody[0]['item_id']); - $this->assertSame('user', $responseBody[0]['item_type']); - $this->assertSame(false, $responseBody[0]['requested_signature']); - $this->assertNotEmpty($responseBody[0]['labelToDisplay']); - $this->assertSame(18, $responseBody[1]['item_id']); - $this->assertSame('user', $responseBody[1]['item_type']); - $this->assertSame(true, $responseBody[1]['requested_signature']); - $this->assertNotEmpty($responseBody[1]['labelToDisplay']); + $this->assertSame(17, $responseBody['circuit'][0]['item_id']); + $this->assertSame('user', $responseBody['circuit'][0]['item_type']); + $this->assertSame(false, $responseBody['circuit'][0]['requested_signature']); + $this->assertNotEmpty($responseBody['circuit'][0]['labelToDisplay']); + $this->assertSame(18, $responseBody['circuit'][1]['item_id']); + $this->assertSame('user', $responseBody['circuit'][1]['item_type']); + $this->assertSame(true, $responseBody['circuit'][1]['requested_signature']); + $this->assertNotEmpty($responseBody['circuit'][1]['labelToDisplay']); \SrcCore\models\DatabaseModel::delete([ 'table' => 'res_letterbox', diff --git a/test/unitTests/app/resource/UserFollowedResourceControllerTest.php b/test/unitTests/app/resource/UserFollowedResourceControllerTest.php index 53c0c9e0550..5466d70c852 100644 --- a/test/unitTests/app/resource/UserFollowedResourceControllerTest.php +++ b/test/unitTests/app/resource/UserFollowedResourceControllerTest.php @@ -91,7 +91,7 @@ class UserFollowedResourceControllerTest extends TestCase $response = $usersFollowedResourcesController->unFollow($fullRequest, new \Slim\Http\Response()); - $this->assertSame(204, $response->getStatusCode()); + $this->assertSame(200, $response->getStatusCode()); $GLOBALS['userId'] = 'ccharles'; $userInfo = \User\models\UserModel::getByLogin(['login' => $GLOBALS['userId'], 'select' => ['id']]); -- GitLab