<?php

it('guards pagination against searchable fields missing from legacy schemas', function (): void {
    $traitContent = file_get_contents(app_path('traits/db_object_t.php'));

    expect($traitContent)->not->toBeFalse();
    expect($traitContent)->toContain('$fields = array_values(array_intersect($fields, $tmpFields));');
    expect($traitContent)->toContain("if (in_array('deleted_at', \$tmpFields, true))");
});

