You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static function assertTrue($condition, $message = '')
But the documentation has always suggested to call them dynamically:
$this->assertTrue(false);
And most of the tests I've seen have been following this convention so far (including mine).
It doesn't seem to be a problem for PHP, which doesn't complain in any error reporting mode; but in addition to being a code smell, this approach triggers the static code analysis tools of my IDE, which keeps complaining about static methods called dynamically.
Is there any reason why the documentation shows dynamic calls to the assertion methods?
The whole documentation could be re-written in the following manner:
self::assertTrue(false);
Is there any reason not to?
The text was updated successfully, but these errors were encountered:
In PHPUnit, all assertions are static methods:
But the documentation has always suggested to call them dynamically:
And most of the tests I've seen have been following this convention so far (including mine).
It doesn't seem to be a problem for PHP, which doesn't complain in any error reporting mode; but in addition to being a code smell, this approach triggers the static code analysis tools of my IDE, which keeps complaining about static methods called dynamically.
Is there any reason why the documentation shows dynamic calls to the assertion methods?
The whole documentation could be re-written in the following manner:
Is there any reason not to?
The text was updated successfully, but these errors were encountered: