Commit graph

10 commits

Author SHA1 Message Date
Daimona Eaytoy
48a1c0bb2f Autofix spacing around commas
This was done automatically using the
`Universal.WhiteSpace.CommaSpacing` sniff, which will be included in the
next release of the MW PHPCS config.

Some of these have been adjusted manually where the autofix broke
vertical alignment.

Change-Id: I54a4668d8a2759b9d7de47742c943a535a04e211
2023-10-25 01:08:44 +02:00
Subramanya Sastry
062fd08e51 Remove all Parsoid debugApi references and uses
* Was used during the Parsoid JS -> PHP port and is no longer used.
* This also eliminated the need to inject ParsoidSettings into some
  classes.
* Once this merges and lands in core, I'll remove this from the Parsoid
  repo as well.

Change-Id: I008d30ea81f5a3db26e512c87762b90e3ca3c4ff
2023-09-14 14:48:48 -05:00
Subramanya Sastry
1738e1eec3 ParsoidHandler: Look up page title from oldid, if available
* Without this, the TransformHandler creates a 'newMainPage' in
  TransformHandler::tryToCreatePageIdentity. This then causes the
  page and revision to not correspond to each other.

* This somehow didn't matter so far, but in my patch where I try
  to integrate ParsoidOutputAccess and ParserOutputAccess,
  ParserOutputAccess has a precondition check asserting that the
  page and revision object agree on the page id and causes some
  of these selser tests to fail.

* Got rid of the titleMissing derived property in request attributes
  since it felt extraneous.

Change-Id: I10ea62c2076f0ca9ba160b753bdca2ad0f8b40cd
2023-09-01 21:55:31 -05:00
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
Tim Starling
f600d07ec4 Fix tests that fail when $wgUsePigLatinVariant = false
* ParserTestRunner: LocalisationCache needs to be reset since it has a
  reference to LanguageNameUtils which has a copy of
  $wgUsePigLatinVariant. Also factor out some
  MediaWikiServices::getInstance() calls.
* In some other tests, set the variable.

Change-Id: I6c1e9bfad9790cf805809c28a3f8d45952cbb981
2023-03-17 19:56:32 +11:00
Derick Alangi
1afd52e3e4 REST: Move Helper classes to their own namespace
Mixing Handlers with Helpers doesn't look nice for consistency
reasons. Helpers should be in their own place (grouped) in the
Handlers directory as they're really "helpers for the handlers".

Change-Id: Ieeb7a0a706a4cb38778f312bfbfe781a1f366d14
2023-01-16 21:16:09 +01:00
Abijeet
803092d4af tests: Remove unnecessary override to use pig-latin
Pig latin is enabled by default since
Ia80ad33cbf5e311fa8b84bd765a8df8d156f4c38

Change-Id: I0cd922bb0ee1fd7bce2ced2eacbdb6ed25ada7d8
2022-12-08 17:52:00 +05:30
daniel
654d1d0dd1 TransformHandler: add test for variant conversion
Change-Id: I91acc9b4306a8170be5e4f94377aab764e185807
2022-09-26 12:57:08 +02:00
Subramanya Sastry
86f2b26589 Don't hardcode Parsoid HTML version number in tests
* Without this fix, the test fails vendor patches whenever Parsoid's
  default version number is bumped in the Parsoid repo.

Change-Id: Icce7b61dfbbbbd57b4f1ed76a32d160e92b48b15
2022-08-12 14:29:25 -05:00
daniel
3f1cf31740 phpunit tests for ParsoidHandler::html2wt
The test cases were mostly ported from tests/api-testing/REST/Transform.js

Change-Id: Ie6b9f28b6e49e44c64f1fa73ca11e21c2b451474
2022-07-18 13:51:49 +02:00