Commit graph

3079 commits

Author SHA1 Message Date
Antoine Musso eaed42d8e4 tests: skip math table creation for SQLite DB
SQLite has global indices, not per table one.  When using the database
updater to create the `unitest_math` table, we would get an error
with a duplicate `math_inputhash` index which is created by the the
database installer.

This patch skips the testBasicCreateTable() test on sqlite.

Change-Id: I6da56d67d7af45f86cf6163cf73f5464505b43f3
2013-04-26 14:17:03 +02:00
physikerwelt 08b93eebd6 renaming of read and write methods for database access
readFromBB->readFromDatabase
writeDBEntry->writeToDatabase

Change-Id: I426be5dc479ad789d0e85b149a989a581945c9be
2013-04-24 06:03:37 +00:00
Physikerwelt 10662ea6e3 rename tests/MathRenderTest.php
Rename according to base class that we test.

Change-Id: I8b8969fa3f6b8b5d78ac9b5308db2ba2b4181226
2013-04-17 20:08:37 +00:00
physikerwelt 4822324c61 Merge "additional phpUnitTests" 2013-04-11 16:26:36 +00:00
Translation updater bot 1376c7a033 Localisation updates from http://translatewiki.net.
Change-Id: I6fc4ca9b56c8dd53983e59f8ff62ed258a263caf
2013-04-07 20:53:47 +00:00
physikerwelt c22f628a68 additional phpUnitTests
adds two new phpUnitTests for the abstract MathRender class
and another one that test the basic database access.
Therefore the read and write methods have been made changed
from protected to public.

Change-Id: I77a8b0a4dfe7529b5521ead097ac7b518688ef70
2013-04-07 20:21:35 +02:00
Translation updater bot 0ede088c83 Localisation updates from http://translatewiki.net.
Change-Id: Icf520f109f9bfb0a8ccb257fded7b9abcb488177
2013-04-04 20:00:42 +00:00
Translation updater bot 4b4f8c2144 Localisation updates from http://translatewiki.net.
Change-Id: Ie1097f574b5a4386874f331802adf2eb04b7dcad
2013-04-02 19:05:21 +00:00
Translation updater bot 27796cf005 Localisation updates from http://translatewiki.net.
Change-Id: I215a0b3ebd8518f88aac1105c171771dff72560d
2013-03-26 21:15:49 +00:00
Translation updater bot 4f9701cf8f Localisation updates from http://translatewiki.net.
Change-Id: Ib2ca7bddd5820e3d2694c754900992c518ddaa2c
2013-03-25 19:59:15 +00:00
Liangent 20192a1ab8 Do proper pre-pack processing for $this->hash.
Output hash calcuation sometimes fails because of Texvc failure for
example, and $this->hash remains ''. At this time inserting null as
outputhash into database is improper, because that column is NOT NULL.

With this patch an empty string '' is inserted instead, and the if-check
is modified to avoid cases where ->hash exists but evaluates as null
(for example when it's '0000000000...' though it's extremely rare).

Change-Id: I852859f4b151b777c11b743faaed61dfc2c029a7
2013-03-13 21:56:53 +08:00
Matthew Flaschen aa8a0eaf19 Write cache unless there *is* a cache hit:
Moves writeCache call back to hooks (changed in 9ba4ef269d)
 and makes it unconditional, so only one part of the code decides
whether to write to the cache.

Bug: 45973
Change-Id: I6b387795304ff15c960fcf0f5354a9ac939e1212
2013-03-12 00:38:45 -04:00
Matthew Flaschen 3916ac167c Revert "(Bug 45973) Fix check for avoiding re-cache"
Revert unreviewed self-merge with pending issues.

This reverts commit f5422cf85a.

Change-Id: I17471e2adccf54b79a9d8185c4a6f4b6937ce622
2013-03-12 00:24:43 -04:00
Ori Livneh f5422cf85a (Bug 45973) Fix check for avoiding re-cache
If the request could not be served from the cache, we *do* want to cache it.

Change-Id: Id58dac55ce79f568e4b4a42a155235af5a46bf7f
2013-03-12 04:16:21 +00:00
Translation updater bot 20af9faba6 Localisation updates from http://translatewiki.net.
Change-Id: I8a8017dd81d6afbe4b160d380843973e0139834f
2013-02-24 20:39:47 +00:00
Translation updater bot 9320742fce Localisation updates from http://translatewiki.net.
Change-Id: I209506266dfee0d80e213c1542130e6b81e00399
2013-02-22 20:12:04 +00:00
Ori Livneh 9ba4ef269d Only update the cache on cache miss
Change I9b1d68c4faa8d177d8d0088fa1a5879caed4f1fe added an indiscriminant call
to writeCache(). I assume that it was supposed to be regulated by the check for
$this->isRecall() (which is a getter for '$this->recall'), but there was no
concomitant change to ensure that recall is set true on cache hits.

