HttpFunctions: Increase code coverage
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 29 Mar 2017 00:21:15 +0000 (17:21 -0700)
committerKrinkle <krinklemail@gmail.com>
Wed, 29 Mar 2017 00:27:57 +0000 (00:27 +0000)
commite9f577fd6ba219d2bbce4424e38d287bc0da5643
treef3cf9d9fd6361e155b21276ba17246689709a19d
parent13a2d7b1f9c86ea2727aba4ee6a5df78fbb6f014
HttpFunctions: Increase code coverage

* Complete coverage for Http::getProxy().
* Remove bogus @covers tag on data provider, and add the
  relevant MWHttpRequest::getFinalUrl to the test instead.
* Convert test to use dataProvider and add missing test cases
  to increase getFinalUrl() test coverage to 100%.
* Minor clean up in getFinalUrl to consistently use early-return
  for all cases, not just for relative 'domain' and 'isset-host'
  cases. Without this coverage actually couldn't reach 100% due
  to the remainder of the empty else branch never being reached
  (CRAP: "Redundant 'else' after 'return'")

Change-Id: I775d95965dc23a1e6c4c62ed84f9da64b6c72135
includes/http/MWHttpRequest.php
tests/phpunit/includes/http/HttpTest.php