Skip to content

Commit 83a19fb

Browse files
authored
Merge pull request #17454 from uberbrady/de_flake_action_log_tests
Enforce order by ID for actionlog tests
2 parents 610cb88 + d92e961 commit 83a19fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/Support/AssertHasActionLogs.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ trait AssertHasActionLogs
1111
{
1212
public function assertHasTheseActionLogs(Model $item, array $statuses)
1313
{
14-
Assert::assertEquals($statuses, $item->assetlog()->orderBy('id')->pluck('action_type')->toArray(), "Failed asserting that action logs match");
14+
//note we have to do a 'reorder()' here because there is an implicit "order_by created_at" baked in to the relationship
15+
Assert::assertEquals($statuses, $item->assetlog()->reorder('id')->pluck('action_type')->toArray(), "Failed asserting that action logs match");
1516
}
1617

1718
}

0 commit comments

Comments
 (0)