PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Code Inspection: Deprecated 'assertEquals/assertNotEquals' usage

Last modified: 16 May 2022

Reports deprecated usages of the assertEquals and assertNotEquals functions with $delta, $maxDepth, $canonicalize, and $ignoreCase parameters.

The optional $delta, $maxDepth, $canonicalize, and $ignoreCase parameters of the assertEquals and assertNotEquals functions are deprecated and will be removed in PHPUnit 9.

See Usage of the assertEquals function (phpunit.readthedocs.io) for details.

In the following example, the assertEquals() calls are used for asserting several different conditions: whether the string and value values are canonically equal, whether the difference between them is greater than a delta value, and whether they are equal regardless their case. After the quick-fix is applied, the more specific assertEqualsCanonicalizing(), assertEqualsWithDelta(), and assertEqualsIgnoringCase() are used instead.