Commit graph

26 commits

Author SHA1 Message Date
Adam Roses Wight
2df1e9e5fc Replace some of MaintenanceTest with dataProviders
Bug: T184775
Change-Id: Icbaf3cbcf3c51e5b4cd53d55a5230534e74a0a38
2018-01-22 06:43:05 +00:00
Adam Roses Wight
a4df91da77 Refactor MaintenanceTest to use a base test case
Bug: T184775
Change-Id: I0cb2320f765e847a59c721918401da07a3a2b24a
2018-01-21 22:16:19 -08:00
Adam Roses Wight
c8f1ac23bc Begin splitting out maintenance test base classes
Bug: T184775
Change-Id: I73c2f3c6975deec50cf879201cf292c217b51c51
2018-01-21 22:16:19 -08:00
Adam Roses Wight
c7e8c25e8f New namespace MediaWiki\Tests\Maintenance
Bug: T184775
Change-Id: I041b8eb4f1ef3cf882a8082ff3f208604b8edf96
2018-01-16 15:09:44 -05:00
Adam Roses Wight
f28c5739fd Minor documentation cleanup
Bug: T184775
Change-Id: I883a2ebc0a1ce7667a92623a4861be80df26a65d
2018-01-16 13:50:32 -05:00
Umherirrender
b5cddfb27b Remove empty lines at begin of function, if, foreach, switch
Organize phpcs.xml a bit

Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
2017-07-01 11:34:16 +00:00
Timo Tijhof
447ce7e39a phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat
The default will remain PHPUnit 4.x due to PHP 5.5 support.

But, we should allow developers to run tests with newer PHPUnit
versions which are noticably faster (especially for code coverage
reports).

* <https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-5.4.0>
  PHPUnit 5 deprecates the getMock() shortcut for getMockBuilder()->getMock().
  It instead introduces the shortcut createMock() which has better defaults
  than getMockBuilder(). For example, it sets 'disableArgumentCloning' and
  other things by default.

  Going forward, code should either use getMockBuilder directly and configure
  it using the setter methods (instead of the confusing variadic arguments
  of getMock) or simply use the new minimalistic createMock method. This patch
  backports the createMock method to MediaWikiTestCase so that we can start
  using it.

Change-Id: I091c0289b21d2b1c876adba89529dc3e72b99af2
2017-04-06 00:44:32 +00:00
Thiemo Mättig
00c3f09566 Remove empty lines from PHP and JavaScript comment blocks
This is a pure documentation change. It mostly removes empty lines from
comments (and entirely empty comments), as well as adds a few missing
documentation blocks and fixes a minor mistake. I hope it's ok to have
this in one patch. I can split it, please tell me.

Change-Id: I9668338602ac77b903ab6b02ff56bd52743c37c4
2016-12-09 09:01:06 +00:00
addshore
b12086b618 Get ConfigFactory & MainConfig from MediaWikiServices
Change-Id: Iafdd7e00747060572463ffb05aae4543f3a06163
2016-11-23 00:12:38 +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
Andrew H
1ae06b4f3e Add loadWithArgv() to Maintenance class
Very useful for passing in arguments to test Maintenance scripts.
Also, add a comment clarifying when $orderedOptions is available.

Change-Id: Ib25b3b36816bdf566c427b67646554a31a9fef0f
2015-12-31 01:18:48 +00:00
Andrew H
0a0b02b56c Add support for specifying options multiple times in Maintenance scripts.
Bug: T122588
Change-Id: I847d45684ccd4054f4a159394266dc3e5506bbdb
2015-12-30 04:33:29 +00:00
umherirrender
977c810302 Remove empty line comments
Remove empty line comments as found by the
MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.EmptyComment sniff

