From d92e961a52b2031813fd50f6f5b3f48c81259362 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Wed, 23 Jul 2025 14:55:42 +0100 Subject: [PATCH] enforce order by ID for actionlog tests --- tests/Support/AssertHasActionLogs.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Support/AssertHasActionLogs.php b/tests/Support/AssertHasActionLogs.php index 8eebc8d87a..9db37ca317 100644 --- a/tests/Support/AssertHasActionLogs.php +++ b/tests/Support/AssertHasActionLogs.php @@ -11,7 +11,8 @@ trait AssertHasActionLogs { public function assertHasTheseActionLogs(Model $item, array $statuses) { - Assert::assertEquals($statuses, $item->assetlog()->orderBy('id')->pluck('action_type')->toArray(), "Failed asserting that action logs match"); + //note we have to do a 'reorder()' here because there is an implicit "order_by created_at" baked in to the relationship + Assert::assertEquals($statuses, $item->assetlog()->reorder('id')->pluck('action_type')->toArray(), "Failed asserting that action logs match"); } } \ No newline at end of file