My fix does not set recall to true. The style of "pass-by-attribute" is tricky
and should be factored out by a subsequent change. This change moves the call
to writeCache() so that it is only called on cache miss.

Change-Id: I9b690e55001859c97fd40330272791d49ec6de75
2013-02-21 17:39:17 -08:00
Ori Livneh 7831957091 Add unit tests, demonstrating how to stub out deps.
Physikerwelt asked for some guidance on how to write good unit tests for
classes that depend on external resources. I wrote a few to serve as examples
for additional tests. Because they have an ulterior didactic purpose, the
comments are a bit more verbose than I would otherwise like, but despite that
the tests are good enough to merit being merged.

Change-Id: Ifa97eec1a68fb68b4744d1e5b192b410afe5ef68
2013-02-17 20:55:47 -08:00
Moritz Schubortz c869831f45 Add and register PHP unit tests for MathSource class
This change adds test cases for the MathSource class and registers a
hook for loading these tests. Also adds documentation about how to run
these tests in README.

Change-Id: Ie58a273326e0353dfa4437b3de21a2393adb5a87
2013-02-17 20:23:50 +00:00
Daniel Friesen 48b029fbe9 Fix MathRenderer::renderMath.
The call to getRenderer is supposed to be a static method in the same class,
not a global function.

Change-Id: I5d101574b1d67238c6357e154209f2595cb36859
2013-02-17 10:32:09 +01:00
Matthew Flaschen 8a04254e6d Change default LockManager back to nullLockManager.
* This was changed in 926db7c3bd as a workaround for a testing issue.
* See 8cbd679aac781bdd73038064261736a937645fc1 , which fixes the test harness in core .

Change-Id: Ib57cafee35a699ce875ee4bc8951781e1a37553a
2013-02-08 13:59:26 -05:00
Physikerwelt 926db7c3bd Restructuring Math classes
The Math.body file which contains the MathRender class was split in the following way:
- Math.base contains the base class with the database related stuff and provides an abstract interface
- Math.source and Math.MathJax handle the plain tex string output. There are two classes since they
  will differntiate in the future I think.
- Math.texvc contains the "old" implementation of png generation with all the file handling related stuff
- Other implementation of math renderer can be added in the same style.
- Cleanup to better follow coding conventions.
- Changed LockManager to 'fsLockManager'

The first attempt restructure the class layout and introduce LaTeXML at the same
time was dropped. Instead this was split up into two phases.
This commit only deals about the restructuring of the math module design.

Change-Id: I9b1d68c4faa8d177d8d0088fa1a5879caed4f1fe
2013-02-07 20:35:45 -08:00
Timo Tijhof c14159404f JSHint: Equality, unused arguments and other minor remnants.
After this jshint passes.

Change-Id: Iee640a1d485ac23caaa783b0069ce9f1616db9ad
2013-02-06 20:20:14 -08:00
Timo Tijhof 282960c4ba JSHint: Fix var statement and global scope issues.
Change-Id: Ia567d10b72f86963eb344cd5579738532531d3d9
2013-02-06 20:14:02 -08:00
Timo Tijhof 8a29221a83 JSHint: Fix curly braces.
Change-Id: Ib59ab38b2c3d9270d882798242e796b823206a50
2013-02-06 20:08:22 -08:00
Antoine Musso ca6a896cb0 JSHint: Fix quotmark and semicolon warnings.
Change-Id: I2ab9e7ce308fd47336f86d2571e8450347321f10
2013-02-06 20:02:47 -08:00
jenkins-bot 33c30a0d6c Merge "JSHint: Add .jshintrc" 2013-02-07 03:54:57 +00:00
Antoine Musso b13ec348ac JSHint: Add .jshintrc
Based on settings from MediaWiki core.

