aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/preferences/SignatureValidatorTest.php
diff options
context:
space:
mode:
authorKunal Mehta <legoktm@debian.org>2024-07-27 20:13:10 -0400
committerArlo Breault <abreault@wikimedia.org>2024-07-29 14:35:40 -0400
commit4d49a4a59ee9fd4fabf573ef352f764bbcc6d89e (patch)
tree22622c79d9f9a4f6ca51755de489cb515d050d62 /tests/phpunit/includes/preferences/SignatureValidatorTest.php
parent575cca8db1a8bcf960e7aafc0147afc1d52500eb (diff)
downloadmediawikicore-4d49a4a59ee9fd4fabf573ef352f764bbcc6d89e.tar.gz
mediawikicore-4d49a4a59ee9fd4fabf573ef352f764bbcc6d89e.zip
Extract LintErrorChecker out of SignatureValidator
This code was partially copied into MassMessage and will hopefully enable more places that accept arbitrary wikitext to check lint errors. It also hides the internal details of checking with the Linter extension's configuration in one place until it can be refactored into something more acceptable (T360809). Bug: T368690 Change-Id: Iaeb3ccbd61a2a8cb0d8b3dc8b06a3a10bc8fa653
Diffstat (limited to 'tests/phpunit/includes/preferences/SignatureValidatorTest.php')
-rw-r--r--tests/phpunit/includes/preferences/SignatureValidatorTest.php28
1 files changed, 0 insertions, 28 deletions
diff --git a/tests/phpunit/includes/preferences/SignatureValidatorTest.php b/tests/phpunit/includes/preferences/SignatureValidatorTest.php
index d2aba241762f..b2d938ac8b9f 100644
--- a/tests/phpunit/includes/preferences/SignatureValidatorTest.php
+++ b/tests/phpunit/includes/preferences/SignatureValidatorTest.php
@@ -177,27 +177,6 @@ class SignatureValidatorTest extends MediaWikiIntegrationTestCase {
$this->assertSame( $expected, $result );
}
- /**
- * @covers \MediaWiki\Preferences\SignatureValidator::validateSignature()
- * @dataProvider provideValidateSignature
- */
- public function testValidateSignatureHidden( string $signature, $expected ) {
- // For testing hidden category support in ::testValidateSignature
- $this->overrideConfigValue( 'LinterCategories', [
- 'fostered' => [ 'priority' => 'medium' ],
- // A hidden category, for testing.
- 'wikilink-in-extlink' => [ 'priority' => 'none' ],
- ] );
- $this->validator = $this->getSignatureValidator();
- $result = $this->validator->validateSignature( $signature );
- if ( $expected === 'hidden' ) {
- $expected = false;
- } elseif ( is_string( $expected ) ) {
- $expected = true;
- }
- $this->assertSame( $expected, $result );
- }
-
public function provideValidateSignature() {
yield 'Perfect' => [
'[[User:SignatureValidatorTest|Signature]] ([[User talk:SignatureValidatorTest|talk]])',
@@ -214,13 +193,6 @@ class SignatureValidatorTest extends MediaWikiIntegrationTestCase {
// This is allowed by SignatureAllowedLintErrors
'allowed'
];
- // Testing hidden category support; 'wikilink-in-extlink' has been
- // made hidden.
- yield 'Wikilink in Extlint (hidden)' => [
- '[http://example.com [[Foo]]!] [[User:SignatureValidatorTest|Signature]] ([[User talk:SignatureValidatorTest|talk]])',
- // This is allowed because the category is hidden
- 'hidden'
- ];
}
/**