Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

lint/laravel/prefer-dedicated-status-assertion

In the lint-recommended preset and every stricter one. In Rector’s rector-laravel/laravel-testing set. Needs the laravel extension. Safe fix.

What it does

Use assertOk(), assertNotFound() and similar instead of assertStatus(200).

Configuration

[lint.rules]
"laravel/prefer-dedicated-status-assertion" = "error"

To skip it in some files or lines, add an override or an ignore comment.

Replaces

Merged rules

These old IDs are now this rule. A config that still names one stops with an error. See merged rules.

  • lint/laravel/prefer-status-assertion-method

More lint/laravel rules · Edit this page

Last updated on

Was this page helpful?