Commit graph

21 commits

Author SHA1 Message Date
DannyS712 4868d632c1 MathGenerateTests: Remove use of $wgUser
Being written to, but not read from, so shouldn't be
needed anymore - set the User of the main RequestContext
instead.

Bug: T248550
Change-Id: I32d50e7bcd81ed77646d625e1a10b0e91e5d6c21
2020-12-09 01:03:32 +00:00
Reedy 2c220ddabc Fix PSR12.Properties.ConstantVisibility.NotFound
Bug: T253169
Change-Id: I816b6d26471527137cbddd313cd432f0a37db891
2020-06-05 00:17:18 +00:00
Thiemo Kreuz a429c8cc35 Fix escaping issues and a series of unrelated code cleanups
Actual changes:
* Let the special page accept the subpage parameter, e.g.
  [[Special:MathWikibase/Q6203]].
* Fix some of the message escaping issues in SpecialMathWikibase.
  Messages that are just plain text and not supposed to contain any
  parameters, wikitext, HTML, or something like this should be
  properly escaped, either via Html::rawElement( $msg->escaped() ) or
  better Html::element( $msg->plain ). The later approach is cheaper.

Other code cleanups that don't affect production:
* Reduce the amount of duplicate code in SpecialMathWikibase.
* Make use of the preg_match() return value.
* Remove default parameters from parent::__construct() call.
* Remove some auto-generated comments.
* Remove some comments that don't add new information, but just repeat
  what the code already says.
* Make use of PHPUnit's assertCount().

We can split this patch into smaller patches, if you prefer. This
should especially be done if one of the changes is controversial, to
not block the other changes. Please tell me.

Change-Id: I8c20014435af3d2ac9c7381fe5fd00b9fe49b2c2
2020-03-21 14:53:15 +00:00
peter-ovchyn 90b26c0878 parser: Replace 'new Parser' in favour of using ParserFactory/MediaWikiServices
Bug: T244055
Change-Id: I4049f155d066b165f0d5ec634da54b0bfed89188
2020-02-18 12:55:14 +02:00
libraryupgrader 863794c1dd build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Change-Id: Id4f976b7ec94e1d2be0421725733804f24dec2c5
2019-12-29 17:56:56 +00:00
Umherirrender a72741e313 Use Maintenance::addDescription
It is better to use a setter function than setting a property

Change-Id: I1df2d03cfaede53867daf9db8e26af5931c77ef9
2019-08-19 19:59:17 +02:00
Umherirrender adddfee59f Fix title comparision in maintenance script
Change-Id: I1ddba0fd5fc5ee1c060732026b1699a44b6bf220
2019-05-27 21:20:36 +02:00
Thiemo Kreuz 5648b8e2c3 Make use of the …::class feature whenever possible
Note that a class is not resolved this was. …::class is not a function
call. It's more like a named string constant. Technically still a
string. The advantage is that IDEs and tools like linters can much easier
understand that these strings refer to a class, and list them in usage
reports, renames, and such.

Change-Id: I5225543dbb837685a1840837cb2772dd576cca38
2018-06-06 12:13:04 +02:00
Moritz Schubotz (physikerwelt) b5cf0e0b77
Serve png mode from mathoid
* Use the exactly same routines to deliver png images that are used in
  mathml mode.
* Change the output to use mathoids png image rather than the mathml
  and svg output.
* Locally tested on Firefox and Chrome: Depending on the mode either
  the SVG or the PNG path is used.

Bug: T74240
Change-Id: I4b1cac92eb9a02190f316faab6621940951603d5
2018-05-21 13:47:49 +02:00
Kunal Mehta fbd17b4fef build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.DuplicateReturn
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.Commenting.FunctionComment.WrongStyle
* MediaWiki.FunctionComment.Missing.Protected
* MediaWiki.FunctionComment.Missing.Public
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Change-Id: I46c900a5652a6560d18be6cd67badc37ed7f8d97
2017-06-21 00:59:25 +00:00
IvanFon b4eb57f164 Updated maintenance scripts to use $this->requireExtension()
Added $this->requireExtension() in maintenance/MathGenerateTests.php

