Commit graph

16 commits

Author SHA1 Message Date
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
Brad Jorsch
847f92ca23 API: Remove warning about continuation change
Change-Id: I2a69e8ae7dc7df915ceaaeed740b74d55f9207ce
2015-09-30 19:48:52 +00:00
Brad Jorsch
9c7385b8ad API: Change default continuation format for action=query
The new format is much easier to use correctly, and should therefore be
the default. The old format is maintained for clients that need the
additional flexibility.

Bug: T96858
Change-Id: I984e63581f4ef23ccada916b6d45131d1fb5e001
2015-06-19 15:13:21 -04:00
aude
851552a5c4 Replace use of assertType with assertInternalType and assertInstanceOf
These are available in phpunit since 3.5.0, which I think
is reasonable to expect people to have at this point,
especially when we actually require 3.7.0 or higher in phpunit.php:

Use assertSame instead of assertArrayEquals in UIDGeneratorTest.
assertSame (and assertEqual) care about sortorder of the array,
and is perfectly sufficient in this case to check they array is correct.

if ( $puVersion !== '@package_version@' && version_compare( $puVersion, '3.7.0', '<' ) ) {
        die( "PHPUnit 3.7.0 or later required; you have {$puVersion}.\n" );
}

Change-Id: Ic32ab45110e4c4304ef046ae8d0e98c741255559
2015-04-09 01:15:44 -04:00
Yuri Astrakhan
51e4f30eb7 API unittests, pass optional params to doApiRequest()
ApiQueryTestBase::check() should pass all optional params
like session and user to the doApiRequest()

Change-Id: If1cb52b03faba06c97d330a91a23893fe08acf22
2015-03-17 04:07:24 +03:00
Yuri Astrakhan
95f22fafaf Fixed phpunit exception test
phpunit has removed that class in
f0322b6978
instead adding a dependency on "sebastian/comparator": "dev-master"
https://github.com/sebastianbergmann/comparator

The class name changed from PHPUnit_Framework_ComparisonFailure
to \SebastianBergmann\Comparator\ComparisonFailure\ComparisonFailure

Bug: T90880
Change-Id: I8988d0b07c00f54c8c8dd38a5e92a5736d88b163
2015-03-17 03:01:28 +03:00
Brad Jorsch
af11268d05 API: Warn when neither rawcontinue nor continue are given to action=query
The default behavior for continuation for action=query will be changing.
Warn clients that they will need to update.

Change-Id: I52d048040e898a0c9630e2aed071b339ec12de42
2014-10-21 19:16:05 +00:00
umherirrender
6b4c44c2db Add missing @param to function docs
Change-Id: Ib26407bc55dff7969d8a3b1e2ae51751b202d8fb
2014-08-18 16:24:59 +00:00
umherirrender
26837cd280 Cleanup some docs (tests)
- Swap "$variable type" to "type $variable"
- Fixed spacing inside docs
- Makes beginning of @param/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: Ia041964250d8b7c0349d79dc9b131c5b8696e795
2014-08-11 20:06:52 +02: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
Brad Jorsch
946c575fe6 Improve ApiQueryTestBase::assertResult
It really shouldn't be printing output in the middle of the phpunit
progress indicator; this output should be included in the final output
instead.

This rewrites the function to make use of PHPUnit's data structure
diffing support.

Bug: 57974
Change-Id: Ia4b66182922005da8e2bc173794d712492ad13fa
2013-12-04 12:00:12 -05:00
addshore
d442e88e55 @covers for ApiQuery stuff
Change-Id: Id8a89abd545d8e2a95b1d246776049b9c888e53c
2013-10-24 11:04:00 +01:00
umherirrender
cbc4fd7a5b print is not a function
Removed parenthesis after print

Change-Id: I1343872de7aa7c64952a3d86a63aaa091e46bda3
2013-05-09 20:06:03 +02:00
Siebrand Mazeland
791d0b2a98 Update code formatting
Change-Id: I16a9b42651f1cfb1a70dffbb67b7b83dfeb90d03
2013-04-26 14:21:20 +00:00
Siebrand Mazeland
6da93fc6f6 Update code formatting
Also update some previous inconsistencies pointed out by Krinkle in change IDs:
* Ide20743a2e84ff68549286120e6cff9d9f396f54
* I811ca957b6588085d67606ebc0cd4033a1e53839

Change-Id: Ife33b931870d0d7e04fcb40974997436d27f528f
2013-03-27 14:15:11 +01:00
Yuri Astrakhan
68820277af API continue param to streamline iteration of complex queries
Greatly simplifies query result iteration by the clients
by providing a mechanism to track sub-iterations (props in generated set)

Assuming the client has the param=>value dictionary with the original request
parameters, client will only need to perform this operation in their language
to get all results from the server regardless of what query they make.

  $request = array_merge( $request, $result['continue'] );

Related changes:
* Moved dieContinueUsageIf() from ApiQueryBase to ApiBase
* Internal calls will also return unused param warnings
* Reworked query unit tests for easier testing

Change-Id: Ieb45241fc6db2109f1d92fa3381165ec30701b63
2013-03-01 19:06:46 -05:00