Change-Id: I5d694f7a7d3bc97e16300ba03c60ad17f3c912a5
2015-10-14 09:46:44 +02:00
Amir E. Aharoni
1857ab94cd MaintenanceTest.php: Make lines shorter to make phpcs happier
Change-Id: I76c23b1acdd50dc8dd423ef651a2fd1d7e5acba3
2015-09-26 13:21:21 +00:00
Kunal Mehta
b016aa66dc Maintenance: Add an easy way to access Config instances
Change-Id: I97d50c624e988c70bb2ac0da4fc33957ce3cf524
2014-09-09 17:37:03 -07:00
umherirrender
c8f574c55b Remove return from MaintenanceFixup::outputChanneled
Parent Maintenance::outputChanneled also has no return value

Change-Id: Idae9d3e1ca70d9f0ed81b345eb4fef21294cea39
2014-07-30 08:27:05 +00:00
umherirrender
092cd8ee31 Fixed some @params documentation (tests)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: Ic8aaf0a93796b97d0fa4617c1f86ff59f4b36131
2014-04-17 20:43:42 +02:00
umherirrender
5dbfd5bf80 Fixed spacing
- Removed trailing spaces in comments
- Removed multiple empty lines
- Removed space after object operator

Change-Id: I9fd3256ab490c7cd2034de3fd94e6be6e6d6d8f2
2013-11-21 18:52:25 +00:00
addshore
86adcfb8b7 @covers tags for maintenance tests
Change-Id: Ica5f351f71ee5fccae97560f2de6d75fc5da721b
2013-10-24 19:12:22 +01:00
Tim Starling
d1bc243f65 Remove all instances of the word "iff"
It's elitist mathematical jargon. In all cases dealt with here, it adds
no additional meaning compared to "if", beyond what was already obvious
from context. Thus, its only purpose is to smugly demonstrate that the
author attended their second-year mathematics classes, at the expense of
causing confusion for everyone who doesn't have such a background.

If you really think you need to convey extra information beyond what
"if" gives you, the English language contains plenty of devices for doing
so, without resorting to neologisms.

Change-Id: Iae21095d02ec2935c10e94f532235c2671c115b1
2013-10-23 10:56:54 -07:00
Siebrand Mazeland
791d0b2a98 Update code formatting
Change-Id: I16a9b42651f1cfb1a70dffbb67b7b83dfeb90d03
2013-04-26 14:21:20 +00:00
Siebrand Mazeland
9b7889b84b Use American English spelling for behavior
Spotted in ipbreason-dropdown by Shirayuki.

Change-Id: I576ed4bc0abe5ab980aaee3fb9f9e4b43087311f
2013-03-04 10:24:57 +01:00
Siebrand Mazeland
69d4d69096 Update formatting
11 of n.

Change-Id: Ifdaf198b16bf72e1e0a3d3802c041d239096ae28
2013-02-15 13:41:06 +00:00
Antoine Musso
0fd05285d7 pass codesniffer on tests/
Fix almost all occurences of the following sniffs:

Generic.CodeAnalysis.UselessOverridingMethod.Found
Generic.Formatting.NoSpaceAfterCast.SpaceFound
Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma
Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine
Generic.PHP.LowerCaseConstant.Found
PSR2.Classes.PropertyDeclaration.ScopeMissing
PSR2.Files.EndFileNewline.TooMany
PSR2.Methods.MethodDeclaration.StaticBeforeVisibility

Change-Id: I96aacef5bafe5a2bca659744fba1380999cfc37d
2013-01-28 12:14:26 +01:00
Brad Jorsch
a2093fecb3 Make sure MaintenanceFixup's shutdown is simulated
Previously, MaintenanceTest created a MaintenanceFixup in setUp and
relied on each test to call MaintenanceFixup's simulateShutdown instead
of making sure this was called in tearDown. Change Iee1261e7 broke this
by introducing a meta-test in a parent class.

Fixing that also allows us to not have to special-case failed tests.

Change-Id: I67c8615dd94734bb55ca48aac0c66298accbe0b4
2012-12-07 11:08:15 -05:00
Christian Aistleitner
89743db168 Adding Maintenance output tests
Change-Id: Ib2cb36cd840505e2956a6b0978cea1920277d42c
2012-04-15 21:29:07 +02:00