Revert "Drop various class aliases"

This reverts commit 3798d424e2.

Bug: T355198
Change-Id: I99ecee703cdfa06198eeede96e6c3bdda2d457e0
This commit is contained in:
Gergő Tisza 2024-01-17 04:46:58 +00:00
parent 3798d424e2
commit b52d63ee9d
13 changed files with 77 additions and 6 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -55,16 +55,16 @@
"ExtensionMessagesFiles": { "ExtensionMessagesFiles": {
"ConfirmEditAlias": "ConfirmEdit.alias.php" "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": { "AutoloadNamespaces": {
"MediaWiki\\Extension\\ConfirmEdit\\": "includes/", "MediaWiki\\Extension\\ConfirmEdit\\": "includes/",
"MediaWiki\\Extension\\ConfirmEdit\\SimpleCaptcha\\": "SimpleCaptcha/" "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": { "ResourceModules": {
"ext.confirmEdit.editPreview.ipwhitelist.styles": { "ext.confirmEdit.editPreview.ipwhitelist.styles": {
"styles": "ext.confirmEdit.editPreview.ipwhitelist.styles.css" "styles": "ext.confirmEdit.editPreview.ipwhitelist.styles.css"

View file

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

View file

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

View file

@ -10,6 +10,19 @@ use MediaWiki\Title\Title;
* @group Database * @group Database
*/ */
class HTMLFancyCaptchaFieldTest extends MediaWikiIntegrationTestCase { 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() { public function testGetHTML() {
$html = $this->getForm( [ 'imageUrl' => 'https://example.com/' ] )->getHTML( false ); $html = $this->getForm( [ 'imageUrl' => 'https://example.com/' ] )->getHTML( false );
$this->assertMatchesRegularExpression( '/"fancycaptcha-image"/', $html ); $this->assertMatchesRegularExpression( '/"fancycaptcha-image"/', $html );

View file

@ -8,6 +8,19 @@ use MediaWiki\Title\Title;
* @covers \MediaWiki\Extension\ConfirmEdit\ReCaptchaNoCaptcha\HTMLReCaptchaNoCaptchaField * @covers \MediaWiki\Extension\ConfirmEdit\ReCaptchaNoCaptcha\HTMLReCaptchaNoCaptchaField
*/ */
class HTMLReCaptchaNoCaptchaFieldTest extends MediaWikiIntegrationTestCase { 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() { public function testSubmit() {
$request = new FauxRequest( [ $request = new FauxRequest( [
'foo' => 'abc', 'foo' => 'abc',

View file

@ -6,6 +6,17 @@ use MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha;
* @covers \MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha * @covers \MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha
*/ */
class QuestyCaptchaTest extends MediaWikiIntegrationTestCase { 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 * @covers \MediaWiki\Extension\ConfirmEdit\QuestyCaptcha\QuestyCaptcha::getCaptcha
* @dataProvider provideGetCaptcha * @dataProvider provideGetCaptcha

View file

@ -8,6 +8,18 @@ use MediaWiki\Extension\ConfirmEdit\ReCaptchaNoCaptcha\ReCaptchaNoCaptchaAuthent
*/ */
class ReCaptchaNoCaptchaAuthenticationRequestTest extends AuthenticationRequestTestCase { 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 = [] ) { protected function getInstance( array $args = [] ) {
return new ReCaptchaNoCaptchaAuthenticationRequest(); return new ReCaptchaNoCaptchaAuthenticationRequest();
} }