AssertsPolicyQueryConsistency
trait AssertsPolicyQueryConsistency
Assert that query-aware policy results match per-model Gate checks.
These assertions use the application's Gate captured when the query-builder macros were booted. Register policies on that Gate instead of replacing its container binding after the provider has booted.
Methods
void
assertWhereCanMatchesPolicy(UnitEnum|string $ability, Builder $baseQuery, iterable $models, mixed $user = null)
Assert that query filtering matches per-model policy results.
void
assertWithCanMatchesPolicy(UnitEnum|string $ability, Builder $baseQuery, iterable $models, mixed $user = null, string|null $columnName = null)
Assert that query annotations match per-model policy results.
Details
at line 29
protected void
assertWhereCanMatchesPolicy(UnitEnum|string $ability, Builder $baseQuery, iterable $models, mixed $user = null)
Assert that query filtering matches per-model policy results.
at line 76
protected void
assertWithCanMatchesPolicy(UnitEnum|string $ability, Builder $baseQuery, iterable $models, mixed $user = null, string|null $columnName = null)
Assert that query annotations match per-model policy results.