Remove PHPUnit hooks
Now unused: https://codesearch.wmcloud.org/search/?q=onMediaWikiPHPUnitTest__(end%7Cstart)Test%7CMediaWikiPHPUnitTest%3A%3A(end%7Cstart)Test&i=nope&files=&excludeFiles=&repos= Bug: T243600 Change-Id: Ie41fc026e6db6b9c9f5ec659e3ce8c27727cd3fe
This commit is contained in:
parent
fac3b1bde1
commit
6e4a17b1be
7 changed files with 2 additions and 89 deletions
|
|
@ -306,6 +306,8 @@ because of Phabricator reports.
|
|||
runner. It had been broken for at least three years already. The original use
|
||||
case was speeding up tests on Oracle, but Oracle support was dropped several
|
||||
releases ago.
|
||||
* The MediaWikiPHPUnitTest__endTestHook and MediaWikiPHPUnitTest__startTestHook
|
||||
PHPUnit hooks were removed. MediaWikiHooksPHPUnitExtension was also removed.
|
||||
* EntryPoint::getTextFormatters() was made private without a deprecation period;
|
||||
it had no known external callers.
|
||||
* DatabaseBlock::chooseBlock, deprecated since 1.35, was removed.
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Hook;
|
||||
|
||||
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
|
||||
use PHPUnit\Framework\Test;
|
||||
|
||||
/**
|
||||
* This is a hook handler interface, see docs/Hooks.md.
|
||||
* Use the hook name "MediaWikiPHPUnitTest::endTest" to register handlers implementing this interface.
|
||||
*
|
||||
* @stable to implement
|
||||
* @ingroup Hooks
|
||||
*/
|
||||
interface MediaWikiPHPUnitTest__endTestHook {
|
||||
/**
|
||||
* This hook is called after each PHPUnit test completes.
|
||||
*
|
||||
* @since 1.35
|
||||
*
|
||||
* @param Test $test
|
||||
* @param int $time Execution time in seconds
|
||||
* @return bool|void True or no return value to continue or false to abort
|
||||
*/
|
||||
public function onMediaWikiPHPUnitTest__endTest( $test, $time );
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Hook;
|
||||
|
||||
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
|
||||
use PHPUnit\Framework\Test;
|
||||
|
||||
/**
|
||||
* This is a hook handler interface, see docs/Hooks.md.
|
||||
* Use the hook name "MediaWikiPHPUnitTest::startTest" to register handlers implementing this interface.
|
||||
*
|
||||
* @stable to implement
|
||||
* @ingroup Hooks
|
||||
*/
|
||||
interface MediaWikiPHPUnitTest__startTestHook {
|
||||
/**
|
||||
* This hook is called before each PHPUnit test starts.
|
||||
*
|
||||
* @since 1.35
|
||||
*
|
||||
* @param Test $test
|
||||
* @return bool|void True or no return value to continue or false to abort
|
||||
*/
|
||||
public function onMediaWikiPHPUnitTest__startTest( $test );
|
||||
}
|
||||
|
|
@ -244,8 +244,6 @@ class HookRunner implements
|
|||
\MediaWiki\Hook\MarkPatrolledCompleteHook,
|
||||
\MediaWiki\Hook\MarkPatrolledHook,
|
||||
\MediaWiki\Hook\MediaWikiPerformActionHook,
|
||||
\MediaWiki\Hook\MediaWikiPHPUnitTest__endTestHook,
|
||||
\MediaWiki\Hook\MediaWikiPHPUnitTest__startTestHook,
|
||||
\MediaWiki\Hook\MediaWikiServicesHook,
|
||||
\MediaWiki\Hook\MimeMagicGuessFromContentHook,
|
||||
\MediaWiki\Hook\MimeMagicImproveFromExtensionHook,
|
||||
|
|
@ -2505,20 +2503,6 @@ class HookRunner implements
|
|||
);
|
||||
}
|
||||
|
||||
public function onMediaWikiPHPUnitTest__endTest( $test, $time ) {
|
||||
return $this->container->run(
|
||||
'MediaWikiPHPUnitTest::endTest',
|
||||
[ $test, $time ]
|
||||
);
|
||||
}
|
||||
|
||||
public function onMediaWikiPHPUnitTest__startTest( $test ) {
|
||||
return $this->container->run(
|
||||
'MediaWikiPHPUnitTest::startTest',
|
||||
[ $test ]
|
||||
);
|
||||
}
|
||||
|
||||
public function onMediaWikiServices( $services ) {
|
||||
return $this->container->run(
|
||||
'MediaWikiServices',
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ $wgAutoloadClasses += [
|
|||
'MediaWikiCliOptions' => "$testDir/phpunit/MediaWikiCliOptions.php",
|
||||
'MediaWikiCoversValidator' => "$testDir/phpunit/MediaWikiCoversValidator.php",
|
||||
'MediaWikiGroupValidator' => "$testDir/phpunit/MediaWikiGroupValidator.php",
|
||||
'MediaWikiHooksPHPUnitExtension' => "$testDir/phpunit/MediaWikiHooksPHPUnitExtension.php",
|
||||
'MediaWikiLangTestCase' => "$testDir/phpunit/MediaWikiLangTestCase.php",
|
||||
'MediaWikiLoggerPHPUnitExtension' => "$testDir/phpunit/MediaWikiLoggerPHPUnitExtension.php",
|
||||
'MediaWikiPHPUnitCommand' => "$testDir/phpunit/MediaWikiPHPUnitCommand.php",
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
<?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 );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -90,6 +90,5 @@
|
|||
</listeners>
|
||||
<extensions>
|
||||
<extension class="MediaWikiLoggerPHPUnitExtension" />
|
||||
<extension class="MediaWikiHooksPHPUnitExtension" />
|
||||
</extensions>
|
||||
</phpunit>
|
||||
|
|
|
|||
Loading…
Reference in a new issue