This change provides a workaround and test case for a problem
in the sqlite library:
SQLite truncates strings at ASCII value 00 aka \0. Strings
containing \0 need to be represented in hexadecimal form.
Reported to PHP as bug 63419
https://bugs.php.net/bug.php?id=63419
Change-Id: I2bbc445ffebd41e181edfc3201e6e5514de06142
* Parsoid has to convert HTML to Wikitext in order to support the
Visual Editor. As part of this, it has to insert nowiki escapes
in several places wherever the text might be interpreted as
valid wikitext markup. The new tests test Parsoid's wikitext
escaping capabilities when the result HTML is serialized back to
Wikitext.
Change-Id: I392a5cbc2eeca921fcd4c44cbc37615b583240a5
The Revision object needs the Title to determine the default content model.
Providing the Title explicitely wherever possible avoids an extra database
lookup. Most importanlty, this fixes fatal errors that ocurr when the
database lookup fails due to slave lag or transaction state.
Change-Id: I516e82f7a893b274c513b128b8a46db491160b55
The CDB tests were attemptying to write in harcoded filename
/tmp/php.cdb and /tmp/dba.cdb. Whenever two jobs were running the same
test, we would end up with a mysteriously failling test. The test now
use random temporary file names.
Change-Id: Ia1e58f0c02418e6d01d6730f97b2103ed87eb4f4
* This lets callers use "copy if exist" semantics more easily and avoids extra stat
queries to the backend (since the cache is cleared before doOperations()).
* Tweaked FileOp::fileSha1() to reduce backend stat requests as 404s are not cached.
Change-Id: Icb5ca14b3316f273d53593f48979d14e113990e1
The bug has actually already been fixed, so this
patch just removes extraneous function calls and code in
User::getOption() and User::setOption(). It also adds
unit tests for user options (including a test for the
case provided in the bug report).
Change-Id: Idd8af9cf1a26a4adbde3ca71dde64539ecd0a207
Changeset Iec98e472 changed the behavior of action=parse&page=... when
passed a page that does not exist: previously, it would return a
"missingtitle" error instead of assuming an empty page. As some people
had been depending on this old behavior, restore the error checking.
Change-Id: I4c76ce458ceb01e233c6074cd9251879013ec143
Make sure we only stash a given global only once per test case since we
do not want to override the original value.
This allows the same test to modify the same global multiple times,
while still preserving the original value to be restored after the
test case finished.
Change-Id: I9056d6d6879fb976a192960f661904287f9760a8
The language classes have been using the same setUp() tearDown() to
craft a new language object. I have abstracted that code in
LanguageClassesTestCase and made all the language test classes to extend
it. The language is interpolated directly from the class name and an
object for it can be retrieved with the getLang() method.
Change-Id: Ib931336ce219edabe2c72b7e9f04c976a500723e
WebKit's -webkit-image-set() requires a url() to work however css4-images'
version of image-set permits strings such that image-set( 'asdf.png' 1x ) would be permitted
and would bypass our filters.
Change-Id: I366d04807f66df449f791a5e8e2cb58768124a9a
UserTest::testEditCount did eleven calls to doEdit which is slow when
used with the sqlite backend. I have made to do less edits and also
marked it as '@group medium' which means the timeout will be 10 seconds
instead of 2 seconds.
Change-Id: If2d055075470f837009568d56b1119a57b177ba3
Syntax:
* Call parent setUp from setUp.
* Set required globals for the test inside the test class instead
of assuming the default settings.
* Data providers are called statically and outside setUp/tearDown
("public static function")
* Test function names should be prefixed with "test"
("testIsRedirect")
* Marked 2 functions as unused. JavascriptContentTest has 2 data
providers for tests that don't exist in it (nor in TextContentText)
but do exist in WikitextContentTest.
Style:
* Single quotes
* Remove odd comment "# =====" lines
* Consistent tree wrapping with arrays.
array(
array(
.. ) );
array(
array(
..
)
);
Some were closing on the previous line instead.
Made it consistent now.
* Remove odd indentation to make nested arrays line up:
array( 'foo' => array( 'bar' => true,
'baz' => array() ) )
array( 'foo' => array(
'bar' => true,
'baz' => array()
) )
We don't do this kind of indentation because it is fragile
and becomes outdates when any of the earlier keys ("foo")
change. Converted to a regular tree instead.
Also triggered git warnings for mixing spaces with tabs, which
is almost always an detector for this style.
* Not using @annotations in inline comments, reserved (and only
parsed/meaningful) for block comments.
Follows-up 8b568be5e2
Change-Id: Ic55d539b9a58f448b550bcd98894d389764e0694
* Fixes bug 11748 (Parser issue for HTML definition list) and similar
issues for nested unordered / ordered lists
* Stops wrapping HTML-syntax definition lists into paragraphs
for consistency with their wikitext variants
* Enables one previously disabled test and adds another for nested
definition lists with HTML syntax
Change-Id: If75ed54e11452dbcf5e6213cc20923064f811715
This reverts commit b218064865
Appears to have been merged prematurely. More comments were made after merge, there's an i18n technicality that I5840cc2f would address and there appear to be some design issues that have been discussed on wikitech-1 in thread http://lists.wikimedia.org/pipermail/wikitech-l/2012-October/064036.html
Some class extending MediaWikiTestCase did not call its setUp method. We
most probably always want to do it since MediaWikiTestCase::setUp() does
garbage collection and might do more in the future.
Change-Id: I68dde370a62c8f4a779836ca0c4ad06844fdc916
This caused about 200 exceptions "MWException: Error in MediaWikiLangTestCase::setUp(): $wgLanguageCode ('fr') is different from $wgContLang->getCode() (en)" on my installation.
Change-Id: I2987db68e22b27d8d36cdae118356fd7612e56a4
ContentHandler removed wikitext parsing for CSS and JS pages.
However, people seem to rely on links and categories embedded
in script comments.
Change-Id: I0736f15878fbd3292e75854bf16f04df656ce363
Rather trivial test for User::getEditCount as suggested by
Siebrand in https://gerrit.wikimedia.org/r/26457
This required adding the User in the test to DB, as the data
is written to and read from the DB.
Change-Id: Ic4e55c01247158315b759654b34fdbdf9a61db01
the sort method allows programmatic sorting as well as instantly sorting
the table when initialising the tablesorter; furthermore, the method can
be used to reset sorting (e.g. if rows have been added later via JS);
sortEnd event may be used to reapply alternating table row colours or other purposes
patch set 2: fixed mentioned issues and added another test
patch set 3: addressed all further issues, introduced more obvious way to
specify sorting
patch set 4: implemented sort method instead of using an event; reprashed whole commit message; introduced 'sortEnd' event
patch set 5: fixed white space error
patch set 6: Add release notes and rebase
Change-Id: Id14862100cd27ebd6980c48dcf497db229c4301f