diff --git a/extension.json b/extension.json index 4b303e7b8..380545cae 100644 --- a/extension.json +++ b/extension.json @@ -82,9 +82,6 @@ ], "APIGetParamDescription": [ "ConfirmEditHooks::APIGetParamDescription" - ], - "UnitTestsList": [ - "ConfirmEditHooks::onUnitTestsList" ] }, "config": { diff --git a/includes/ConfirmEditHooks.php b/includes/ConfirmEditHooks.php index be535c1e3..e0bf82415 100644 --- a/includes/ConfirmEditHooks.php +++ b/includes/ConfirmEditHooks.php @@ -138,32 +138,6 @@ class ConfirmEditHooks { self::getInstance()->onAuthChangeFormFields( $requests, $fieldInfo, $formDescriptor, $action ); } - /** - * Hook to add PHPUnit test cases. - * @see https://www.mediawiki.org/wiki/Manual:Hooks/UnitTestsList - * - * @param array &$files - * @return boolean - */ - public static function onUnitTestsList( array &$files ) { - // @codeCoverageIgnoreStart - $directoryIterator = new RecursiveDirectoryIterator( dirname( __DIR__ ) . '/tests/' ); - - /** - * @var SplFileInfo $fileInfo - */ - $ourFiles = []; - foreach ( new RecursiveIteratorIterator( $directoryIterator ) as $fileInfo ) { - if ( substr( $fileInfo->getFilename(), -8 ) === 'Test.php' ) { - $ourFiles[] = $fileInfo->getPathname(); - } - } - - $files = array_merge( $files, $ourFiles ); - return true; - // @codeCoverageIgnoreEnd - } - /** * Set up $wgWhitelistRead */ diff --git a/tests/CaptchaAuthenticationRequestTest.php b/tests/phpunit/CaptchaAuthenticationRequestTest.php similarity index 100% rename from tests/CaptchaAuthenticationRequestTest.php rename to tests/phpunit/CaptchaAuthenticationRequestTest.php diff --git a/tests/CaptchaPreAuthenticationProviderTest.php b/tests/phpunit/CaptchaPreAuthenticationProviderTest.php similarity index 100% rename from tests/CaptchaPreAuthenticationProviderTest.php rename to tests/phpunit/CaptchaPreAuthenticationProviderTest.php diff --git a/tests/HTMLFancyCaptchaFieldTest.php b/tests/phpunit/HTMLFancyCaptchaFieldTest.php similarity index 95% rename from tests/HTMLFancyCaptchaFieldTest.php rename to tests/phpunit/HTMLFancyCaptchaFieldTest.php index 016302bc9..9c3bbe394 100644 --- a/tests/HTMLFancyCaptchaFieldTest.php +++ b/tests/phpunit/HTMLFancyCaptchaFieldTest.php @@ -1,6 +1,6 @@ setMwGlobals( 'wgCaptchaQuestions', $config ); $this->mergeMwGlobalArrayValue( 'wgAutoloadClasses', - [ 'QuestyCaptcha' => __DIR__ . '/../QuestyCaptcha/QuestyCaptcha.class.php' ] + [ 'QuestyCaptcha' => __DIR__ . '/../../QuestyCaptcha/QuestyCaptcha.class.php' ] ); $qc = new QuestyCaptcha(); diff --git a/tests/ReCaptchaAuthenticationRequestTest.php b/tests/phpunit/ReCaptchaAuthenticationRequestTest.php similarity index 87% rename from tests/ReCaptchaAuthenticationRequestTest.php rename to tests/phpunit/ReCaptchaAuthenticationRequestTest.php index c2e3b42e1..71fa05863 100644 --- a/tests/ReCaptchaAuthenticationRequestTest.php +++ b/tests/phpunit/ReCaptchaAuthenticationRequestTest.php @@ -2,7 +2,7 @@ use MediaWiki\Auth\AuthenticationRequestTestCase; -require_once __DIR__ . '/../ReCaptcha/ReCaptchaAuthenticationRequest.php'; +require_once __DIR__ . '/../../ReCaptcha/ReCaptchaAuthenticationRequest.php'; class ReCaptchaAuthenticationRequestTest extends AuthenticationRequestTestCase { protected function getInstance( array $args = [] ) { diff --git a/tests/ReCaptchaNoCaptchaAuthenticationRequestTest.php b/tests/phpunit/ReCaptchaNoCaptchaAuthenticationRequestTest.php similarity index 82% rename from tests/ReCaptchaNoCaptchaAuthenticationRequestTest.php rename to tests/phpunit/ReCaptchaNoCaptchaAuthenticationRequestTest.php index fe3fe2e7c..af81ea23d 100644 --- a/tests/ReCaptchaNoCaptchaAuthenticationRequestTest.php +++ b/tests/phpunit/ReCaptchaNoCaptchaAuthenticationRequestTest.php @@ -2,7 +2,7 @@ use MediaWiki\Auth\AuthenticationRequestTestCase; -require_once __DIR__ . '/../ReCaptchaNoCaptcha/ReCaptchaNoCaptchaAuthenticationRequest.php'; +require_once __DIR__ . '/../../ReCaptchaNoCaptcha/ReCaptchaNoCaptchaAuthenticationRequest.php'; class ReCaptchaNoCaptchaAuthenticationRequestTest extends AuthenticationRequestTestCase { protected function getInstance( array $args = [] ) {