Commit graph

12 commits

Author SHA1 Message Date
Fomafix
d65ac78277 Replace HTTP by HTTPS
* https://www.unicode.org/ instead of http://www.unicode.org/ or
  http://unicode.org/
* https://secure.php.net/ instead of http://www.php.net/ or
  http://php.net/
* https://hhvm.com/ instead of http://hhvm.com/
* https://www.iis.net/ instead of http://www.iis.net/

Change-Id: I84d818a7e0ced5ffb9485ec89a75efb28a77c1e0
2018-05-22 12:14:14 +02:00
Timo Tijhof
14644a2fb0 phpunit: Add some @covers and @large/@medium to integration tests
- @small: single class, no I/O (unit test).
- @medium: multi-class (partial or no mocks), no I/O (unit/integration test).
- @large: multi-class, I/O allowed (integration test).

Change-Id: I09317e6dd9b0ee34b7467fbffdd07957ef55dc04
2018-03-20 09:14:34 -07:00
Kunal Mehta
449e31a179 MWHttpRequest: Restore ability to pass null for $options
Prior to 3de744597e, it was possible to pass `null` for $options.
Restore that by setting the default type to be null, and explicitly
document that null is a supported value in the doc block.

Also update the signature of MWHttpRequestTester to match.

Change-Id: I74d586afa5527e0a30ea99f3989f4dd12fa9fea1
2018-02-06 13:05:02 -08:00
Kunal Mehta
92ee198c66 Add @coversNothing in places where @covers does not apply
These tests apply to things that are not relevant to PHP code coverage,
such as testing presence of messages, JSON files, or the PHPUnit tests
themselves.

Using @coversNothing indicates that there is no code here to be covered,
and prevents warnings when using --strict-coverage mode (T152923).

Change-Id: Id89ee2c15a3ce3f10e34b13fb677cd1af75af9e6
2017-12-28 08:53:40 +00:00
Kunal Mehta
a9960b53be tests: Use checkPHPExtension() instead of re-implementing it
Change-Id: I7f5e8684d556befc0aefa302187c573e7a3cff62
2017-12-25 22:06:37 +00:00
Huji Lee
595d2e5fd0 Do not run tests that depend on curl if it is not loaded
Bug: T176193
Change-Id: Ia7b9b0196f800eb14463acc2a24df5ac1e48f3ed
2017-09-19 21:51:59 -04:00
Amir Sarabadani
bc74afc67e Move HttpAccept* to libs
Bug: T163923
Change-Id: I4984f6b77843669950afeff82351827cd416a80d
2017-06-12 18:28:25 +04:30
Amir Sarabadani
4ec5164b4e Move HttpAcceptNegotiator and HttpAcceptParser from Wikibase to core
This will be needed for implementing Special:PageData

Bug: T163923
Change-Id: I2315d7dcdfa5973998917af311ebecc855b37f73
2017-06-10 04:27:10 +04:30
Timo Tijhof
e9f577fd6b 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
2017-03-29 00:27:57 +00:00
James D. Forrester
ebb42830ec Follow-up 1e9c3619: Correct @T1234 accidental cruft
Change-Id: I94e50ef3356e4e53f9a9082484dff97e49a0e2e2
2017-02-24 08:32:52 -08:00
James D. Forrester
1e9c361960 tests: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I46261416f7603558dceb76ebe695a5cac274e417
2017-02-21 02:14:34 +00:00
Gergő Tisza
1531659d25 Clean up http classes a bit
* added integration tests. We probably don't want automated tests
  to make external requests but these make manual testing more
  convenient. Documented some oddities discovered by testing.
* made ::$status, ::proxySetup() and ::getHeaderList()
  protected; they were not referenced in any gerrit-hosted extension
  and they provide no useful functionality to external callers.
  Similarly, marked ::read() and ::errorHandler() as internal
  (these are used as callbacks so can't be protected)
* removed inheritance abuse in ::execute()
* documented ::execute() as returning a StatusValue (but
  keep returning a Status for now)
* changed setCookie argument defaults to ones that make sense
* replaced MWException
* moved unit tests to the correct location
* fixed some code style issues

Change-Id: I5852fc75badc5d475ae30ec2c9376bde7024bd95
2016-11-30 19:00:44 -08:00