PHPUnit, superglobal vars. How to setup test such that $_SERVER and $_GET are properly set?

Posted by gilad.gruber on Stack Overflow See other posts from Stack Overflow or by gilad.gruber
Published on 2010-03-08T10:04:37Z Indexed on 2010/03/08 10:06 UTC
Read the original article Hit count: 257

Filed under:
|
|

Hi All,

I am writing some PHP code to parse incoming URLs. It relies heavily on PHP blobals such as $_SERVER and $_GET. I am thinking of manually setting these up in PHPUnit unit test setUp() function. Is there a better way of doing this?

thanks,

G

© Stack Overflow or respective owner

Related posts about php

Related posts about phpunit