Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Revert "Organizes the php scripts used for testing better, so that th…
…e whole logic of a unit, server-side and client-side, is contained within the unit itself. Nearly all ajax unit tests take advantage of the new 'framework'. Lots of files got deleted because they became redundant or weren't used anymore." This reverts commit 228ab3d.
- Loading branch information
Showing
38 changed files
with
1,301 additions
and
828 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 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,4 @@ | ||
<?php header("Content-type: atom+xml") ?> | ||
<root> | ||
<element /> | ||
</root> |
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 @@ | ||
undefined(); |
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 @@ | ||
{bad: toTheBone} |
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,10 @@ | ||
<script> | ||
<!-- | ||
ok( true, "script within html comments executed" ); | ||
--> | ||
</script> | ||
<script> | ||
<![CDATA[ | ||
ok( true, "script within CDATA executed" ); | ||
]]> | ||
</script> |
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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<dashboard> | ||
<locations class="foo"> | ||
<location for="bar" checked="different"> | ||
<infowindowtab> | ||
<tab title="Location"><![CDATA[blabla]]></tab> | ||
<tab title="Users"><![CDATA[blublu]]></tab> | ||
</infowindowtab> | ||
</location> | ||
</locations> | ||
</dashboard> |
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 @@ | ||
<?php echo file_get_contents('php://input'); ?> |
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 @@ | ||
<?php echo $_SERVER['QUERY_STRING']; ?> |
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,5 @@ | ||
<?php | ||
|
||
header("HTTP/1.0 400 Bad Request"); | ||
|
||
echo "plain text message"; |
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,21 @@ | ||
<?php | ||
error_reporting(0); | ||
|
||
$ts = $_REQUEST['ts']; | ||
$etag = md5($ts); | ||
|
||
$ifNoneMatch = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : false; | ||
if ($ifNoneMatch == $etag) { | ||
header('HTTP/1.0 304 Not Modified'); | ||
die; // stop processing | ||
} | ||
|
||
header("Etag: " . $etag); | ||
|
||
if ( $ifNoneMatch ) { | ||
echo "OK: " . $etag; | ||
} else { | ||
echo "FAIL"; | ||
} | ||
|
||
?> |
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 @@ | ||
ok( "<?php echo $_SERVER['REQUEST_METHOD'] ?>" === "GET", "request method is <?php echo $_SERVER['REQUEST_METHOD'] ?>" ); |
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,18 @@ | ||
<?php | ||
|
||
header( "Sample-Header: Hello World" ); | ||
header( "Empty-Header: " ); | ||
header( "Sample-Header2: Hello World 2" ); | ||
|
||
$headers = array(); | ||
|
||
foreach( $_SERVER as $key => $value ) { | ||
|
||
$key = str_replace( "_" , "-" , substr( $key , 0 , 5 ) == "HTTP_" ? substr( $key , 5 ) : $key ); | ||
$headers[ $key ] = $value; | ||
|
||
} | ||
|
||
foreach( explode( "_" , $_GET[ "keys" ] ) as $key ) { | ||
echo "$key: " . @$headers[ strtoupper( $key ) ] . "\n"; | ||
} |
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,20 @@ | ||
<?php | ||
error_reporting(0); | ||
|
||
$ts = $_REQUEST['ts']; | ||
|
||
$ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : false; | ||
if ($ifModifiedSince == $ts) { | ||
header('HTTP/1.0 304 Not Modified'); | ||
die; // stop processing | ||
} | ||
|
||
header("Last-Modified: " . $ts); | ||
|
||
if ( $ifModifiedSince ) { | ||
echo "OK: " . $ts; | ||
} else { | ||
echo "FAIL"; | ||
} | ||
|
||
?> |
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,13 @@ | ||
<?php | ||
error_reporting(0); | ||
if ( $_REQUEST['header'] ) { | ||
header("Content-type: application/json"); | ||
} | ||
|
||
$json = $_REQUEST['json']; | ||
if($json) { | ||
echo '[ {"name": "John", "age": 21}, {"name": "Peter", "age": 25 } ]'; | ||
} else { | ||
echo '{ "data": {"lang": "en", "length": 25} }'; | ||
} | ||
?> |
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 @@ | ||
{ "data": {"lang": "en", "length": 25} } |
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,14 @@ | ||
<?php | ||
error_reporting(0); | ||
$callback = $_REQUEST['callback']; | ||
if ( ! $callback ) { | ||
$callback = explode("?",end(explode("/",$_SERVER['REQUEST_URI']))); | ||
$callback = $callback[0]; | ||
} | ||
$json = $_REQUEST['json']; | ||
if($json) { | ||
echo $callback . '([ {"name": "John", "age": 21}, {"name": "Peter", "age": 25 } ])'; | ||
} else { | ||
echo $callback . '({ "data": {"lang": "en", "length": 25} })'; | ||
} | ||
?> |
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 @@ | ||
ERROR <script type="text/javascript">ok( true, "name.html retrieved" );</script> |
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,24 @@ | ||
<?php | ||
error_reporting(0); | ||
$wait = $_REQUEST['wait']; | ||
if($wait) { | ||
sleep($wait); | ||
} | ||
$xml = $_REQUEST['xml']; | ||
if($xml) { | ||
header("Content-type: text/xml"); | ||
$result = ($xml == "5-2") ? "3" : "?"; | ||
echo "<math><calculation>$xml</calculation><result>$result</result></math>"; | ||
die(); | ||
} | ||
$name = $_REQUEST['name']; | ||
if($name == 'foo') { | ||
echo "bar"; | ||
die(); | ||
} else if($name == 'peter') { | ||
echo "pan"; | ||
die(); | ||
} | ||
|
||
echo 'ERROR <script type="text/javascript">ok( true, "name.php executed" );</script>'; | ||
?> |
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 @@ | ||
<div id="post"> | ||
<?php | ||
foreach( $_POST as $key=>$value ) | ||
echo "<b id='$key'>$value</b>"; | ||
?> | ||
</div> | ||
<div id="get"> | ||
<?php | ||
foreach( $_GET as $key=>$value ) | ||
echo "<b id='$key'>$value</b>"; | ||
?> | ||
</div> |
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,11 @@ | ||
<?php | ||
error_reporting(0); | ||
if ( $_REQUEST['header'] ) { | ||
if ( $_REQUEST['header'] == "ecma" ) { | ||
header("Content-type: application/ecmascript"); | ||
} else { | ||
header("Content-type: text/javascript"); | ||
} | ||
} | ||
?> | ||
ok( true, "Script executed correctly." ); |
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,5 @@ | ||
<?php | ||
|
||
header( "HTTP/1.0 $_GET[status] $_GET[text]" ); | ||
|
||
?> |
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,7 @@ | ||
html text<br/> | ||
<script type="text/javascript">/* <![CDATA[ */ | ||
testFoo = "foo"; jQuery('#foo').html('foo'); | ||
ok( true, "test.html executed" ); | ||
/* ]]> */</script> | ||
<script src="data/test.js"></script> | ||
blabla |
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,3 @@ | ||
var testBar = "bar"; | ||
jQuery('#ap').html('bar'); | ||
ok( true, "test.js executed"); |
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,7 @@ | ||
html text<br/> | ||
<script type="text/javascript">/* <![CDATA[ */ | ||
testFoo = "foo"; jQuery('#foo').html('foo'); | ||
ok( true, "test.php executed" ); | ||
/* ]]> */</script> | ||
<script src="data/test.js?<?php srand(); echo time() . '' . rand(); ?>"></script> | ||
blabla |
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,5 @@ | ||
<script type="text/javascript"> | ||
var testFoo = "foo"; | ||
jQuery('#foo').html('foo'); | ||
ok( true, "test2.html executed" ); | ||
</script> |
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,3 @@ | ||
<div class="user">This is a user</div> | ||
<div class="user">This is a user</div> | ||
<div class="teacher">This is a teacher</div> |
Oops, something went wrong.