Commit graph

842 commits

Author SHA1 Message Date
Tim Landscheidt
a0eec30909 Remove obsolete comment.
There is no class SearchDbTest.

Change-Id: I6054de571e867b07453785f5598ba410449b57e2
2012-10-06 18:45:12 +00:00
Aaron Schulz
812487e902 [FileBackend] Tweaked FileBackendMultiWrite behavior to fix test leakage.
Change-Id: I0a967780b64d1883cfeb1a7a183bbb82dc1ae432
2012-10-05 15:07:30 -07:00
jeroendedauw
430b31415f Replace remaining Array occurences with array
Change-Id: Id7c2fdd6814a8239acbe050d857b56350e691a49
2012-10-05 16:11:54 +02:00
umherirrender
a2e470ee68 (bug 32951) Do not register absolute internal externals
Setting $wgRegisterInternalExternals = false for proto server should not
store the http/https links in externallinks table

Also fix detection of own links for links with query or anchor or
nothing

new also detected:
//localhost
//localhost?query
//localhost#anchor

already detected:
//localhost/path

Change-Id: Idd03d309cc3b71728a8cbea460efa12b10348d64
2012-10-03 23:15:38 +00:00
Brion VIBBER
4c01cfb10c Merge "[FileBackend] Optimized concatenate() to use getLocalReferenceMulti()." 2012-10-03 20:03:35 +00:00
Brion VIBBER
a570a73510 Merge "[FileBackend] Added getFileContentsMulti() and improved it for Swift." 2012-10-03 20:01:46 +00:00
Brion VIBBER
ba652c59fa Merge "[FileBackend] Added getLocalCopyMulti() and getLocalReferenceMulti()." 2012-10-03 19:54:34 +00:00
Niklas Laxström
d8f5490ec0 Sane whitespace
Change-Id: I849e9e672e50f033a24b5b42db93659d6e5fe899
2012-10-02 08:39:30 +00:00
Daniel Friesen
55a52d5915 more public accessors for Title class
This patch adds new public accessor to the Title class. They are merely
returning the already existing conventions.

Added tests for the four new methods:
 - Title::getBaseText()
 - Title::getRootText()
 - Title::getRootTitle()
 - Title::getSubpageText()

The later does not test with $wgNamespacesWithSubpages variants.

Change-Id: I4f7230c1a5487b82d06c78a45c50436085df57be
2012-10-01 20:52:03 +02:00
Reedy
8204ec598f Wrap long lines
Also remove default setting of $p done in else statement at end

Change-Id: I5024c1fc1748ad1add145d0696b33a6d7ef3223b
2012-09-29 00:35:16 +01:00
Chad Horohoe
99556232ae Remove completely broken test
Change-Id: I6a9897a533b0d57dab9b65d6100e267a73c710ed
2012-09-26 17:04:36 +00:00
Daniel Friesen
3842f9a262 Preemptively add css3's image() to our css sanitizer.
- Adding this now even though no browser supports it so that when one does it doesn't become a way to bypass our url() filter.
- Including missing tests for all of our insecure input filters.
- Also make sure that vendor prefixed versions like -webkit-image() are caught because most browsers are probably going to go and implement a vendor prefixed version first.

Change-Id: If73aa98b8accdb7621b0e4ff0615b61d530fa547
2012-09-26 05:24:16 +00:00
Nikerabbit
f5536e680b Merge "Change case to use the canonical names." 2012-09-25 23:33:49 +00:00
Tim Starling
343cbf7463 Add an API log
During incident response, it was not possible to tell what API modules
were being requested and by whom, since the action parameter is often
posted. This change logs the API parameters whether they are posted or
sent in the query string.

I did try to get the API parameters from the module, but that turns out
to be difficult. Modules create submodules (generators, page sets) as
local variables, which are created in a procedural style and destroyed
before logging is done, so there is no easy way to query them for
parameter lists after execution completes.

In ApiOptionsTest, use a real ApiMain object like all the other API test
cases, rather than a mock object. Otherwise the test fails.

Change-Id: Idc786007fe61811d1874f29b5ce4762dd97b1847
2012-09-24 21:22:09 +00:00
daniel
a1fb3de7d2 Clear token cache when resetting session.
ApiTestCase resets global session data in setup, invalidating any existing cookies.
ApiQueryInfo caches all tokens, these need to be cleared out so tokens are re-generated
to match the fresh session.

Until now, individual tests have been doing that, but there's no not to do this per
default.

Change-Id: Icefa362190c2e7d87d09bda30079255741824f55
2012-09-24 15:07:36 +02:00
Alexandre Emsenhuber
3beaa0a027 Follow-up Ifd700826 (60d119c), address a fixme in a re-enabled test.
Make the "Date menu next month is 11 months ago" also work when the
current month is december.

