]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
History: fix entries order
authorArthurHoaro <arthur@hoa.ro>
Sun, 7 May 2017 14:56:20 +0000 (16:56 +0200)
committerArthurHoaro <arthur@hoa.ro>
Sun, 7 May 2017 15:11:25 +0000 (17:11 +0200)
application/api/controllers/History.php
tests/utils/ReferenceHistory.php

index da034eb226eceb276d2c5e65043aceedff0a15d8..2ff9deaf24d98f4fb1f43356184fdd69996c223a 100644 (file)
@@ -29,7 +29,6 @@ class History extends ApiController
     public function getHistory($request, $response)
     {
         $history = $this->history->getHistory();
-        $history = array_reverse($history);
 
         // Return history operations from the {offset}th, starting from {since}.
         $since = \DateTime::createFromFormat(\DateTime::ATOM, $request->getParam('since'));
index 2028477039cfc9b20246d52297c08112273032fe..75cbb32629a3668fcde141619afde6514a360210 100644 (file)
@@ -15,15 +15,14 @@ class ReferenceHistory
     public function __construct()
     {
         $this->addEntry(
-            History::CREATED,
-            DateTime::createFromFormat('Ymd_His', '20170101_121212'),
-            123
+            History::DELETED,
+            DateTime::createFromFormat('Ymd_His', '20170303_121216'),
+            124
         );
 
         $this->addEntry(
-            History::CREATED,
-            DateTime::createFromFormat('Ymd_His', '20170201_121214'),
-            124
+            History::SETTINGS,
+            DateTime::createFromFormat('Ymd_His', '20170302_121215')
         );
 
         $this->addEntry(
@@ -33,14 +32,15 @@ class ReferenceHistory
         );
 
         $this->addEntry(
-            History::SETTINGS,
-            DateTime::createFromFormat('Ymd_His', '20170302_121215')
+            History::CREATED,
+            DateTime::createFromFormat('Ymd_His', '20170201_121214'),
+            124
         );
 
         $this->addEntry(
-            History::DELETED,
-            DateTime::createFromFormat('Ymd_His', '20170303_121216'),
-            124
+            History::CREATED,
+            DateTime::createFromFormat('Ymd_His', '20170101_121212'),
+            123
         );
     }