Drop various class aliases

Move manual wgAutoloadClasses entries into TestAutoloadClasses

Change-Id: I4c85a2042ae591732b48bbf872277909a90675b4
This commit is contained in:
Reedy 2024-01-15 15:27:15 +00:00 committed by Krinkle
parent c60beba52d
commit 3798d424e2
13 changed files with 6 additions and 77 deletions

View file

@ -17,10 +17,6 @@
"i18n/api"
]
},
"AutoloadClasses": {
"FancyCaptcha": "includes/FancyCaptcha.php",
"MediaWiki\\Extension\\ConfirmEdit\\FancyCaptcha\\FancyCaptcha": "includes/FancyCaptcha.php"
},
"AutoloadNamespaces": {
"MediaWiki\\Extension\\ConfirmEdit\\FancyCaptcha\\": "includes/"
},

View file

@ -514,5 +514,3 @@ class FancyCaptcha extends SimpleCaptcha {
] + $formDescriptor['captchaWord'];
}
}
class_alias( FancyCaptcha::class, 'FancyCaptcha' );

View file

@ -17,10 +17,6 @@
"i18n"
]
},
"AutoloadClasses": {
"MathCaptcha": "includes/MathCaptcha.php",
"MediaWiki\\Extension\\ConfirmEdit\\MathCaptcha\\MathCaptcha": "includes/MathCaptcha.php"
},
"AutoloadNamespaces": {
"MediaWiki\\Extension\\ConfirmEdit\\MathCaptcha\\": "includes/"
},

View file

@ -125,5 +125,3 @@ class MathCaptcha extends SimpleCaptcha {
$formDescriptor['captchaWord']['label-message'] = null;
}
}
class_alias( MathCaptcha::class, 'MathCaptcha' );

View file

@ -12,10 +12,6 @@
"i18n"
]
},
"AutoloadClasses": {
"QuestyCaptcha": "includes/QuestyCaptcha.php",
"MediaWiki\\Extension\\ConfirmEdit\\QuestyCaptcha\\QuestyCaptcha": "includes/QuestyCaptcha.php"
},
"AutoloadNamespaces": {
"MediaWiki\\Extension\\ConfirmEdit\\QuestyCaptcha\\": "includes/"
},

View file

@ -146,5 +146,3 @@ class QuestyCaptcha extends SimpleCaptcha {
$formDescriptor['captchaWord']['label-message'] = null;
}
}
class_alias( QuestyCaptcha::class, 'QuestyCaptcha' );

View file

@ -55,16 +55,16 @@
"ExtensionMessagesFiles": {
"ConfirmEditAlias": "ConfirmEdit.alias.php"
},
"AutoloadClasses": {
"CaptchaCacheStore": "includes/Store/CaptchaCacheStore.php",
"ConfirmEditHooks": "includes/Hooks.php",
"MediaWiki\\Extension\\ConfirmEdit\\Hooks": "includes/Hooks.php",
"MediaWiki\\Extension\\ConfirmEdit\\Store\\CaptchaCacheStore": "includes/Store/CaptchaCacheStore.php"
},
"AutoloadNamespaces": {
"MediaWiki\\Extension\\ConfirmEdit\\": "includes/",
"MediaWiki\\Extension\\ConfirmEdit\\SimpleCaptcha\\": "SimpleCaptcha/"
},
"TestAutoloadClasses": {
"MediaWiki\\Extension\\ConfirmEdit\\FancyCaptcha\\HTMLFancyCaptchaField": "FancyCaptcha/includes/HTMLFancyCaptchaField.php",
"MediaWiki\\Extension\\ConfirmEdit\\QuestyCaptcha\\QuestyCaptcha": "QuestyCaptcha/includes/QuestyCaptcha.php",
"MediaWiki\\Extension\\ConfirmEdit\\ReCaptchaNoCaptcha\\HTMLReCaptchaNoCaptchaField": "ReCaptchaNoCaptcha/includes/HTMLReCaptchaNoCaptchaField.php",
"MediaWiki\\Extension\\ConfirmEdit\\ReCaptchaNoCaptcha\\ReCaptchaNoCaptchaAuthenticationRequest": "ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptchaAuthenticationRequest.php"
},
"ResourceModules": {
"ext.confirmEdit.editPreview.ipwhitelist.styles": {
"styles": "ext.confirmEdit.editPreview.ipwhitelist.styles.css"

View file

@ -337,5 +337,3 @@ class Hooks implements
}
}
class_alias( Hooks::class, 'ConfirmEditHooks' );

