From 6bc90f50af611a1674ee1118587feddd4f625d44 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 7 May 2017 16:56:20 +0200 Subject: History: fix entries order --- application/api/controllers/History.php | 1 - tests/utils/ReferenceHistory.php | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/application/api/controllers/History.php b/application/api/controllers/History.php index da034eb2..2ff9deaf 100644 --- a/application/api/controllers/History.php +++ b/application/api/controllers/History.php @@ -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')); diff --git a/tests/utils/ReferenceHistory.php b/tests/utils/ReferenceHistory.php index 20284770..75cbb326 100644 --- a/tests/utils/ReferenceHistory.php +++ b/tests/utils/ReferenceHistory.php @@ -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 ); } -- cgit v1.2.3