Commit graph

25 commits

Author SHA1 Message Date
Kunal Mehta
e0193327bd Fix MediaWiki.Commenting.LicenseComment.InvalidLicenseTag errors
Change-Id: I936c3f5fca1a0061f215e80469f5d882cb32ee29
2018-05-23 16:23:42 -07:00
Florian Schmidt
32be7421b1 WatchAction::onSubmit return correct value, not always true
The onSubmit method documentation states, that the caller can expect either
true for a successfull run, false if not tried and an array of error messages
in case of an failure. WatchAction however always returned false, even though
a Status object is availble with all needed information.

The behaviour of WatchAction::onSubmit is now changed to return the appropriate
value taken from the returned Status object of WatchAction::doSelf.

Also:
 * Added WatchAction test class to higher test coverage, especially for the
   static methods
 * Marked getUnwatchToken as deprecated, it's not used and a caller can easily
   switch to getWatchToken with "unwatch" as the action parameter

Change-Id: I2c1b91e1884a0d5f27f5e7ab9eafd6173642c21c
2018-05-23 20:36:37 +02:00
Umherirrender
69dbaf3f88 build: Updating mediawiki/mediawiki-codesniffer to 17.0.0
Change-Id: Ib494b47c54fe6354d166055b1e1b31d3583bb992
2018-03-29 21:53:10 +02:00
Umherirrender
45da581551 Use ::class to resolve class names in tests
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: Ie541a7baae10ab6f5c13f95ac2ff6598b8f8950c
2018-01-26 22:49:13 +01:00
Thiemo Mättig
1f2ff32cca Family name of Thiemo changed
Change-Id: I5477d02111e53790e858624c4b7c4f09dbc418fa
2017-11-14 13:59:15 +01:00
Krinkle
caf87b4893 Revert "Make an empty "?action=" parameter default to "view""
This reverts commit b287ec2cc6.

Change-Id: I59e996dfe627e8a978ed849a8e82ad4e0b165d7f
2016-05-18 18:54:50 +00:00
Thiemo Mättig
b287ec2cc6 Make an empty "?action=" parameter default to "view"
When no action is given, e.g. in
https://en.wikipedia.org/wiki/URL
the action defaults to "view". Just like you called
https://en.wikipedia.org/wiki/URL?action=view

But when the action is empty, e.g.
https://en.wikipedia.org/wiki/URL?action=
you get an error message telling you that "the action specified"
can not be "recognized". Wait, I did not "specified" an action.
That's why I left the parameter empty. From the users point of
view I expect the empty string to behave like null/undefined.

This is a resubmit of I331924d without the problematic bits.

Change-Id: I07847600bb24ae078276acf98e6eb244039414d7
2016-05-17 18:36:39 +02:00
Timo Tijhof
46b04ec7ae Use static::class instead of get_called_class()
Available as of PHP 5.5 and more idomatic. Foo::class (explicit),
self::class (defined), and static::class (late bound).

Change-Id: I66937f32095a4e4ecde94ca20a935a3c3efc9cee
2016-02-29 22:43:58 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
umherirrender
271da88127 Some bugzilla.wikimedia.org -> phabricator.wikimedia.org changes
Changed some old bugzilla links to new phabricator links in comments,
test data and error message. This reduces the need for redirects from
old bugzilla to new phabricator from our source code.

Change-Id: Id98278e26ce31656295a23f3cadb536859c4caa5
2015-09-24 17:17:25 +02:00
This, that and the other
5c4681012e UI for adding and removing change tags on revisions and log entries
There is a new special page, Special:EditTags, which is very similar to
Special:RevisionDelete in a lot of ways. In fact, the SpecialEditTags class
started off as a copy-paste of SpecialRevisiondelete.

You invoke this special page by going to an article history page, checking
some revisions, and clicking "Edit tags of selected revisions". Then you
pick the modifications you want to make and click "Apply". Very much like
the revision deletion workflow.

I had to restructure some of the Action routing code, which was only
designed to handle revision deletion. Also removing some code from
SpecialRevisiondelete which didn't work as advertised in the first place,
and definitely doesn't work now.

