From 6b15e6b86e351871176d6a91bd56ff3534c384a2 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Thu, 9 Feb 2023 14:26:48 +0100 Subject: [PATCH] Fixed news test --- src/Controllers/NewsController.php | 1 + tests/Unit/Controllers/NewsControllerTest.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Controllers/NewsController.php b/src/Controllers/NewsController.php index c2c35761..e8e9d311 100644 --- a/src/Controllers/NewsController.php +++ b/src/Controllers/NewsController.php @@ -136,6 +136,7 @@ class NewsController extends BaseController ->orderByDesc('is_pinned') ->orderByDesc('is_important') ->orderByDesc('updated_at') + ->orderByDesc('id') ->limit($perPage) ->offset(($page - 1) * $perPage) ->get(); diff --git a/tests/Unit/Controllers/NewsControllerTest.php b/tests/Unit/Controllers/NewsControllerTest.php index 329a68a0..cb6e5e15 100644 --- a/tests/Unit/Controllers/NewsControllerTest.php +++ b/tests/Unit/Controllers/NewsControllerTest.php @@ -98,7 +98,7 @@ class NewsControllerTest extends ControllerTest $this->assertEquals(3, $data['pages']); $this->assertEquals(2, $data['page']); $this->assertTrue($news[0]->is_pinned); - $this->assertEquals('Ipsum', $news[0]->title); + $this->assertEquals('Bar', $news[0]->title); break; case 2: // Show meetings