Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit Tests: converting net tests to use PHP
- Loading branch information
jakearchibald
committed
Sep 10, 2009
1 parent
8e5b5ac
commit 5128b8d
Showing
5 changed files
with
69 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
$statusCode = 200; | ||
if (isset($_GET['code'])) { | ||
$statusCode = (int)$_GET['code']; | ||
} | ||
|
||
$host = $_SERVER['HTTP_HOST']; | ||
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); | ||
|
||
header('Status: ' . $statusCode); | ||
header('Location: http://' . $host . $uri . '/basictext.txt'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
header('Content-type: text/plain'); | ||
|
||
// these headers will be output, along with anything starting HTTP_ | ||
$outputHeaders = array( | ||
'REQUEST_METHOD', | ||
'CONTENT_TYPE', | ||
'CONTENT_LENGTH' | ||
); | ||
|
||
foreach ($_SERVER as $key => $value) { | ||
// output only particular headers, we don't want to give away people's | ||
if ( substr($key, 0, 5) == 'HTTP_' || in_array($key, $outputHeaders) ) { | ||
echo $key . ': ' . $value . "\n"; | ||
} | ||
} |