Commit graph

4 commits

Author SHA1 Message Date
Gergő Tisza
09357c46c5
phpunit: Add PHPUNIT_LOGS flag
Dumping logs can be useful for interpreting CI test failures, but
is rarely needed when running phpunit locally and it makes the
output unreadable. In theory it should be possible to disable them
with the --no-extensions flag but that doesn't seem to work.

Allow disabling log dumping by prefixing the phpunit command with
PHPUNIT_LOGS=0.

Change-Id: I071ff3228e922c9aaf705e32e9e1a2351bb1e973
2023-02-08 22:15:32 -08:00
Máté Szabó
85017a30b2 phpunit: Fix trivial dynamic property usages in tests
Dynamic property creation is deprecated in PHP 8.2 (E_DEPRECATED).
Migrate some trivial cases in tests to use explicitly declared fields
instead, and remove the unused lastLog field from
MediaWikiLoggerPHPUnitExtension.

Notably this does not yet address MediaWikiIntegrationTestCase using
dynamic properties to associate ephemeral data with DB connections used
for tests.

Bug: T314099
Change-Id: I55453c0d254012b69c6843c54cfa8345fa5744fa
2022-07-29 01:59:23 +02:00
Tim Starling
16a1aa0176 Re-add PHPUnit start/end log messages
Log a message at the start and end of each PHPUnit test case. Partial
revert of 8176dac4a6.

Change-Id: Ib5fb372dcd2a0c3892c90caf9e0cbef29c4034b6
2021-11-26 13:58:41 +11:00
Daimona Eaytoy
86c0a64e91 Use PHPUnit hooks for augmented logs
The TestListener interface is deprecated. This replacement has the
downside of using a public static property, but there seems to be no
other way to pass extra data to the printer (BTW: the ResultPrinter
class is internal, so it'd be even better if we could avoid subclassing
it).

Bug: T243600
Change-Id: I083146b7336ac09dfd077c8e6817553738282662
2020-09-22 11:28:10 +00:00
Renamed from tests/phpunit/MediaWikiLoggerPHPUnitTestListener.php (Browse further)