Skip to content

A free open source IT asset/license management system

enforce order by ID for actionlog tests

Brady Wetheringtond92e961a52b2
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