Re: phpt test with $_SERVER
| From: | Gregory Beaver | Date: | Mon, 28 Jan 2008 18:29:31 +0000 |
| Subject: | Re: phpt test with $_SERVER | ||
| References: | 1 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-4771@lists.php.net to get a copy of this message | ||
Philippe Jausions wrote:
> Hi QA team,
>
> I'm trying to put together some tests for HTTP package: How does one set
> $_SERVER for a a phpt file? I know of --POST-- and --GET-- section, but
> that's all...
$_SERVER is populated from environment variables in phpt, as it uses the
cgi SAPI. If you want to populate SCRIPT_NAME, use this section, for
example:
--ENV--
SCRIPT_NAME=blahblahblah
For samples, take a look at
http://cvs.php.net/viewvc.cgi/pecl/phar/tests/frontcontroller11.phpt?view=markup
to see a test that simulates a web request for
"http://localhost/frontcontroller1.phar.php/a.jpg"
Greg