Change-Id: Ie7b998bf962abbb3e2f789a3d8a9af8c52e7feaa
2012-09-23 10:15:20 +02:00
IAlex
aed6ce419a Merge "Fix broken tests for Xml." 2012-09-23 08:09:16 +00:00
Aaron Schulz
dcb81eef85 [FileBackend] Optimized concatenate() to use getLocalReferenceMulti().
Change-Id: I884eb3fc27adb48ec6761143190cc622f1de2dca
2012-09-22 11:46:48 -07:00
Tim Landscheidt
4de96da5af Reenable testStoredFunctions() in DatabaseTest.php.
Change-Id: I85192a326f8e83d433f69b296431cae57628e78f
2012-09-22 18:14:22 +00:00
Aaron Schulz
8641c9af9d [FileBackend] Added getFileContentsMulti() and improved it for Swift.
Change-Id: I6a2173eccda8fe7d4e2e779421e6edf05c8201b4
2012-09-22 11:01:58 -07:00
Aaron
ae65453e84 [FileBackend] Added getLocalCopyMulti() and getLocalReferenceMulti().
* Optimized these in Swift to use pipelined GETs.
* This can also be used to improve concatenate().

Change-Id: Ibeb5df7532f9f5c16736b20c28b7c0d9ddfb412f
2012-09-21 21:10:54 -07:00
Tim Landscheidt
60d119c6e2 Fix broken tests for Xml.
Change-Id: Ifd7008269cc960004676ba79449911d63476615c
2012-09-22 02:17:33 +00:00
Siebrand
6518ffba8d Merge "Updated plural rules from CLDR 22" 2012-09-19 07:01:52 +00:00
Platonides
b8f1c3c69c Change case to use the canonical names.
Change-Id: Ib2640e608ac4d33871446b15fca3780eb7715f1d
2012-09-18 22:30:38 +02:00
Antoine Musso
218d50c0c3 (bug 40306) Only convert align to float for table.
Align should be converted to text-align for all the elements specified
in $presentationalAttribs mapping. Table however is an exception, it
applies to alignment of the block (instead of the content).

Follow up I108cbd10 / 27a4d74bd7.

Change-Id: Iee17d4ef1a6a9b46d88a330cfc9179bccfe93247
2012-09-18 14:44:50 +02:00
Niklas Laxström
a87bfdd2f1 Updated plural rules from CLDR 22
Change-Id: I0325635a8e0fa3d5defbcbc3a0f4746ed4ab14c1
2012-09-17 16:59:29 +00:00
Antoine Musso
1a7da4f625 test: full coverage of Html::dropDefaults()
This closely match Html::dropDefaults() logic and hopefully test out
all default dropping.

Introduce a test case that match a failure in f34547ab where attribute
default values passed in an array are not cleaned up.

Change-Id: If8d16b066015ed1bcaf38408511ac3713eaa6540
2012-09-14 21:26:56 -07:00
Daniel Friesen
81f1cace4c Fix broken value="" stripping for HTML5
The default value for value="" on <input> elements is not always an
empty string.

In particular the default value for type="radio" is "on" and by
stripping value="" out of the attributes a "" becomes "on" and our
cleanup code ends up breaking forms.

Change-Id: Ibe5a3be3f45a2f93ef95dbe42729b8f8c94a41cb
2012-09-14 21:26:56 -07:00
Antoine Musso
a45e20ff11 HTML5 new types for input element
HTML5 introduced new types for the input element. For some reasons we
never added them to Html::openElement which would thus strip them even
in HTML5 mode.

