Brandon,
At Digg I wrote a package called PHP_SuperGlobals. The main use case was so that I could mock setcookie(), as such calls were breaking unit tests (sending headers). So in your code you would do something like:
$cookie = PHP_SuperGlobals::singleton('Cookie');
or
$cookie = PHP_SuperGlobals::singleton('CookieMock');
$cookie->setcookie('/', 'foo');
That sort of thing. It has support for $_GET, $_POST, $_COOKIE, and I think $_SERVER. We've gotten pretty used to using it for all of those for mocking input, as well as the setcookie case. But there's a decent interface for customizing it for your needs (IMO). I'm pretty sure this is decoupled from Digg code, and would be willing to make it available if anyone has interest in it.
Thoughts?
Cheers,
Bill
Bill,
I think that'd be great. I'd love to take a look at it, and see if it fits a good starting point. I've got a particular idea of what I'm looking for, but I'm sure this is a common problem and that *someone* has written it before. If I can avoid rewriting it, that'd be preferable.
Best,
Brandon