Refactored and fixed test suite to run async tests
This commit is contained in:
parent
cc5625067a
commit
308d771dd1
6 changed files with 43 additions and 5 deletions
8
build/test/data/json.php
Normal file
8
build/test/data/json.php
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
$json = $_REQUEST['json'];
|
||||
if($json) {
|
||||
echo '[ {"name": "John", "age": 21}, {"name": "Peter", "age": 25 } ]';
|
||||
} else {
|
||||
echo '{ "data": {"lang": "en", "length": 25} }';
|
||||
}
|
||||
?>
|
22
build/test/data/name.php
Normal file
22
build/test/data/name.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
$wait = $_REQUEST['wait'];
|
||||
if($wait) {
|
||||
sleep($wait);
|
||||
}
|
||||
$xml = $_REQUEST['xml'];
|
||||
if($xml) {
|
||||
header("Content-type: text/xml");
|
||||
eval("\$result = $xml;");
|
||||
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";
|
||||
?>
|
1
build/test/data/test.js
Normal file
1
build/test/data/test.js
Normal file
|
@ -0,0 +1 @@
|
|||
foobar = "bar";
|
|
@ -50,8 +50,8 @@ function runTest(tests) {
|
|||
}
|
||||
|
||||
function test(name, callback) {
|
||||
Test = [];
|
||||
synchronize(function() {
|
||||
Test = [];
|
||||
try {
|
||||
callback();
|
||||
} catch(e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue