diff options
author | Ebrahim Byagowi <ebrahim@gnu.org> | 2024-05-16 15:58:33 +0330 |
---|---|---|
committer | Ebrahim Byagowi <ebrahim@gnu.org> | 2024-05-16 16:28:01 +0330 |
commit | a717db8e6088ee2bdc64677d15702bb0ce6fadef (patch) | |
tree | a5319c68f934ff1f1639a12fe3abe3e209fd7aee /tests/phpunit/unit/includes | |
parent | 0adf848c6fd04288c565c1712533c7387b69a662 (diff) | |
download | mediawikicore-a717db8e6088ee2bdc64677d15702bb0ce6fadef.tar.gz mediawikicore-a717db8e6088ee2bdc64677d15702bb0ce6fadef.zip |
Add namespace and deprecation alias to FormatJson
This patch introduces a namespace declaration for the
MediaWiki\Json to FormatJson and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I5e1311e4eb7a878a7db319b725ae262f40671c32
Diffstat (limited to 'tests/phpunit/unit/includes')
8 files changed, 15 insertions, 11 deletions
diff --git a/tests/phpunit/unit/includes/Storage/EditResultCacheTest.php b/tests/phpunit/unit/includes/Storage/EditResultCacheTest.php index 490a4d7df999..bb1ef51fd1f5 100644 --- a/tests/phpunit/unit/includes/Storage/EditResultCacheTest.php +++ b/tests/phpunit/unit/includes/Storage/EditResultCacheTest.php @@ -3,8 +3,8 @@ namespace MediaWiki\Tests\Storage; use BagOStuff; -use FormatJson; use MediaWiki\Config\ServiceOptions; +use MediaWiki\Json\FormatJson; use MediaWiki\MainConfigNames; use MediaWiki\Storage\EditResult; use MediaWiki\Storage\EditResultCache; diff --git a/tests/phpunit/unit/includes/Storage/EditResultTest.php b/tests/phpunit/unit/includes/Storage/EditResultTest.php index e5d077733b8b..b74bc9959ed8 100644 --- a/tests/phpunit/unit/includes/Storage/EditResultTest.php +++ b/tests/phpunit/unit/includes/Storage/EditResultTest.php @@ -2,7 +2,7 @@ namespace MediaWiki\Tests\Storage; -use FormatJson; +use MediaWiki\Json\FormatJson; use MediaWiki\Storage\EditResult; use MediaWikiUnitTestCase; diff --git a/tests/phpunit/unit/includes/Storage/RevertedTagUpdateTest.php b/tests/phpunit/unit/includes/Storage/RevertedTagUpdateTest.php index 9789d6b9cc56..750485655e89 100644 --- a/tests/phpunit/unit/includes/Storage/RevertedTagUpdateTest.php +++ b/tests/phpunit/unit/includes/Storage/RevertedTagUpdateTest.php @@ -3,9 +3,9 @@ namespace MediaWiki\Tests\Storage; use ChangeTags; -use FormatJson; use MediaWiki\ChangeTags\ChangeTagsStore; use MediaWiki\Config\ServiceOptions; +use MediaWiki\Json\FormatJson; use MediaWiki\MainConfigNames; use MediaWiki\Revision\MutableRevisionRecord; use MediaWiki\Revision\RevisionRecord; diff --git a/tests/phpunit/unit/includes/json/FormatJsonTest.php b/tests/phpunit/unit/includes/json/FormatJsonTest.php index f3320e619810..7fd7ec68cbcc 100644 --- a/tests/phpunit/unit/includes/json/FormatJsonTest.php +++ b/tests/phpunit/unit/includes/json/FormatJsonTest.php @@ -1,7 +1,9 @@ <?php +use MediaWiki\Json\FormatJson; + /** - * @covers \FormatJson + * @covers \MediaWiki\Json\FormatJson */ class FormatJsonTest extends MediaWikiUnitTestCase { @@ -223,7 +225,7 @@ class FormatJsonTest extends MediaWikiUnitTestCase { } /** - * @covers \FormatJson::stripComments + * @covers \MediaWiki\Json\FormatJson::stripComments * @dataProvider provideStripComments * @param string $json * @param string $expect @@ -241,8 +243,8 @@ class FormatJsonTest extends MediaWikiUnitTestCase { } /** - * @covers \FormatJson::parse - * @covers \FormatJson::stripComments + * @covers \MediaWiki\Json\FormatJson::parse + * @covers \MediaWiki\Json\FormatJson::stripComments * @dataProvider provideParseStripComments */ public function testParseStripComments( $json, $expect ) { @@ -336,8 +338,8 @@ class FormatJsonTest extends MediaWikiUnitTestCase { } /** - * @covers \FormatJson::encode - * @covers \FormatJson::decode + * @covers \MediaWiki\Json\FormatJson::encode + * @covers \MediaWiki\Json\FormatJson::decode * @dataProvider provideEmptyJsonKeyStrings * * Decoding behavior with empty keys can be surprising. diff --git a/tests/phpunit/unit/includes/json/JsonCodecTest.php b/tests/phpunit/unit/includes/json/JsonCodecTest.php index 0ee4df0662c8..21d00ea8768a 100644 --- a/tests/phpunit/unit/includes/json/JsonCodecTest.php +++ b/tests/phpunit/unit/includes/json/JsonCodecTest.php @@ -2,10 +2,10 @@ namespace MediaWiki\Tests\Json; -use FormatJson; use InvalidArgumentException; use JsonException; use JsonSerializable; +use MediaWiki\Json\FormatJson; use MediaWiki\Json\JsonCodec; use MediaWiki\Json\JsonConstants; use MediaWiki\Title\Title; diff --git a/tests/phpunit/unit/includes/language/LanguageTest.php b/tests/phpunit/unit/includes/language/LanguageTest.php index 0e93ab49c130..42e1d66c29a6 100644 --- a/tests/phpunit/unit/includes/language/LanguageTest.php +++ b/tests/phpunit/unit/includes/language/LanguageTest.php @@ -1,6 +1,7 @@ <?php use MediaWiki\Config\HashConfig; +use MediaWiki\Json\FormatJson; use MediaWiki\Languages\LanguageConverterFactory; use MediaWiki\Languages\LanguageFallback; use MediaWiki\Languages\LanguageNameUtils; diff --git a/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php b/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php index 65ab5c7eadeb..5fcfba9410fa 100644 --- a/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php +++ b/tests/phpunit/unit/includes/registration/ExtensionProcessorTest.php @@ -5,8 +5,8 @@ namespace MediaWiki\Tests\Registration; use Exception; use ExtensionProcessor; use ExtensionRegistry; -use FormatJson; use InvalidArgumentException; +use MediaWiki\Json\FormatJson; use MediaWikiUnitTestCase; use RuntimeException; use UnexpectedValueException; diff --git a/tests/phpunit/unit/includes/utils/MWRestrictionsTest.php b/tests/phpunit/unit/includes/utils/MWRestrictionsTest.php index 0d04e45add39..82b1953fe30d 100644 --- a/tests/phpunit/unit/includes/utils/MWRestrictionsTest.php +++ b/tests/phpunit/unit/includes/utils/MWRestrictionsTest.php @@ -1,5 +1,6 @@ <?php +use MediaWiki\Json\FormatJson; use MediaWiki\Request\FauxRequest; use MediaWiki\Request\WebRequest; use MediaWiki\Status\Status; |