3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-04-03 06:20:22 +00:00
Files
snipe-it/tests/Support/AssertHasActionLogs.php
2026-03-16 17:40:57 -07:00

16 lines
501 B
PHP

<?php
namespace Tests\Support;
use Illuminate\Database\Eloquent\Model;
use PHPUnit\Framework\Assert;
trait AssertHasActionLogs
{
public function assertHasTheseActionLogs(Model $item, array $statuses)
{
// 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');
}
}