Commit graph

1026 commits

Author SHA1 Message Date
Anomie
f950401ed2 Merge "Regression test for detecting edit conflicts." 2012-11-16 16:56:34 +00:00
Hashar
3186f5afdf Merge "Let TextContentTest extends MediaWikiLangTestCase" 2012-11-16 15:07:25 +00:00
Hashar
c2953e21eb Merge "SearchEngineTest.php must extends MediaWikiLangTestCase" 2012-11-16 13:23:03 +00:00
Demon
4daa24f4f1 Merge "drop orm_test table on teardown" 2012-11-16 05:21:15 +00:00
daniel
1aed5382d2 Regression test for detecting edit conflicts.
Change-Id: I9f8f3850ff0d6d51f173f5be73ffcb3b64886235
2012-11-15 20:23:37 +01:00
daniel
cef8005d3a When returning rev content, always include model.
query=revisions can be used with rvprop=content to retrieve the
content of revisions. The contentmodel should always be included
with the content (just like the contenformat is), so the client
is able to interpret the structure contained in the content blob.

Change-Id: I67cf48f905ff83a86992e1a54f7ad0feaf2b2c94
2012-11-14 14:53:34 +01:00
Anomie
a62274a157 Merge "Set default type attribute for button html elements" 2012-11-13 23:08:16 +00:00
umherirrender
dfbc789715 SearchEngineTest.php must extends MediaWikiLangTestCase
There is namespace handling, which fails on $wgLanguageCode = 'de';

Change-Id: I6caa403e5e5ba55c0666d989762aaebe8ced878f
2012-11-11 09:21:56 +00:00
umherirrender
2316a649d4 Let TextContentTest extends MediaWikiLangTestCase
There is signature expansion, which fails on $wgLanguageCode = 'de';

Change-Id: I827693a9f872219b983c62f4d3483e67ed9e8a2f
2012-11-11 09:18:04 +00:00
umherirrender
ce966298ca fix @depends
No need for the parentheses there

Change-Id: Id2ba72a7fb7bdd592de0642468994c9dab29adcd
2012-11-10 20:15:03 +01:00
umherirrender
93dd5435f0 drop orm_test table on teardown
No need to keep this table after the test

Change-Id: Id6814ceca063294da0761caa9a0d9975118dd4f1
2012-11-10 19:05:04 +00:00
Daniel Kinzler
2c85e0dd5b avoid STDERR diff3 messages when using wfMerge()
diff3 issues a warning to stderr if any of the files does not end with a
newline character.

TextContent::preSaveTransform() does normalize revision text by simply
calling trim().  Thus to avoid a diff3 error we simply apply the same
normalization and add a newline to please the command.

Change-Id: I7baa3df95dd70cbc865b2491ccc791e60f8b9e6e
2012-11-10 17:26:08 +00:00
Hashar
6670bf66df Merge "(Bug 41352) Provide tests for edit conflicts." 2012-11-10 16:44:44 +00:00
daniel
3dcf8c5284 (Bug 41352) Provide tests for edit conflicts.
This provides several test cases for EditPage, including some for
detecting and resolving edit conflicts. This is in preparation for
finding and eliminating the root cause of bug 41352.

Change-Id: I8f23c6535f7b3ee6462d9c5a19dd06070e77f9d1
2012-11-10 17:24:48 +01:00
daniel
2b440f71ea (Bug 41244) Gracefully handle failure to load text blob.
This change fixes fatal errors ocurring when Revision::loadText
returns false because of a failure to load the text blob.
Revision::getContent() should simply return null in such a case.

Change-Id: I1e13de14ff15b124b5a2e07155d368595a16fda7
2012-11-10 15:58:17 +01:00
IAlex
a78b35a36d Merge "It should not be possible for a RequestContext's WikiPage and Title to be different." 2012-11-09 21:38:09 +00:00
Nikerabbit
0233168ce7 Merge "Define $wgAlwaysUseTidy to false where needed in unit tests" 2012-11-09 17:55:23 +00:00
Hashar
e6a00603c8 Merge "fix testEditCount to work with non-wikitext content in main NS" 2012-11-09 13:14:27 +00:00
aude
16e2c77715 move ORMTableTest from Wikibase to core
- this is more generally useful than to be buried inside Wikibase client.
- it was in Wikibase/client/tests/phpunit/includes/store/EntityCacheTableTest.php

- patchset 2: add to test autoloader

Change-Id: I5bc41d6d205f28bcc5bf0c8a78b782c8888c18eb
2012-11-09 09:57:45 +00:00
Aaron Schulz
9f95bddda7 [FileBackend] Added getFileHttpUrl() function.
* This can speed up certain video file operations for scripts that support
  specifying source files via URLs and support HTTP Range headers.