Change-Id: I7d3ef927b5686f6211bc5817776286ead19d916b
2015-04-15 18:31:12 +00:00
Timo Tijhof
b4bac102b6 tests: Clean up file headers
* Remove redundant @licence/@license from test suite files.
  They already have full licence headers. And @licence raises a
  warning in Doxygen.

* Fix weird messes of comments inside comments and other things.

Change-Id: I38da8ca76330f72b8dc22b0ecf1ea69d5ea55ede
2015-04-01 00:17:12 +01:00
jenkins-bot
4be623a6b3 Merge "Revert "Make an empty "?action=" parameter default to "view""" 2014-10-11 17:23:21 +00:00
Brion VIBBER
4587cd5c71 Revert "Make an empty "?action=" parameter default to "view""
Breaks all non-view actions on dev wikis, something's not right with the patch.

This reverts commit a90b7ea969.

Change-Id: Ib9a5eb07ef48716df193fbb62a86c13e5c80dafd
2014-10-11 17:15:49 +00:00
Thiemo Mättig
e1a4fe4be5 Add test for canUseWikiPage special case to ActionTest
Change-Id: I6b037d4aa9101a3a416cdf3bd1e26f14b056b4f7
2014-10-11 00:30:21 +00:00
Thiemo Mättig
a90b7ea969 Make an empty "?action=" parameter default to "view"
When no action is given, e.g. in
https://en.wikipedia.org/wiki/URL
the action defaults to "view". Just like you called
https://en.wikipedia.org/wiki/URL?action=view

But when the action is empty, e.g.
https://en.wikipedia.org/wiki/URL?action=
you get an error message telling you that "the action specified"
can not be "recognized". Wait. I did not "specified" an action.
That's why I left the parameter empty. It doesn't make much sense
to have an empty action name that's different from the "view"
default, right? From the users point of view I expect the empty
string to behave like null/undefined.

Change-Id: I331924d9223e597293bc8285f0c330edf08e429b
2014-10-10 21:52:07 +02: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
Thiemo Mättig
5043b4993b Add tests for IE workarounds to ActionTest
Change-Id: Iafaa3266e57f22f108c0253053103681bd88bd10
2014-07-22 13:55:44 +02:00
Thiemo Mättig
e2675eaeef Add tests for NULL to ActionTest
NULL should default to 'view'. But both the exists check and the
factory should fail when asked for a NULL action.

Change-Id: I5751489eed890bb44101f2a4ef73002bff68b207
2014-07-22 13:55:44 +02:00
Thiemo Mättig
1ccdd5bec0 Add tests for disabled actions in ActionTest
Change-Id: I2c742fca0fa87604c1d503b938ecc495aafd8376
2014-07-22 13:55:44 +02:00
Thiemo Mättig
d3e26d2906 Add more test cases to ActionTest
1. The 'dummy' test case already tested ucfirst(), but strtolower()
was not tested. The new 'DUMMY' tests fixes that.

2. Add a new test where the requested action is false.

3. Refactored the dummy builder a bit to make it easier to reuse.

Change-Id: Id7d9adac064b307b04bf6accb83ffd7f217a857c
2014-07-22 12:37:05 +02:00
umherirrender
53c420e278 Fixed spacing
- use tab as indent instead of spaces
- Added space after closures "function"
- Added spaces around string_concat
- Added newline inside empty blocks
- Removed four spaces after comma

Change-Id: I4425b0c6a69b36f40acfea6511b8950cf09ce2b2
2014-07-20 21:41:41 +02:00
umherirrender
2b021dc48a Fixed spacing
- Added/removed spaces around parenthesis
- Added space after switch/if/foreach
- changed else if to elseif

Change-Id: I99cda543e0e077320091addd75c188cb6e3a42c2
2014-07-19 23:12:10 +02:00
Thiemo Mättig
bf0d2a110a Improve tests for Action::exists
Change-Id: I905fd8e88ff625cd88c672ddac7a5ac4f4a94b36
2014-07-18 15:33:21 +00:00
Thiemo Mättig
20a1087bd5 Add ActionTest for static Action methods
Change-Id: Ifea52280486b8aa29fbab42e4c7d3ea907849b52
2014-07-18 15:29:35 +02:00