Change-Id: I71345f6906d430fcca750c995a689f785831e3f8
2013-02-06 19:54:07 -08:00
Translation updater bot a10ba58bc8 Localisation updates from http://translatewiki.net.
Change-Id: I47597423a9fd654cf999e7b9e7db29eb2ce7d21a
2013-01-29 21:02:36 +00:00
Translation updater bot 394275be20 Localisation updates from http://translatewiki.net.
Change-Id: I43d0cf6b012936f76379b87cd2834255e6394d19
2013-01-27 18:53:37 +00:00
Translation updater bot f9de81a9da Localisation updates from http://translatewiki.net.
Change-Id: Idb8014be033c9cf376ae8cec3c2fc0ad1878867f
2013-01-27 17:48:22 +00:00
Translation updater bot 3044599afe Localisation updates from http://translatewiki.net.
Change-Id: Ie9a3d11ff06a6852fb0f560de0a04c401a576c26
2013-01-22 20:50:00 +00:00
Antoine Musso b029a4037e JSHint: ignore modules/MathJax
modules/MathJax is a third party library, we do not want to report
JSHint errors for it. Any errors there should be committed upstream.

Change-Id: I48a73eacb635149141e554853bf4aef65ecdcd49
2013-01-18 12:22:28 +01:00
Translation updater bot 766d548df9 Localisation updates from http://translatewiki.net.
Change-Id: Ic1a1c5e39aafb630c5d2d2478e39e869a3a7fc9b
2013-01-06 20:12:18 +00:00
Ori.livneh 33ee76cdae Merge "Rename Math.body to MathRenderer to be consistent with the class name. Reson: Further classes will be added in the next step." 2013-01-02 04:25:39 +00:00
Translation updater bot 3318be4b31 Localisation updates from http://translatewiki.net.
Change-Id: I97a3f906e57f5a06ff20040d197148c3d25daee7
2013-01-01 20:24:00 +00:00
physikerwelt 7ff47f898f Rename Math.body to MathRenderer to be consistent with the class name.
Reson: Further classes will be added in the next step.

Change-Id: I9dba8c1fca11cbc51fa11edebabde4687d17e312
2013-01-01 17:16:35 +01:00
Translation updater bot 075abb7b1e Localisation updates from http://translatewiki.net.
Change-Id: I67f28a8026b7b9844ad1b3b39dafaa0f97f54419
2012-12-27 21:23:09 +00:00
Translation updater bot 02f89f6ac0 Localisation updates from http://translatewiki.net.
Change-Id: I76b50906fafff8511ba070b8c14e502aacbe8be6
2012-12-09 20:27:54 +00:00
Translation updater bot 62a0074461 Localisation updates from http://translatewiki.net.
Change-Id: I750d911086f7b626f51b48dc66d3bcd3d4e8a41e
2012-11-16 20:38:02 +00:00
Translation updater bot 162e9bdfef Localisation updates from http://translatewiki.net.
Change-Id: I673e5fd0462ff3268f62f3ccf7a80a324541e751
2012-11-13 21:09:27 +00:00
Translation updater bot 5dee7e52c3 Localisation updates from http://translatewiki.net.
Change-Id: Icdef993aebf324a0b6354dfe66648459f3011a90
2012-11-11 20:56:22 +00:00
Derk-Jan Hartman 7e58acc95a (bug 36855) escape literal % in tex input
This removes support for MathML % comments, just as with texvc

PS2: Fix for regex lookbehind issue

Change-Id: I0cb026d749733ed3dbba8faacb163be4438fc6bb
2012-11-01 16:22:59 +01:00
Translation updater bot a998a493b0 Localisation updates from http://translatewiki.net.
Change-Id: Ied923fb20ec7550e956d7e804e17222fb2e9b5da
2012-10-28 21:11:42 +00:00
Translation updater bot 47e3cdbfe4 Localisation updates from http://translatewiki.net.
Change-Id: I02d00d05131aa8e23513241cb0fe6a060f2d3fd6
2012-10-22 01:21:46 +00:00
Aaron Schulz b3b28e5892 Fixed file mode setting.
Change-Id: I3d933fbfe2078e6ae9f990df47206bc38ce8f675
2012-10-17 09:27:55 -07:00
Translation updater bot 5bbee223c4 Localisation updates from http://translatewiki.net.
Change-Id: I693cdfd1b538539be1e15d7af89e2cdf269c959f
2012-10-06 21:29:28 +00:00
Siebrand Mazeland 22a09c87d3 Replace remaining wfMsg* call.
Also remove some trailing whitespace.

Change-Id: Ic7a706a894dd07ca638173f2fc6e1695a05f914b
2012-10-04 19:42:13 +02:00
Translation updater bot d4eea42233 Localisation updates from http://translatewiki.net.
Change-Id: I7ec4855c055ffc6b4d13ce16ad237e59ff74e2bb
2012-10-02 13:48:17 +00:00
Translation updater bot 2a9f5a7ece Localisation updates from http://translatewiki.net.
Change-Id: Id5b5b394f913ee38542241e75eff7ea2276c07c4
2012-10-01 20:02:22 +00:00