FauxResponse: Honor cookie options, and other cleanup
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 29 Sep 2015 02:09:07 +0000 (22:09 -0400)
committerBryanDavis <bdavis@wikimedia.org>
Tue, 29 Sep 2015 22:45:56 +0000 (22:45 +0000)
commitc3dc3985148583c6fe3eeaee682f5b8cb0c45b89
tree98073407491faff0ba0f298cd27e6cf68a2296d7
parent7c9909f09dbb1dad994a0cc8b89db1a97b74073b
FauxResponse: Honor cookie options, and other cleanup

We have this nice class for unit testing cookie-setting, but the
cookie-setting method ignores all the parameters! Fix that. Also provide
accessors to check the entire set of cookie data, and the set cookies as
a whole.

While this does change the semantics of FauxRequest::getcookie() in that
the name now needs to be prefixed, no extension in Gerrit uses this
method so we should be fine.

Also clean up the case of the setCookie and getCookie methods while
we're at it. Since PHP method names are case-insensitive, this doesn't
even break compatibility with extensions.

Change-Id: Ib44a074bf9796bc0b470d557e39465792f399d30
includes/EditPage.php
includes/User.php
includes/WebResponse.php
tests/phpunit/includes/FauxResponseTest.php