diff --git a/RELEASE-NOTES-1.36 b/RELEASE-NOTES-1.36 index 01f675fc548..2c80f968ad8 100644 --- a/RELEASE-NOTES-1.36 +++ b/RELEASE-NOTES-1.36 @@ -401,7 +401,7 @@ because of Phabricator reports. doDeleteArticleReal(), doRollback(), and doEditContent(). * The ParserTestRunner no longer invokes the ParserTestTables hook. Instead, it clones all database tables before running tests, like MediaWikiIntegrationTest - does. If an extension was mis-using the hook to *exclude* tables from the + does. If an extension was mis-using the hook to *exclude* tables from the clone, that will no longer occur, and tests may fail. * The following classes, which were only loaded for tests and had no uses found in public MediaWiki-related git, were removed: @@ -595,6 +595,9 @@ because of Phabricator reports. * Command::cgroup() is deprecated and no longer functional. $wgShellCgroup is now implemented as an Executor option. * Command::restrict() is deprecated. Instead use the new separate accessors. +* MWTidy::tidy() is deprecated. Use MediaWikiServices::getTidy()-tidy() instead. +* TidyDriverBase::supportsValidate() is deprecated; it has always returned + false since 1.33. * WatchedItem::getUser hard-deprecated in favor of ::getUserIdentity since 1.36 * LogEntry::getPerformer() and its implementations have been hard-deprecated, in favor of ::getPerformerIdentity(). diff --git a/includes/parser/MWTidy.php b/includes/parser/MWTidy.php index 8859ca29303..ef533bc233c 100644 --- a/includes/parser/MWTidy.php +++ b/includes/parser/MWTidy.php @@ -38,6 +38,7 @@ class MWTidy { * or tag. * @return string Corrected HTML output * @throws MWException + * @deprecated since 1.36; use MediaWikiServices::getTidy()->tidy() instead */ public static function tidy( $text ) { return MediaWikiServices::getInstance()->getTidy()->tidy( $text ); diff --git a/includes/tidy/TidyDriverBase.php b/includes/tidy/TidyDriverBase.php index 449a19816d3..09fb49dc689 100644 --- a/includes/tidy/TidyDriverBase.php +++ b/includes/tidy/TidyDriverBase.php @@ -15,8 +15,10 @@ abstract class TidyDriverBase { /** * Return true if validate() can be used * @return bool + * @deprecated since 1.36, always returns false */ public function supportsValidate() { + wfDeprecated( __METHOD__, '1.36' ); return false; } diff --git a/tests/phpunit/unit/includes/tidy/RemexDriverTest.php b/tests/phpunit/unit/includes/tidy/RemexDriverTest.php index 2b710a4a71c..5dc1e571aa5 100644 --- a/tests/phpunit/unit/includes/tidy/RemexDriverTest.php +++ b/tests/phpunit/unit/includes/tidy/RemexDriverTest.php @@ -288,10 +288,59 @@ class RemexDriverTest extends MediaWikiUnitTestCase { 'foo bar', '

foo bar

', ], + // From the old TidyTest class + [ + ' should survive tidy', + 'foo', + 'foo', + ], + [ + ' should survive tidy', + 'foo', + 'foo', + ], + [ + ' should survive tidy', + 'foo', + 'foo', + ], + [ + ' should survive tidy', + 'foo', + "

foo

", + ], + [ + ' should survive tidy', + 'foo', + "

foo

", + ], ]; public function provider() { - return self::$remexTidyTestData; + $testMathML = <<<'MathML' + + + a + + + x + 2 + + + + b + + x + + + c + + +MathML; + $testMathML = Sanitizer::normalizeCharReferences( $testMathML ); + return array_merge( self::$remexTidyTestData, [ [ + ' should survive tidy', + $testMathML, + $testMathML, + ] ] ); } /**