This is doing a bulk of the job of creating a service
for working with math modes configuration. There's
still things to do, like moving math mode names,
and perhaps depending on default user options to
provide a bit more convenience, but that will be the
next step.
Change-Id: I1259a93651920f44104f2f5135e3e620c858be8d
When running tests locally I don't want to install wikibase
if I'm not working on wikibase-math integration. It's
annoying that some of the tests fail in this schenario.
Depends-On: Id996abdb353547b95d795494ba961b9a215ef2ef
Change-Id: I836c7a3bab5393b7482e985d9148226373ae0a58
Additionally - remove RestbaseInterface::checkBackend.
When HTTP requests are banned from unit tests this method
makes no sence.
MathoidCli tests were not reenabled cause it's a bit hard
to mock shell acceess. Hopefully as part of Shellbox
transition we can have MockShell trait in core and reenable
those tests
Bug: T265628
Depends-On: I350ed59af603a0504704af3265787a4be8f2dc2a
Change-Id: I294d0ed905193850dc38cb3071eb9b31c8863121
The overall aim is to make renderer and checker
proper services and stop storing each operation
state in them. This patch reduces the number of
places where we store the lastError. I've decided
to stop here in the first pass so that the patch
doesn't grow out of proportion.
Change-Id: Ice7e1f9f2f074d62ef1819355a510ce0b0335d88
Instead of having a separate method for getting the post data
in MathLateXML, we can just override getPostData method from
parent and make the makeRequest method signature much simpler.
Change-Id: I07b683856885396ff7b6b5a40df79399828c8214
This is not the job of an extension to be a load balancer.
This feature was already deprecated and is not used in WMF prod.
Change-Id: I950dbaf45bc40d9d9ed61b1c98b339d3d38326fc
* Reenable math validator tests
* Introduce $wgMathUseRestBase which defaults to true
and determines if mathoid is used via RESTbase or directly
* The effect of this change can be tested by setting $wgMathUseRestBase
to false, and then creating a new statement of a property with type math.
One should see a connection to mathoid for every new string and one should
also see the WAN cache for the check endpoint to fill up. Note that
setting WANObject cache to the database simplifies the investigation
of the WAN cache content.
Bug: T274436
Change-Id: I40109e9e09464da78bf855646fb800ee87c1ea67
* Keep status code and response in memory
* Allow external cache preloading.
This will be required for the one-stop mathoid batch rendering
* Duplicate functionality from the restBASE interface
** Error rendering
** Validity checks
** getter for validated tex
Depends-On: Ic779e671ada0d0306e0935e578b47c431abd520e
Change-Id: I066975b9ba03f5861f6c92687cba4743044ea82a
composer:
* mediawiki/mediawiki-codesniffer: 34.0.0 → 35.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPublic
* MediaWiki.Commenting.PropertyDocumentation.WrongStyle
* mediawiki/minus-x: 1.1.0 → 1.1.1
npm:
* eslint-config-wikimedia: 0.17.0 → 0.18.1
The following rules are failing and were disabled:
* no-useless-escape
Additional changes:
* Added the "composer phan" command to conveniently run phan.
Change-Id: I1c641a4945f94337ca22763920601400ee9ab691
Before the HTTP tests were blocked T265628, the Math extension did
test all examples from w:Help:TeX and additional regression test
against the configured mathoid/restbase instance. Effectively, those
tests did only verify the hashes returned from mathoid/restbase.
We now drop this kind of integration test.
Bug: T265646
Change-Id: Iffe5105457297fdc2222af9f11ff56e78c479f32
Use WANObjectCache rather than genuine DB tables for greater
flexibility.
Note, this commit is the second step of Ifd89e2d9cb30fa15cc318f077b434207ed6b7214
Bug: T252390
Change-Id: Ifa7d943875f05088ef697a5a18ad292342a9b4ad
Introduce new namespace \MediaWiki\Extension\Math\ and move checking
code to this new namespace.
Note, this commit is the first step of Ifd89e2d9cb30fa15cc318f077b434207ed6b7214
Bug: T252390, T187154
Change-Id: I8c93f4b21d4a72ef2d52d4774d69e4ef55d037ec
Using assertContains() with string haystacks is deprecated and will not
be supported in PHPUnit 9. Refactor your test to use
assertStringContainsString() or assertStringContainsStringIgnoringCase()
instead.
Change-Id: Ic35f3c60a7f49dfe244b87192d7f161c117b37e1
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
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate
Change-Id: I57bb0f5bc4167ea4b4a50d666ad95c02fcc7d8c9
* Get rid of a few more MockBuilders and mocks that aren't needed.
* Make sure the original constructor is always called. This is highly
relevant for I263a711.
* Fix mixed order in assertions. In PHP, the expected value comes first.
* Add some missing inline @var type hints.
Change-Id: Ia15d62af56dfdb61bc2514aa994ce3d4ecd6e077
* Replace MockBuilders with straight constructor calls, if possible.
* Use TestingAccessWrapper instead of using reflection directly.
* Favor assertSame instead of the loose assertEquals. Note how this was
actually hiding a bad assertion in one place.
* Remove some tiny pieces of dead code.
This was motivated by I263a711. I hope this patch here helps unblocking
the other.
Change-Id: I66efb818243a41aeed5fcd51fd520cd0d4acee4d
Some mentioned a "__constructor", which should be "__construct".
The leading backslash is not strictly needed by all tools. But some
need it. I learned it's best practice to always have it.
Change-Id: I22fe3a3b4828c02ab5a457aba9af5af1c72567ea
Gets warning information from restbase and adds tracking categories
for deprecated chemical syntax.
Refactor mechanism to add tracking categories, and avoiding rechecking
already checked formulae.
Depends on: Ieca66f45ae7685d61eece1624bd7ff65ccad2eaa
Change-Id: I10e78ab79015dc1331f645c60b25bbbd237e23fe