The two hooks were moved to a PHPUnit extensions which uses hooks. The rest was simply deleted. The reason for this change is that TestListener was removed in PHPUnit 9, with PHPUnit hooks as replacement. No hooks exist for startSuite/endSuite, plus we should avoid adding too much functionality: if the output of PHPUnit isn't clear, that should be reported upstream. Additionally, PHPUnit hooks were also deprecated in PHPUnit 10, which means that extending PHPUnit becomes more and more difficult. As such, the two hooks will be hard-deprecated & removed soon. Removing all these wfDebugLog and other function calls should also hopefully speed up the suite. Bug: T243600 Bug: T225730 Change-Id: I2b67cd0074aca4b0ea76696ce9f24be68f5f88f8
20 lines
522 B
PHP
20 lines
522 B
PHP
<?php
|
|
|
|
use PHPUnit\Runner\AfterTestHook;
|
|
use PHPUnit\Runner\BeforeTestHook;
|
|
|
|
/**
|
|
* Runs a hook whenever a test starts or ends
|
|
*/
|
|
class MediaWikiHooksPHPUnitExtension implements BeforeTestHook, AfterTestHook {
|
|
/** @inheritDoc */
|
|
public function executeBeforeTest( string $test ): void {
|
|
Hooks::runner()->onMediaWikiPHPUnitTest__startTest( $test );
|
|
}
|
|
|
|
/** @inheritDoc */
|
|
public function executeAfterTest( string $test, float $time ): void {
|
|
Hooks::runner()->onMediaWikiPHPUnitTest__endTest( $test, $time );
|
|
}
|
|
|
|
}
|