Remove 'UnitTestList' hook

No longer needed now that extension unittests are autodiscovered.

Bug: T142120
Bug: T142121
Change-Id: I7105170e56c8c3ec3837dd15be869e503bccecde
This commit is contained in:
Reedy 2016-08-05 18:15:41 +01:00
parent bf03dffebd
commit 6a8c53f6d1
11 changed files with 7 additions and 36 deletions

View file

@ -82,9 +82,6 @@
],
"APIGetParamDescription": [
"ConfirmEditHooks::APIGetParamDescription"
],
"UnitTestsList": [
"ConfirmEditHooks::onUnitTestsList"
]
},
"config": {

View file

@ -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
*/

View file

@ -1,6 +1,6 @@
<?php
require_once __DIR__ . '/../FancyCaptcha/HTMLFancyCaptchaField.php';
require_once __DIR__ . '/../../FancyCaptcha/HTMLFancyCaptchaField.php';
class HTMLFancyCaptchaFieldTest extends PHPUnit_Framework_TestCase {
public function testGetHTML() {

View file

@ -1,6 +1,6 @@
<?php
require_once __DIR__ . '/../ReCaptcha/HTMLReCaptchaField.php';
require_once __DIR__ . '/../../ReCaptcha/HTMLReCaptchaField.php';
class HTMLReCaptchaFieldTest extends PHPUnit_Framework_TestCase {
public function testSubmit() {

View file

@ -1,6 +1,6 @@
<?php
require_once __DIR__ . '/../ReCaptchaNoCaptcha/HTMLReCaptchaNoCaptchaField.php';
require_once __DIR__ . '/../../ReCaptchaNoCaptcha/HTMLReCaptchaNoCaptchaField.php';
class HTMLReCaptchaNoCaptchaFieldTest extends PHPUnit_Framework_TestCase {
public function testSubmit() {

View file

@ -1,6 +1,6 @@
<?php
require_once __DIR__ . '/../ReCaptcha/HTMLSubmittedValueField.php';
require_once __DIR__ . '/../../ReCaptcha/HTMLSubmittedValueField.php';
class HTMLSubmittedValueFieldTest extends PHPUnit_Framework_TestCase {
public function testSubmit() {

View file

@ -14,7 +14,7 @@ class QuestyCaptchaTest extends MediaWikiTestCase {
$this->setMwGlobals( 'wgCaptchaQuestions', $config );
$this->mergeMwGlobalArrayValue(
'wgAutoloadClasses',
[ 'QuestyCaptcha' => __DIR__ . '/../QuestyCaptcha/QuestyCaptcha.class.php' ]
[ 'QuestyCaptcha' => __DIR__ . '/../../QuestyCaptcha/QuestyCaptcha.class.php' ]
);
$qc = new QuestyCaptcha();

View file

@ -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 = [] ) {

View file

@ -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 = [] ) {