Merge pull request #17454 from uberbrady/de_flake_action_log_tests
Enforce order by ID for actionlog tests
This commit is contained in:
@@ -11,7 +11,8 @@ trait AssertHasActionLogs
|
|||||||
{
|
{
|
||||||
public function assertHasTheseActionLogs(Model $item, array $statuses)
|
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user