Tests for wfGetIP() follow up r89407
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 15 Aug 2011 20:16:15 +0000 (20:16 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 15 Aug 2011 20:16:15 +0000 (20:16 +0000)
commitaecf8ea39662d55f2b756018b53a99ac1213c8d7
tree6d7f2b7a1ec7631d91c3330aac4c253e289407db
parent9e2f7ebb7d466f078298fe66c0c565ff048c845e
Tests for wfGetIP() follow up r89407

* wfGetIP() now support resetting its internal static variable. Thanks to
 Platonides which introduced this trick with r92960.
* Various tests for $_SERVER['REMOTE_ADDR'] and $wgCommandLineMode.

TODO:

- implements tests for XFF headers.

TEST PLAN:

$ ./phpunit.php --filter wfGetIP --testdox
PHPUnit 3.5.14 by Sebastian Bergmann.

wfGetIP
 [x] Get loopback address when in command line
 [x] Get from server remote addr
 [x] Lack of remote addr throw an exception
$
includes/ProxyTools.php
tests/phpunit/includes/ProxyTools/README [new file with mode: 0644]
tests/phpunit/includes/ProxyTools/wfGetIPTest.php [new file with mode: 0644]