The issue is:
 $wgHtml5 = true;
 Html::element( 'input', array( 'type' => 'color' );
 # -> "<input />"

With this patch, we returns: <input type="color" />

Change-Id: I7de373635d0eb47f788d1d664c3a913c8801efd6
2012-09-14 21:26:55 -07:00
umherirrender
99159fd750 wfTimestamp should not die on bogus input [Regression]
Followup I68eb9f27

No caller of wfTimestamp can handle the exception, false is always used,
as the method comment says.

See bug 40037 for File related timestamps.
The api result is also not b/c:
<api servedby="mw70">
  <error code="internal_api_error_TimestampException" info="Exception
Caught: MWTimestamp::setTimestamp : Invalid timestamp - te"
xml:space="preserve" />
</api>

Change-Id: I1e8c785941d35678f3d12824bdde0ce245572592
2012-09-14 18:28:22 +02:00
Siebrand Mazeland
59ec5a325c Move api/ApiTestUser.php to TestUser.php and make available in MediaWikiTestCase class.
* Renamed class ApiTestUser to TestUser.

Change-Id: I1c3c659c3ba5c54a314d879132f760008983372d
2012-09-13 18:40:23 +00:00
Demon
2c6646c7f6 Merge "Make userWasLastToEdit reusable." 2012-09-12 20:02:54 +00:00
Liangent
c0fe9b4743 Followup da433140: add one more test and release note
Change-Id: I03f3fa9cb58b6e98a88a2828f19bae849acf5455
2012-09-04 23:14:20 +08:00
Hashar
89a055491c Merge "'lang' attrib in #mw-content-text should be set to variant code." 2012-09-04 15:04:52 +00:00
Liangent
da43314022 'lang' attrib in #mw-content-text should be set to variant code.
Change-Id: I15cd8c102991c5007b43e06939a0c1a7593d0933
2012-09-04 17:00:27 +02:00
daniel
c4ff922e64 Make userWasLastToEdit reusable.
Make userWasLastToEdit a static method in the Revision class, so it can be
reused by extensions, etc.

Change-Id: Ib44423c3544dabab3be7fe6eb675315f2480838e
2012-09-03 12:22:52 +02:00
Aaron Schulz
5adfb9a184 Merge "Allow array condition for HAVING in database interface" 2012-09-01 00:03:47 +00:00
umherirrender
59e0647457 Allow array condition for HAVING in database interface
Current no use in core.

Change-Id: I8ed86c8238146285dd1caed4d8586c877cbecf44
2012-08-31 20:12:19 +02:00
Liangent
70e8fe8891 test: unwanted search namespace should not be there
When Special:Search uses User preferences for search, make sure that no
unwanted namespaces have been used.

Change-Id: Ibcb23c812bf1e02a398ffbf3a276afc1b1f367cf
2012-08-31 17:56:11 +02:00
Tyler Anthony Romeo
e738203a8e Added PHP complement for mw.Time.
Figured since a JS Timestamp class was being implemented
it might be appropriate to create a complementary PHP
Timestamp class. Much of code is taken from wfTimestamp().

Note: Another change (I53dcf547) is attempting a related
issue. Not sure how much of scope overlap there is.

Change-Id: I68eb9f27eebe80df757187f634392e1bcba5551f
Signed-off-by: Tyler Romeo <tylerromeo@gmail.com>
2012-08-30 20:44:09 -04:00
Aaron Schulz
48c14af1e9 Merge "clear magicword cache before testing cleanSig" 2012-08-30 17:16:33 +00:00
Daniel Kinzler
9e8ee1d1f5 Merge "Added default implmentation of instanceProvider to GenericArrayObjectTest" 2012-08-30 10:37:41 +00:00
Antoine Musso
9fd8cf88f0 tests: Wraper to set/disable $wgHTML5 in HtmlTest
Would let us easily set $wgHtml5 in our tests.

Change-Id: Iacf38c2961cbbb9cc58cd45bba34f10ee5688605
2012-08-30 12:20:31 +02:00
jeroendedauw
4a2e4e569a Added default implmentation of instanceProvider to GenericArrayObjectTest
Change-Id: I8d77c03b90ddca226c4bff18e42c53980bf9a861
2012-08-29 19:52:13 +02:00
Siebrand
dafdb6ed47 Merge "Fixed fallback behaviour for plural rules" 2012-08-29 16:16:57 +00:00
Antoine Musso
a8ca2e0e3b raise filerepo tests timeout to 10sec
'@group medium' instructs PHPUnit to wait up to 10 seconds for the test
to complete. That would save us from false positive caused by high disk
I/O on the continuous integration server.

Change-Id: Id11c3ed1879705f806d262dc8090ef2fb432ed36
2012-08-29 17:01:02 +02:00
daniel
a1e971cd0e clear magicword cache before testing cleanSig
Without this, some other synonym for "SUBST" may be used by the parser,
because the MagicWord got cached while another content language was active
in some other test.

Change-Id: I89dc2173f6a27dcd16b0548b06070ac4244fd3cb
2012-08-29 12:31:24 +02:00
Tim Starling
d76e670c76 Fixed fallback behaviour for plural rules
Fallbacks didn't work at all for the new plural rule system. I fixed it
by moving the getPluralRules() and getCompiledPluralRules() calls near
to the readPHPFile() calls, before merging is done. Then I factored out
the resulting code to readSourceFilesAndRegisterDeps().

* Removed pluralRules from mergeableMapKeys, it isn't one
* Added compiledPluralRules to allKeys so that it will be merged
* When a language is not present in the CLDR XML files, return null from
  getPluralRules() and getCompiledPluralRules() so that the fallback
  rules won't be overridden with an empty array. Normalised it back to
  an empty array in the unlikely event that there is no plural data in
  the fallback sequence at all, even in English.
* Fixed private function, "protected" is the way to say private here.

Change-Id: I3a008ef7f6ed7aaa15ad25ad796f7a2b8f827fa2
2012-08-29 07:57:45 +00:00
Catrope
84a54a63c5 Merge "[FileBackend] Added preloadCache() so callers can trigger cache getMulti()." 2012-08-29 00:13:57 +00:00
Aaron Schulz
68808d7b9f [FileBackend] Added preloadCache() so callers can trigger cache getMulti().
Change-Id: I2a30b4bfc16b4303abcb1f71206234dd2e0403af
2012-08-28 17:10:20 -07:00