13 require_once(dirname(__FILE__) .
'/../common-active.php');
23 protected function setUp() : void
34 $script_header =
"<script language='javascript'>\n<!--\n";
35 $script_foot =
"\n// -->\n</script>\n";
36 $html_expect =
"var test=null;\n";
38 $html_expect .=
"function test_Get(Url)\n";
39 $html_expect .=
"{\n";
40 $html_expect .=
"if (window.XMLHttpRequest)\n";
41 $html_expect .=
" {\n";
42 $html_expect .=
" test=new XMLHttpRequest();\n";
43 $html_expect .=
" }\n";
45 $html_expect .=
"else if (window.ActiveXObject)\n";
46 $html_expect .=
" {\n";
47 $html_expect .=
" test=new ActiveXObject('Microsoft.XMLHTTP');\n";
48 $html_expect .=
" }\n";
50 $html_expect .=
"if (test!=null)\n";
51 $html_expect .=
" {\n";
52 $html_expect .=
" test.onreadystatechange=test_Reply;\n";
58 $html_expect .=
" test.open('GET',Url,true);\n";
59 $html_expect .=
" test.send(null);\n";
60 $html_expect .=
" }\n";
61 $html_expect .=
"else\n";
62 $html_expect .=
" {\n";
63 $html_expect .=
" alert('Your browser does not support XMLHTTP.');\n";
64 $html_expect .=
" return;\n";
65 $html_expect .=
" }\n";
66 $html_expect .=
"}\n";
67 $html_expect_script = $script_header.$html_expect.$script_foot;
68 $this->assertEquals($html_expect_script, $html_result);
72 $this->assertEquals($html_expect, $html_result);
testActiveHTTPscript()
test for ActiveHTTPscript
ActiveHTTPscript($RequestName, $IncludeScriptTags=1)
Given a function name, create the JavaScript needed for doing the request.