Commit graph

21 commits

Author SHA1 Message Date
Amir E. Aharoni
c50cbe48ab Fix remaining Generic.Files.LineLength failures
Except the ones for which there is no clear way to fix
because of T114213.

Bug: T102614
Change-Id: I94a1fc7c890c82a36f0b51e42d311585c275775c
2015-10-03 17:23:07 +00:00
Amir E. Aharoni
bfdd3369c2 Fix Generic.Files.LineLength phpcs check in files under phpunit/includes
Bug: T102614
Change-Id: Iee3df5f064f595ecebe8210cc936bc3d20a122c9
2015-10-03 17:13:29 +00:00
Vivek Ghaisas
c54766586a Fix issues identified by SpaceBeforeSingleLineComment sniff
Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
2015-09-26 23:06:52 +00:00
Amir E. Aharoni
76ae9acec3 Make line shorter to pass phpcs in LinkerTest.php
There are other linkes here ythat will require a different treatment.

Bug: T102614
Change-Id: Ia0c75d11a85a931d37941471f9c9bdc16fda28e1
2015-09-26 18:20:11 +00:00
daniel
ef1f4af079 Allow Linker::formatComment to link to another wiki per default.
This also adds tests against injection to LinkerTest.

Bug: T111676
Change-Id: I757f2b91f3b50d789d04e530049c34b4628253e3
2015-09-15 18:10:33 +02:00
Marius Hoch
dd740a65dc Don't double escape in Linker::formatLinksInComment
Affected both the linked text and the actual URL.

For an example please see the ukwiki link on:
https://www.mediawiki.org/wiki/Special:CentralAuth/Admin

Follow-Up: Ibdedf087f85046646450367cbf1811db578d8f4b
Change-Id: Ie73796dcde4e0a096a6baa86a53245e6fe2b48b5
2015-01-15 18:14:42 +00:00
Marius Hoch
d14f6c0de3 Make Linker::formatLinksInComment format links to other wikis
Needed for CentralAuth.

Change-Id: Ibdedf087f85046646450367cbf1811db578d8f4b
2015-01-09 11:22:31 -08:00
Brad Jorsch
29951907f7 Format multiple autocomments in edit summaries
Before r39373, all autocomments in an edit summary were formatted. In
fixing a bug with page titles containing "/*" this was accidentally
broken.

To use a single preg_replace_callback call to replace multiple
autocomments, we need to make sure that the match of one autocomment
doesn't overlap the match of another, which means we can't have "(.*)"
before and after. But we do still need to detect whether there is
anything before or after. "(?=(.?))" and "(?<=(.?))" would do nicely,
except the latter isn't actually supported. "(?=(.))?" and "(?<=(.))?"
work too, but older versions of PCRE don't support that. They do,
however, support "(?:(?=(.)))?" and "(?:(?<=(.)))?", so that's what
we'll go with.

This change does change the values for $pre and $post passed to the
FormatAutocomments hook; extensions need to be updated to accept (and
not prepend/append) booleans for these parameters.

Bug: T18530
Bug: T70361
Change-Id: I36c3a9e548a4ef72f93974bb35f9add8c29e9287
2014-12-31 10:24:05 +11:00
Jeff Janes
7e3fcc39ea PHPUnit: Add Database tags
Several unit tests access the database, but did not declare
themselves in the Database @group.  This causes
"make databaseless" to fail needlessly.  Add the
missing tags.

tests/phpunit/includes/LinkerTest.php
tests/phpunit/includes/actions/ActionTest.php
tests/phpunit/includes/specials/ImageListPagerTest.php
tests/phpunit/includes/specials/SpecialMIMESearchTest.php
tests/phpunit/includes/title/MediaWikiPageLinkRendererTest.php

Other than ActionTest.php, these also are problematic in 1.23

Change-Id: I7c1c957e2194c13e48b7ba68d7529e5d89901875
2014-09-16 18:42:27 -07:00
Chad Horohoe
f129b1baf9 Limit test leakage, $wgCapitalLinks expected to be true
Change-Id: I0f837d29595abefaebeb67d6cc62ea48838d626a
2014-07-07 16:54:35 -07:00
aude
dfbc4d7f32 Set wgScript in LinkerTest
otherwise tests fail if you don't have this setting.

Change-Id: I598b83c348dc54908225ee398787bf300d473656
2014-06-24 09:39:17 +02:00
Bartosz Dziewoński
63ce38567c LinkerTest: A bunch of tests for Linker::formatComment and friends
Change-Id: Ie805d2945ddc1596545ef3f22d32b429caca8a27
2014-06-10 22:26:07 +02:00
Siebrand Mazeland
ce42915e0d Pass phpcs-strict on some test files (2/x)
Change-Id: Ia39fd107a554206927652b6e168faa0da501b362
2014-04-24 17:05:34 +02:00
Kunal Mehta
f2de3967d9 Add 'mw-anonuserlink' class for anonymous users
Bug: 43179
Change-Id: I57780e1045044e8532dc6defc4cca2e27434c055
2014-02-23 16:24:34 -08:00
addshore
de7af7ac2c Fix scope on all /phpunit test methods
Change-Id: I3ce92463d485a0fb23e464e9a8059330f32d79af
2013-10-24 10:31:32 +02:00
Timo Tijhof
b36d883017 Tests: Make phpunit providers "public static".
Follows-up I9d2b148e57 (including phpunit/languages this time).

Bug: 46434
Change-Id: I30e5efcd88c516121c454676bd7a18f9b7c8fca6
2013-03-22 03:12:37 +01:00
Yuri Astrakhan
27d83878c0 Lots of spelling mistakes and phpdoc attributes
@throw->@throws
@returns->@return
@seealso->@see
@cover->@covers
etc

Change-Id: I9ae6bc3034e9790e2d66cd96473b923fe9ee7953
2013-03-10 23:16:28 -04:00
Siebrand Mazeland
ac63001d8e Update formatting
1 of n.

Change-Id: I852729f08bbb0c5e39c2db44362ccdc7f59dcc08
2013-02-14 12:22:13 +01:00
umherirrender
515253bc4c Set wgWellFormedXml for LinkerTest::testUserLink
Change-Id: I9ab370e2f23e0134741680ff620e8bb552496868
2012-12-09 11:56:45 +01:00
Platonides
a8440314f2 LinkerTest needs to set the wiki language to en.
The localisation of Special:Contributions break the
testUserLink otherwise.

Change-Id: I25a40356a96e03975d8ceca975449f7b064bca2b
2012-12-06 18:53:43 +01:00
csteipp
ebc73c7df7 (bug 36780) Improve display of IPv6 addresses
Also add partial tests for Linker::userLink()

Change-Id: I680a59bb0ec3ca1d85ed12b0debb3446c73a3aab
2012-11-26 23:00:33 +00:00