Commit graph

6 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
Chad Horohoe
59afd687ce Convert most libs/ tests to use PHPUnit_Framework_TestCase
They don't actually need any of the mess that MediaWikiTestCase provides

Change-Id: Ibd067480fc294096d1249132cb800e09889efb18
2014-12-29 20:53:24 -08:00
Timo Tijhof
96771e3a65 test: Clean up data providers that should be static
Follows-up b36d883.

By far most data providers are static (and PHPUnit expects them
to be static and calls them that way).

Most of these classes already had their data providers static
but additional commits sloppily introduced non-static ones.

* ResourceLoaderWikiModuleTest, 8968d8787f.
* TitleTest, 545f1d3a73.
  Odd unused method 'dataTestIsValidMoveOperation' was introduced
  in 550b878e63.
* GlobalVarConfigTest, a3e18c3670.

Change-Id: I5da99f7cd3da68c550ae507ffe1f725d31e7666f
2014-09-18 12:52:44 -07:00
Thiemo Mättig
ceb196fa9f Skip 64 bit MWMessagePack tests on 32 bit machines
It's not only Windows. I have an Ubuntu machine with a PHP setup
limited to 32 bit (which is totally fine, it allows me to develop
and always stay compatible to Windows and other 32 bit environments).

I don't see an other way than to skip these tests on a 32 bit
machine. The loss (PHP clips values larger than 2147483647 to
2147483647) does not happen in the code that is tested but in the
test setup.

Change-Id: Ie9a173c0a92ed84eaaea981a25ba130f2eca169e
2014-07-09 17:21:40 +02:00
Ori Livneh
a7a5c414bb MWMessagePack: improvements to test suite, exception handling, array detection
* Throw InvalidArgumentException
* Use data provider in unit tests
* Detect associative arrays without copying

Per Tyler's post-merge review of Id2833c5a9.

Change-Id: Iec6b135238ca5da3002944066843102f0ae8d23d
2014-01-03 03:57:25 -05:00
Ori Livneh
681607e55b Add class implementing MessagePack serialization
MessagePack is a space-efficient binary data interchange format. I am going to
use it to encode profiling data in ProfilerSimpleUDP. The official PHP
implementation is provided as a C extension, so using it would further
encumber migration to HHVM. This patch adds MWMessagePack, a class implementing
a pack() method for encoding native PHP values as MessagePack byte strings. The
implementation is based on <https://github.com/onlinecity/msgpack-php>, but
revised for clarity and conformity with MediaWiki coding conventions.

Change-Id: Id2833c5a9da659cb13ec1330de9dd57138ada9c8
2014-01-02 18:04:24 -08:00