Commit graph

1862 commits

Author SHA1 Message Date
daniel
7c94de3ca9 Merge "Fix handling of strings containing \0 in SQLite." 2012-11-02 14:18:15 +00:00
daniel
9205808960 Fix handling of strings containing \0 in SQLite.
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
2012-11-02 14:23:55 +01:00
GWicke
8cc58e0065 Merge "Added Parsoid WT escaping tests (several disabled for PHP parser)." 2012-11-01 18:27:04 +00:00
Demon
dc0e410e29 Merge "(Bug 41574) Supply Title object to Revision if possible." 2012-11-01 16:48:48 +00:00
Subramanya Sastry
16fabec277 Added Parsoid WT escaping tests (several disabled for PHP parser).
* 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
2012-11-01 11:24:52 -05:00
daniel
b5b2b2f898 (Bug 41574) Supply Title object to Revision if possible.
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
2012-11-01 13:48:18 +01:00
Antoine Musso
cab4d81554 race condition in CdbTests
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
2012-11-01 11:48:18 +01:00
Nikerabbit
8eb98ba47b Merge "WikitextContentHandlerTest expects the messages to be in English." 2012-10-31 07:27:01 +00:00
Aaron Schulz
24a6e8eab6 [FileBackend] Support "ignoreMissingSource" for copy and move operations.
* 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
2012-10-31 04:24:05 +00:00
Platonides
3a80732d1c WikitextContentHandlerTest expects the messages to be in English.
The 4 testGetAutosummary were failing with the wiki configured
to a different language.

Change-Id: Ibb003a8d5758b25032e0e7df98dfc90d149409db
2012-10-30 23:48:17 +01:00
parent5446
edf5632f6a (bug 37963) Fixed loading process for user options.
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
2012-10-30 20:28:39 +01:00
Catrope
9f936d5941 Merge "(bug 41042) Regression: API action=parse with nonexistent page" 2012-10-29 20:03:16 +00:00
Brad Jorsch
3756f810bc (bug 41042) Regression: API action=parse with nonexistent page
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
2012-10-29 13:38:33 -04:00
Nikerabbit
a9e9c0e3ff Merge "Stash global only once per test case." 2012-10-29 12:15:37 +00:00
Siebrand
f83f36ef61 Merge "tests: rm duplicate code in language classes" 2012-10-29 10:18:10 +00:00
daniel
7385890cfe Stash global only once per test case.
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
2012-10-29 11:07:06 +01:00
Antoine Musso
a03bf9e27f tests: rm duplicate code in language classes
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
2012-10-29 09:40:30 +01:00
Daniel Friesen
d9a422f0d1 Preemptively add image-set to our sanitizer.
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
2012-10-29 08:32:53 +00:00
umherirrender
e5f5e95137 Fix indentation whitespace errors
Change-Id: Ie268bee2098c589c050e1b5b0e93fe1b3feca86f
2012-10-26 17:42:13 +02:00
Antoine Musso
93dcfa9f05 raise timeout for UserTest::testEditCount
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
2012-10-26 15:40:29 +02:00
Tychay
8b08a7db91 Merge "Revert "Function for "pretty timestamps" that are human readable and understandable."" 2012-10-25 22:36:32 +00:00
Timo Tijhof
a4aef7d495 Fix warnings and enforce conventions in ContentHandler tests.
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
2012-10-25 22:37:32 +02:00
Gabriel Wicke
31625b54a0 Bug 11748: Handle optionally-closed HTML tags
* 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
2012-10-25 19:31:29 +02:00
Siebrand
74f037bcd0 Revert "Function for "pretty timestamps" that are human readable and understandable."
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
2012-10-25 10:22:16 +00:00
Reedy
881c1d30e4 Merge "Function for "pretty timestamps" that are human readable and understandable." 2012-10-25 00:58:19 +00:00
Aaron Schulz
deff65ec83 Merge "fix fatal error in HttpTest" 2012-10-24 21:57:02 +00:00
umherirrender
dcb6ad0097 Use ParserOptions::newFromUserAndLang in tests
This avoids using $wgUser and $wgLang for the ParserOption, which is not
needed in the tests