View file

@ -54,5 +54,3 @@ class CaptchaCacheStore extends CaptchaStore {
return false;
}
}
class_alias( CaptchaCacheStore::class, 'CaptchaCacheStore' );

View file

@ -10,19 +10,6 @@ use MediaWiki\Title\Title;
* @group Database
*/
class HTMLFancyCaptchaFieldTest extends MediaWikiIntegrationTestCase {
public function setUp(): void {
parent::setUp();
$this->mergeMwGlobalArrayValue(
'wgAutoloadClasses',
[
'MediaWiki\\Extension\\ConfirmEdit\\FancyCaptcha\\HTMLFancyCaptchaField'
=> __DIR__ . '/../../FancyCaptcha/includes/HTMLFancyCaptchaField.php'
]
);
}
public function testGetHTML() {
$html = $this->getForm( [ 'imageUrl' => 'https://example.com/' ] )->getHTML( false );
$this->assertMatchesRegularExpression( '/"fancycaptcha-image"/', $html );

View file

@ -8,19 +8,6 @@ use MediaWiki\Title\Title;
* @covers \MediaWiki\Extension\ConfirmEdit\ReCaptchaNoCaptcha\HTMLReCaptchaNoCaptchaField
*/
class HTMLReCaptchaNoCaptchaFieldTest extends MediaWikiIntegrationTestCase {
public function setUp(): void {
parent::setUp();
$this->mergeMwGlobalArrayValue(
'wgAutoloadClasses',
[
'MediaWiki\\Extension\\ConfirmEdit\\ReCaptchaNoCaptcha\\HTMLReCaptchaNoCaptchaField'
=> __DIR__ . '/../../ReCaptchaNoCaptcha/includes/HTMLReCaptchaNoCaptchaField.php'
]
);
}
public function testSubmit() {
$request = new FauxRequest( [
'foo' => 'abc',

View file

@ -6,17 +6,6 @@ use MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha;
* @covers \MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha
*/
class QuestyCaptchaTest extends MediaWikiIntegrationTestCase {
public function setUp(): void {
parent::setUp();
$this->mergeMwGlobalArrayValue(
'wgAutoloadClasses',
[ 'MediaWiki\\Extension\\ConfirmEdit\\QuestyCaptcha\\QuestyCaptcha'
=> __DIR__ . '/../../QuestyCaptcha/includes/QuestyCaptcha.php' ]
);
}
/**
* @covers \MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha::getCaptcha
* @dataProvider provideGetCaptcha

View file

@ -8,18 +8,6 @@ use MediaWiki\Extension\ConfirmEdit\ReCaptchaNoCaptcha\ReCaptchaNoCaptchaAuthent
*/
class ReCaptchaNoCaptchaAuthenticationRequestTest extends AuthenticationRequestTestCase {
public function setUp(): void {
parent::setUp();
$this->mergeMwGlobalArrayValue(
'wgAutoloadClasses',
[
'MediaWiki\\Extension\\ConfirmEdit\\ReCaptchaNoCaptcha\\ReCaptchaNoCaptchaAuthenticationRequest'
=> __DIR__ . '/../../ReCaptchaNoCaptcha/includes/ReCaptchaNoCaptchaAuthenticationRequest.php'
]
);
}
protected function getInstance( array $args = [] ) {
return new ReCaptchaNoCaptchaAuthenticationRequest();
}