Commit graph

5 commits

Author SHA1 Message Date
Tim Starling
5e30a927bc tests: Make some PHPUnit data providers static
Just methods where adding "static" to the declaration was enough, I
didn't do anything with providers that used $this.

Initially by search and replace. There were many mistakes which I
found mostly by running the PHPStorm inspection which searches for
$this usage in a static method. Later I used the PHPStorm "make static"
action which avoids the more obvious mistakes.

Bug: T332865
Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
2023-03-24 02:53:57 +00:00
James D. Forrester
ad06527fb4 Reorg: Namespace the Title class
This is moderately messy.

Process was principally:

* xargs rg --files-with-matches '^use Title;' | grep 'php$' | \
  xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1'
* rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \
  xargs rg --files-with-matches 'Title\b' | \
  xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1'
* composer fix

Then manual fix-ups for a few files that don't have any use statements.

Bug: T166010
Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a
Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
2023-03-02 08:46:53 -05:00
daniel
80d8af47f7 Produce HTML for invalid JSON
implementations of ContentHandler::fillParserOutput MUST set HTML if
$cpoParams->getGenerateHtml() returns true.

Bug: T321319
Change-Id: Ibd43f7420e949666649752dce7072dc35bc1f440
2022-11-03 16:44:47 +01:00
Siddharth VP
3af9036b99 Customise error message for invalid JSON, add hook
When invalid JSON is being saved, change the error message from the
generic "invalid-content-data" to "invalid-json-data" with the specific
error passed as param.

Allow extensions to hook into JSON validation, enabling them to apply
additional validations for specific JSON files such as MediaWiki:*.json
config files. The page identity is passed to the hook.

Bug: T313254
Change-Id: If9590c29ed0b871b03a3db8f13e72ee9cfdd7e2b
2022-08-26 01:22:10 +05:30
Roman Stolar
fa5237eb48 Replace Content::getParserOutput call to ContentRenderer::getParserOutput
Bug: T287158
Change-Id: I8a13f45027e08e2d8ddefa140dd47a0c55094934
2021-10-20 12:11:24 +03:00
Renamed from tests/phpunit/includes/content/JsonContentTest.php (Browse further)