Bug: T152139

Change-Id: I79670c9102e1ea97390edc4c8408d269f3967547
2016-12-17 15:23:58 -05:00
physikerwelt 6699724d65 Convert all array() syntax to []
Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Change-Id: I1d2604e3f246ede58ff8245ba2b940f258d2d80c
2016-04-13 10:18:23 -04:00
paladox df8ad1c799 Add php code sniffer to composer
Add support for php code sniffer

Change-Id: I7dcdd88be4f1f8219f71ab770979284761e09bae
2015-09-23 10:46:14 +01:00
physikerwelt bc52c77d24 Use extension.json, empty PHP entry point
* Use string constants instead of integers
* Derive new names from old via conversion of constant
  naming convention to CamelCase.
* Replace old constant string e.g. 'MW_MATH_ABC_DEF'
  with new string 'abcDef'
* Replace old constant value with new string.
* Tests to demonstrates what is actually done.
* Rename constants

Bug: T106630
Bug: T106631
Bug: T87941
Change-Id: I6d1094ece79e912d9ddbef6681a25196c7a6e801
2015-07-30 22:01:20 +00:00
jenkins-bot 8477bdb059 Merge "Minor clean up, optimisations and documentation corrections" 2015-01-22 19:39:56 +00:00
Timo Tijhof 83da0338ec Minor clean up, optimisations and documentation corrections
* Handle-error-first approach for consistent function body
  termination at the root with the main intend, and less indention.

* __DIR__ instead of dirname( __FILE__ )

* Single quotes.

* Correct pickHost documentation: wgMathMathMLUrl is not an array,
  and is not used in this method, that's at a different level
  of abstraction (via the constructor).

* White spacing.

* require_once is not a function.

Change-Id: Id4bec8415893245e2569a39ab5406a0820238ae4
2015-01-22 10:56:16 -08:00
physikerwelt (Moritz Schubotz) b09107025b Improve Math test generation
* Use the wikitext parser and not regexp to extract math
  tags from the page.
* Extract the attributes from the math tags as well

In a follow up a pseudo attribute in the math tag could
be introduced to provide a bug description.

Change-Id: I0dec18d4e3f87e7b58b097b2a08c4897ceaf29ac
2015-01-19 21:38:58 +00:00
C. Scott Ananian 7914fbea61 MathCoverageTest: encode test file using JSON instead of PHP serialize.
This ensures that changes to the test inputs or outputs yield readable
diffs when reviewing.

Change-Id: I7b4ef8102ad7fbf7c289a27db60f304a140b93a5
2014-10-12 18:02:50 +00:00
C. Scott Ananian 5cc82325c2 Sanitize filesystem paths before emitting ParserTests.data.
Change-Id: Ic348aa040d3b0e64716a51f5681ef289842118f0
2014-07-24 17:55:02 -04:00
Moritz Schubotz (Physikerwelt) 3a36b25ee3 Fix: Allow <div /> as valid Math output
Some simple math tags such as the rendering result of
$\mathcal{ABC}$
are converted to an HTML-div tag by LaTeXML if inline-mode
is used. This change
* makes the $wgMathDefaultLaTeXMLSetting easier to read
* improves the XML validation of the LaTeXML output.

Change-Id: I807dbfa3a45930deec8eb5615133be9a39f3f101
2014-04-08 16:13:28 +00:00
physikerwelt 94b035b26a Coverage tests for the Math extension
* Include generated tests for a better test coverage
of the Math extension.
* Compiles texvc in testsuite (if required)
* Test generator now included
* Replaces the old parser tests
* Fixes whitspace issues

Bug: 61090
Change-Id: Iff7eeb5ee72137492c3f6659e4d4d106e5715586
2014-03-11 15:35:07 +00:00