In PHPUnit, since the version bumps, some methods have probably changed from static to non-static. It is common to find calls such as the following:
self::expectException(SomeException::class);
self::expectExceptionMessage('Some message');
self::expectExceptionCode(400);
Each of these calls "works" but those functions are not static
, so it is technically calling an instance method. The [EA] inspections in PHPStorm IDE raises a warning on this, stating that $this->
should be used instead.
We should add a PHPCS sniff and fixer to automatically disallow that.
Follow-up of request #42633.