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

lint/phpunit/require-assertion-style

In the code-quality set. Unsafe fix: it can change behaviour. Runs when phpunit is installed.

What it does

Calls to PHPUnit\Framework\TestCase static methods (like assertions) must all be of the same type, either $this->, self:: or static::.

Configuration

[lint.rules]
"phpunit/require-assertion-style" = "error"

To skip it in some files, add an override or a @pun-ignore-file comment.

Options

Name Type Allowed values Default Upstream name
call-type enum this, self, static "static" call_type
methods map Any { } methods
target enum 10.0, 11.0, newest "10.0" target

Replaces

More lint/phpunit rules · Edit this page

Last updated on

Was this page helpful?