Change-Id: Iea07e9a0f0898ec5f8eb98a40000f5d33b279c9e
2012-10-24 15:59:30 +02:00
Aaron Schulz
2865d4c9cc Merge "tests: always call parent setUp" 2012-10-23 17:59:32 +00:00
Antoine Musso
c6ea55bf54 tests: always call parent setUp
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
2012-10-23 19:04:40 +02:00
Subramanya Sastry
dd458883e3 Additional parser tests to spec parser behavior and test Parsoid.
Change-Id: Ife9750c5904cac1557b631f34a4ca8542f389226
2012-10-23 11:18:19 -05:00
GWicke
0b9f6f97c8 Merge "Add additional specs + Parsoid-centric tests to keep Parsoid in line." 2012-10-22 20:46:52 +00:00
Alexandre Emsenhuber
2b0edc83e9 Setting $wgContLang without changing $wgLanguageCode accordingly is a very bad idea.
This caused about 200 exceptions "MWException: Error in MediaWikiLangTestCase::setUp(): $wgLanguageCode ('fr') is different from $wgContLang->getCode() (en)" on my installation.

Change-Id: I2987db68e22b27d8d36cdae118356fd7612e56a4
2012-10-20 18:15:18 +02:00
IAlex
86a180097b Merge "Unit test for User::getEditCount" 2012-10-20 16:04:51 +00:00
Subramanya Sastry
96f846deae Add additional specs + Parsoid-centric tests to keep Parsoid in line.
Change-Id: I9a6970b13d6f76d1f740655b3ff5061b6edad32f
2012-10-19 17:48:48 -05:00
Tim Landscheidt
f199ee31d4 Protect against Xdebug overloading var_dump().
This fixes bug #36452.

Change-Id: I0fc65af8c561b23daa5301a00706acb5b3f619dc
2012-10-19 13:08:35 +00:00
IAlex
5f05452a49 Merge "Avoid using $wgUser in TitlePermissionTest" 2012-10-19 05:55:30 +00:00
Demon
6d11551ea1 Merge "(Bug 41169) Apply rtrim on on preSaveTransfrom." 2012-10-18 18:45:36 +00:00
daniel
f4a1242db8 (Bug 41169) Apply rtrim on on preSaveTransfrom.
Wikitext should not have trailing whitespace.

Change-Id: I75eb1c4bef7217ec2b7440594e3fc4b68dc3c022
2012-10-18 19:40:29 +01:00
Demon
bea9e1668e Merge "[FileBackend] Added more tests and fixed some local copy/reference bugs." 2012-10-18 18:37:24 +00:00
Demon
2b6874e673 Merge "[Bug 41155] Record links on CSS/JS pages in the DB." 2012-10-18 18:31:10 +00:00
daniel
8b568be5e2 [Bug 41155] Record links on CSS/JS pages in the DB.
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
2012-10-18 20:21:04 +02:00
Marius Hoch
e65eb02d3e Unit test for User::getEditCount
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
2012-10-18 16:48:35 +02:00
daniel
3d6e9faab5 (bBug 41127) Handle non-existent content in WikiPage
Change-Id: I8b80a6b7b49b0b8b43eb7d4913860d8ca899015e
2012-10-18 15:13:01 +01:00
Siebrand
5abe15bb9d Merge "SI standards for time units" 2012-10-17 23:09:49 +00:00
Aaron Schulz
8a423dc44e [FileBackend] Added more tests and fixed some local copy/reference bugs.
Change-Id: I21f635174310a1ce406483b546ae98dec218e5ba
2012-10-17 13:15:41 -07:00
Henning Snater
c934766061 sort method for jquery.tablesorter
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
2012-10-17 21:13:50 +02:00
Aaron Schulz
4854e7d2bf Merge "Fix RevisionStorageTest with non-wikitext NS_MAIN" 2012-10-17 00:53:42 +00:00
Aaron Schulz
31a52f9e3d Merge "Fixing dump tests for non-wikitext in NS_MAIN." 2012-10-16 00:44:01 +00:00
Subramanya Sastry
375bfe62ef Added ugly nesting and template interaction tests (to stress Parsoid).
Change-Id: I244f682b458626e827888aa7eed0fb6ad26a9d97
2012-10-15 12:01:54 -05:00
Demon
996e570652 Merge "(bug 40930) Fix regression: ContentHandler prevents action=edit append to blank page" 2012-10-15 15:02:27 +00:00