Message: Clean up unit tests and improve code coverage
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 2 Apr 2015 07:01:38 +0000 (08:01 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 2 Apr 2015 07:36:19 +0000 (08:36 +0100)
commit86a771beffdd83fddca72d3f131b5e07f3c35b49
tree760a649bd92f817ca5dae11498a2dd3e9d4c2e6c
parent1b6f70089d47facd887ef3e1708780eff56c2465
Message: Clean up unit tests and improve code coverage

* Remove unnecessary use of ReflectionClass. It was testing
  internal properties that aren't part of the API. Using the
  getters instead.

* Remove need for func_get_args that was making the test more
  complex and the data provider hard to read. Simply maintain
  it as array of expected params and array of variadic arguments.

* Rename tests to more closely match tested methods.

* Rename data providers to provide*, and make them static.

* Reorder tests to more closely match logical order of the class.

* Improve line coverage from 31% to 67%.

Also:
* Remove testParams (dupes testConstructorParams).
* Add tests for RawMessage class.
* Add tests for transformation and parsing.
* Add tests for wfMessage().
* Add tests for Message::newFrom*.
* Add tests for "$*" replacement.
* Add tests for __toString.

Change-Id: I2b183a66f9e9f51bd800088e174b1ae4d3284d8d
includes/Message.php
tests/phpunit/includes/MessageTest.php