From 2d13cc850f5b23678ec98702beaa91423ddac166 Mon Sep 17 00:00:00 2001
From: Vinciane <vinciane.bizet@maarch.org>
Date: Fri, 4 Jan 2019 15:00:57 +0100
Subject: [PATCH] TU Correction delete resource

---
 test/unitTests/app/history/HistoryControllerTest.php | 6 ++++--
 test/unitTests/app/note/NoteControllerTest.php       | 6 ++++--
 test/unitTests/app/resource/ResControllerTest.php    | 4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/test/unitTests/app/history/HistoryControllerTest.php b/test/unitTests/app/history/HistoryControllerTest.php
index f1e323a1947..359946909c3 100755
--- a/test/unitTests/app/history/HistoryControllerTest.php
+++ b/test/unitTests/app/history/HistoryControllerTest.php
@@ -72,11 +72,13 @@ class HistoryControllerTest extends TestCase
 
     public function testRealDelete(){
         
-        //get notes
+        //get last notes
         $getResId = DatabaseModel::select([
             'select'    => ['res_id'],
             'table'     => ['res_letterbox'],
-            'limit'     => 1,
+            'where'     => ['subject = ?','status = ?'],
+            'data'      => ['Breaking News : Superman is alive - PHP unit', 'DEL'],
+            'order_by'  => ['res_id DESC']
         ]);
 
         $resID['resId'] = $getResId[0]['res_id'];
diff --git a/test/unitTests/app/note/NoteControllerTest.php b/test/unitTests/app/note/NoteControllerTest.php
index b64349e2a5a..24587b5fdf4 100644
--- a/test/unitTests/app/note/NoteControllerTest.php
+++ b/test/unitTests/app/note/NoteControllerTest.php
@@ -16,11 +16,13 @@ class NoteControllerTest extends TestCase
 
     public function testCreate()
     {
-        //get notes
+        //get last notes
         $getResId = DatabaseModel::select([
             'select'    => ['res_id'],
             'table'     => ['res_letterbox'],
-            'limit'     => 1,
+            'where'     => ['subject = ?','status = ?'],
+            'data'      => ['Breaking News : Superman is alive - PHP unit', 'DEL'],
+            'order_by'  => ['res_id DESC']
         ]);
 
         $resID['resId'] = $getResId[0]['res_id'];
diff --git a/test/unitTests/app/resource/ResControllerTest.php b/test/unitTests/app/resource/ResControllerTest.php
index a9023ae7ef0..0ba86eacaee 100755
--- a/test/unitTests/app/resource/ResControllerTest.php
+++ b/test/unitTests/app/resource/ResControllerTest.php
@@ -27,7 +27,7 @@ class ResControllerTest extends TestCase
         $data = [
             [
                 'column'    => 'subject',
-                'value'     => 'Breaking News : Superman is alive',
+                'value'     => 'Breaking News : Superman is alive - PHP unit',
                 'type'      => 'string',
             ],
             [
@@ -63,7 +63,7 @@ class ResControllerTest extends TestCase
 
         $this->assertInternalType('array', $res);
 
-        $this->assertSame('Breaking News : Superman is alive', $res['subject']);
+        $this->assertSame('Breaking News : Superman is alive - PHP unit', $res['subject']);
         $this->assertSame(null, $res['title']);
         $this->assertSame(null, $res['description']);
         $this->assertSame(102, $res['type_id']);
-- 
GitLab