enforce order by ID for actionlog tests

This commit is contained in:
Brady Wetherington
2025-07-23 14:55:42 +01:00
parent e96e2461d3
commit d92e961a52

View File

@@ -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");
}
}