wiki.techinc.nl/tests/phpunit/includes/debug
Daimona Eaytoy 89f583625a tests: Add replacement for assertions deprecated in PHPUnit 9.6
expectWarning() and friends have been deprecated in PHPUnit 9.6, and
removed in PHPUnit 10. Unfortunately, there is no simple replacement
because PHPUnit no longer converts them to exceptions in the first
place. In fact, Sebastian Bergmann explicitly stated that he does not
consider the use case of

> a library developer to verify a code block warns its consumer when
> certain action is performed

worth supporting.

So, add an ad-hoc replacement for all the deprecated methods. This is
quite ugly, but it's simple enough given the low number of usages.

On the bright side, this new method does not halt the test when the
warning is triggered. This seems to align with the developers'
expectation, seen in a few existing tests, that any code following the
notice will be executed.

Bug: T342110
Change-Id: I214abfed4280834840c115777ed78eb0a5570da9
2024-02-23 22:09:45 +01:00
..
logger tests: Add Tests to PHP namespacing 2024-02-16 19:10:11 +00:00
DeprecationHelperTest.php tests: Fix @covers and @coversDefaultClass to have leading \ 2024-02-16 22:43:56 +00:00
MWDebugTest.php tests: Add replacement for assertions deprecated in PHPUnit 9.6 2024-02-23 22:09:45 +01:00
TestDeprecatedClass.php tests: Handle dynamic created properties on test classes 2023-01-13 21:03:42 +00:00
TestDeprecatedSubclass.php Fix class name handling in DeprecationHelper 2019-04-19 01:09:25 -07:00