* Updated unit tests.

Change-Id: I60cb95c2e3dd9f7df1f740e9182be7c79af69d6e
2012-11-08 23:01:19 +00:00
aude
c5ca90e715 fix testEditCount to work with non-wikitext content in main NS
consistent with WikiPageTest and other places, perform the test
with the Help namespace as a workaround for now.

Change-Id: I2b766c17f35e0e79662b6302c122225a1a33e7be
2012-11-08 18:06:32 +01:00
Aaron Schulz
bcda3de17c Merge "Fix test for view language for non-wikitext in main NS." 2012-11-08 01:28:30 +00:00
Alexandre Emsenhuber
d1be0a802e Define $wgAlwaysUseTidy to false where needed in unit tests
Tidy changes some whitespaces in the HTML which breaks the tests if enabled.

Change-Id: Ib44f60c0d4b595c76c258b41962c3c45ca21ac3e
2012-11-07 23:08:56 +01:00
Aaron Schulz
a8644b99bb Merge "Content::convert() for conv. betw. content models." 2012-11-07 20:39:09 +00:00
Aaron Schulz
ec239d8243 Merge "ORMRow must not ignore failures on insert by deault." 2012-11-06 20:57:57 +00:00
daniel
ea4473037d Content::convert() for conv. betw. content models.
This is needed to fix bug 41706 and similar, watch for follow-ups.

Automatic, implicit conversion may be handy in several cases, especially
for converting between different text based content models. E.g. it should
be possible to create a diff between a JavaScript and a wikitext page. This
change lais the foundations for this ability.

Change-Id: Ie7d87b67b24ac9897cb5696220a7785b228d3c79
2012-11-06 17:39:10 +01:00
Daniel Kinzler
896275e75b Merge "Some cleanup of doApiRequest in test module" 2012-11-05 15:13:18 +00:00
Aaron Schulz
963c4a265f Moved FileBackend tests to /filebackend.
Change-Id: Ieb789ac1c9803f74bad3a4fef3a57587d6dd6260
2012-11-02 12:12:36 -07:00
Antoine Musso
d7cec7c36c raise timeout for WikiPage tests
The tests do lot of DB queries which are quiet slow when using a SQLite
backend. Marking the class as belonging to the 'medium' group should
raise the timeout to 10 seconds.

Change-Id: I7a779bf4e5f44e755055182e0feeb68c005a920c
2012-11-02 15:22:54 +01:00
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
jeroendedauw
cab98d9fdd Some cleanup of doApiRequest in test module
Change-Id: Ia5bdf04c5b43c551f383af9fd078528e14d07efc
2012-11-01 18:36:10 +01:00
Demon
dc0e410e29 Merge "(Bug 41574) Supply Title object to Revision if possible." 2012-11-01 16:48:48 +00: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
daniel
980da6d6a7 ORMRow must not ignore failures on insert by deault.
ORMRow shouldn't apply the "IGNORE" modifier for insertions by default.
IGNORE means pretending the insert was successfull even if it wasn't.
That's not a good default, and for some databases (like sqlite), may
actually hide errors beyond key conflicts.

Change-Id: I8b00cd03a459419441195ed25091385371b027a5
2012-10-31 20:15:02 +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
Stephan Gambke
514bdd184d Set default type attribute for button html elements
According to standard the default type for <button> elements is "submit". Depending on compatibility mode IE might use "button", instead.
To work around the IE bug this patch forces the standard "submit", if nothing is specified explicitly.

See remarks on http://msdn.microsoft.com/en-us/library/ie/ms535211%28v=vs.85%29.aspx :
-----
The default value of the type attribute depends on the current document compatibility mode. The default value is submit. In other compatibility modes the default value is button.
...
Windows Internet Explorer 8 and later. The default value of the type attribute depends on the current document compatibility mode. In IE8 Standards mode, the default value is submit.
In other compatibility modes and earlier versions of Windows Internet Explorer, the default value is button.
-----

Change-Id: I3b97a8cac74bbfca63699dfcbf1cc5e9a2cef193
2012-10-30 21:45: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
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
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
Aaron Schulz
deff65ec83 Merge "fix fatal error in HttpTest" 2012-10-24 21:57:02 +00:00
Daniel Friesen
0b6b78d13a It should not be possible for a RequestContext's WikiPage and Title to be different.
Looks like someone messed with RequestContext when I wasn't looking at it.
WikiPage is a representation of the Title. It should not be possible for wikipage
to point to a different title than the context's title.

Fix this issue by unsetting WikiPage when setting title and updating title when
setting wikipage.

Change-Id: I40471b12d08763cb1b47b8382f96d8db94b4f319
2012-10-24 08:17:27 -07: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