Commit graph

30 commits

Author SHA1 Message Date
James D. Forrester
711295fb5d Namespace SpecialL* under \MediaWiki\Specials
Plus two redirect specials.

Change-Id: Ie56f96894f6bfbdb9bc093fce8b72b18f8adce86
2023-05-04 19:27:38 +00:00
Umherirrender
e5e276d6c4 tests: Add missing @group Database
$tablesUsed does not let the test run in the correct group in CI
Fix casing and remove duplicate as well

Change-Id: Id9e092865464de4900965840834d946925c728e5
2022-08-06 22:55:12 +02:00
Thiemo Kreuz
58ceac8fc0 Tests: Replace trivial willReturnCallback with direct willReturn
Less setup code, easier to read.

I also found something that looks like it should have been an
assertInstanceOf(), so I made it one.

Change-Id: I7ba9b580c270a103feb0f55b910157f93197fa43
2022-07-18 11:40:09 +02:00
Umherirrender
770f905900 tests: Use namespaced IDatabase class
Change-Id: I7171ff26faee00d9eaabc33c2f3d91049ea0b40d
2022-05-28 00:09:55 +02:00
Alexander Vorwerk
decbaf4f38 phpunit: use ->getServiceContainer() in integration tests
Change-Id: I38299cb65eeaadfdc0eb05db4e8c0b0119cfb37d
2022-01-27 22:04:16 +01:00
libraryupgrader
5357695270 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
  The following sniffs now pass and were enabled:
  * Generic.ControlStructures.InlineControlStructure
  * MediaWiki.PHPUnit.AssertCount.NotUsed

npm:
* svgo: 2.3.0 → 2.3.1
  * https://npmjs.com/advisories/1754 (CVE-2021-33587)

Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
2021-07-22 03:36:05 +00:00
Umherirrender
205f141bb8 Improve some class properties documentation in tests
Change-Id: Id9c9e56865cf9a6bb112be37a5674ec753604fb1
2021-02-02 16:48:15 +00:00
Thiemo Kreuz
20b2c5000d Make use of array deconstruction directly in foreach, if possible
Deconstructing non-sparse, numerically indexed arrays directly in
foreach (a.k.a. using the list() syntax in foreach) is possible since
PHP 5.5.

The possibility to use string array keys as well as non-sequential
numeric keys in array deconstruction was added in PHP 7.1.

Change-Id: I56a48552a45f61cedc291b306cad8548fc70d485
2020-11-12 18:38:06 +00:00
jenkins-bot
a18a39f413 Merge "MediaWikiTestCase to MediaWikiIntegrationTestCase" 2020-07-01 18:39:57 +00:00
addshore
959bc315f2 MediaWikiTestCase to MediaWikiIntegrationTestCase
The name change happened some time ago, and I think its
about time to start using the name name!
(Done with a find and replace)

My personal motivation for doing this is that I have started
trying out vscode as an IDE for mediawiki development, and
right now it doesn't appear to handle php aliases very well
or at all.

Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
2020-06-30 17:02:22 +01:00
daniel
7d1007deae Fix "can't reopen tables" test error for Special:BrokenRedirects
Bug: T256006
Change-Id: I9250769ea0e61c70f03e1ece60e12237db31de38
2020-06-24 08:29:47 +00:00
Thiemo Kreuz
0a41206ff6 Tests should not have a constructor, but use setUp()
This creates certain problems with PHPUnit, see I4fc06bf.

Change-Id: I898c09ec16521e6f8c60eb589843ccfc48d63025
2019-11-25 14:55:03 +01:00
Umherirrender
5bd311b1a2 Add public as visibility in tests folder
Add public, protected or private to function missing a visibility
Enable the tests folder for the phpcs sniff

Change-Id: Ibefce76ea9984c47e08c94889ea2eafca7565e2c
2019-10-10 21:55:37 +02:00
Reedy
dd71a77512 Make most special pages class names match filename
Change-Id: I3a9f932acb7d9cf44a984b5d97f9fbc6b8670f7d
2019-09-10 02:47:08 +01:00
Thiemo Kreuz
9314453c93 Make use of the list() feature where it makes sense
This code is functionally identical, but less error prone (not so easy
to forget or mix these numerical indexes).

This patch happens to touch the Parser, which might be a bit scary. We
can remove this file from this patch if you prefer.

Change-Id: I8cbe3a9a6725d1c42b86e67678c1af15fbc5961a
2019-03-24 20:12:23 +00:00
Aryeh Gregor
e68fdb4065 Mass conversion to SpecialPageFactory service
Change-Id: Ia6e1e819ec6cbe8bf75b820109f51d47863e31fc
2018-08-17 12:03:12 -07:00
Umherirrender
d9fb8bab5e Move phpunit @group from file comment to class comment
Remove @group from non tests

Change-Id: Iae9ee3bc5f539a9b4ded8374006ab2993234450e
2018-03-10 11:48:28 +01: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
addshore
1094206064 Add missing QueryAllSpecialPagesTest $queryPages property
Change-Id: Ic19e1b5f656599ed1dc06818403a0a8bca8004b7
2017-01-03 16:25:52 +00:00
Amir Sarabadani
c242b4351b Proper instantiating of QueryPage special pages in QueryAllSpecialPagesTest
Change-Id: If4420067011da756b8a36917f1c35fd2d380dae9
2017-01-03 19:29:16 +03:30
Fomafix
202f695f67 Update weblinks in comments from HTTP to HTTPS
Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link.

Also update some defect links.

Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
2016-11-07 15:24:46 +01: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
Siebrand Mazeland
69ec133bc5 Pass phpcs-strict on some test files (10/11)
Change-Id: I5624292143fcabe890779f5095eae735d7afb176
2014-04-24 13:50:56 -07:00
Chad Horohoe
f508561f7b Moved $wgQueryPages stuff out of the global scope and into a function
Change-Id: Ica034bdad89133bfce0b4238d62ed00865936644
2014-03-18 08:36:32 -07:00
addshore
aea1b27db0 @covers tags for more test classes
Change-Id: I19d49c279646a4b4c595700e53b790ba4eb9521e
2013-10-24 20:35:04 +01:00
addshore
de7af7ac2c Fix scope on all /phpunit test methods
Change-Id: I3ce92463d485a0fb23e464e9a8059330f32d79af
2013-10-24 10:31:32 +02:00
Siebrand Mazeland
49dfbc59d0 Update formatting
6 of n.

Change-Id: I0ca3f1f72349623631ce1d7f3a4e2ed5edbdbdf4
2013-02-15 12:44:42 +00:00
Antoine Musso
01b3af3ac6 Skip BrokenRedirectsPage query test under MySQL
The MySQL backend, when using temporary tables, does not support referencing
a table which was already open.
http://bugs.mysql.com/bug.php?id=10327

This patch skip BrokenRedirectsPage on MySQL as reported on r102411.
2012-01-16 10:33:24 +00:00
Platonides
a26f9bd70f r102411 fixup. Close register globals vuln, and document
why is there that require_once.
2012-01-07 22:42:05 +00:00
Antoine Musso
2368c97889 test SQL for our QueryPages objects
Part of bug 32118: test special pages SQL queries against all supported DB

Still need to add all the other non QueryPage special pages and then setup
jenkins to support other databases.
2011-11-08 16:22:42 +00:00