Back to index

php5  5.3.10
client_round2.php
Go to the documentation of this file.
00001 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
00002 
00003 <html>
00004 <head>
00005        <title>Round 2 Interop Client Tests</title>
00006 </head>
00007 
00008 <body>
00009 <a href="index.php">Back to Interop Index</a><br>
00010 <p>&nbsp;</p>
00011 <?php
00012 require_once 'client_round2_interop.php';
00013 
00014 $iop = new Interop_Client();
00015 
00016 function endpointList($test,$sel_endpoint)
00017 {
00018     global $iop;
00019     $iop->getEndpoints($test);
00020     echo "<select name='endpoint'>\n";
00021     echo "<option value=''>-- All Endpoints --</option>\n";
00022     foreach ($iop->endpoints as $epname => $epinfo) {
00023         $selected = '';
00024         if ($sel_endpoint == $epname) $selected = ' SELECTED';
00025         echo "<option value='$epname'$selected>$epname</option>\n";
00026     }
00027     echo "</select>\n";
00028 }
00029 function methodList($test,$sel_method)
00030 {
00031     global $iop;
00032     global $soap_tests;
00033 
00034     echo "<select name='method'>\n";
00035     echo "<option value='ALL'>-- Run All Methods --</option>\n";
00036               $prev_method = "";
00037     foreach ($soap_tests[$test] as $x) {
00038         $method = $x->test_name;
00039         if ($method != $prev_method) {
00040               $prev_method = $method;
00041           $selected = '';
00042           if ($sel_method == $method) $selected = ' SELECTED';
00043           echo "<option value='$method'$selected>$method</option>\n";
00044         }
00045     }
00046     echo "</select>\n";
00047 }
00048 
00049 function endpointTestForm($test, $endpoint, $method, $paramType, $useWSDL)
00050 {
00051     global $PHP_SELF;
00052     if (!$test) $test = 'base';
00053     echo "Round 2 '$test' Selected<br>\n";
00054     echo "Select endpoint and method to run:<br>\n";
00055     echo "<form action='$PHP_SELF' method='post'>\n";
00056     echo "<input type='hidden' name='test' value='$test'>\n";
00057     endpointList($test, $endpoint);
00058     methodList($test, $method);
00059     echo "<select name='paramType'>";
00060 //    echo "<option value='all'>-- All --</option>";
00061     echo "<option value='soapval'".($paramType=='soapval'?' selected':'').">soap value</option>";
00062     echo "<option value='php'".($paramType=='php'?' selected':'').">php internal type</option></select>\n";
00063     echo "<select name='useWSDL'>";
00064 //    echo "<option value='all'>-- All --</option>";
00065     echo "<option value='0'>go Direct</option>";
00066     echo "<option value='1'".($useWSDL?' selected':'').">use WSDL</option></select>\n";
00067     echo "<input type='submit' value='Go'>\n";
00068     echo "</form><br>\n";
00069 }
00070 
00071 function testSelectForm($selected_test = NULL)
00072 {
00073     global $iop, $PHP_SELF;
00074     echo "Select a Round 2 test case to run:<br>\n";
00075     echo "<form action='$PHP_SELF' method='post'>\n";
00076     echo "<select name='test'>\n";
00077     foreach ($iop->tests as $test) {
00078         $selected = '';
00079         if ($selected_test == $test) $selected = ' SELECTED';
00080         echo "<option value='$test'$selected>$test</option>\n";
00081     }
00082     echo "</select>\n";
00083     echo "<input type='submit' value='Go'>\n";
00084     echo "</form><br>\n";
00085 }
00086 
00087 testSelectForm($_POST['test']);
00088 endpointTestForm($_POST['test'],$_POST['endpoint'],$_POST['method'],$_POST['paramType'],$_POST['useWSDL']);
00089 
00090 if ($_POST['test'] && array_key_exists('endpoint', $_POST) && array_key_exists('method', $_POST)) {
00091     // here we execute the orders
00092     echo "<h2>Calling {$_POST['method']} at {$_POST['endpoint']}</h2>\n";
00093     echo "NOTE: wire's are slightly modified to display better in web browsers.<br>\n";
00094 
00095     $iop->currentTest = $_POST['test'];      // see $tests above
00096     $iop->paramType = $_POST['paramType'];     // 'php' or 'soapval'
00097     $iop->useWSDL = $_POST['useWSDL'];           // 1= do wsdl tests
00098     $iop->numServers = 0;        // 0 = all
00099     $iop->specificEndpoint = $_POST['endpoint']; // test only this endpoint
00100     $iop->testMethod = $_POST['method']=='ALL'?'':$_POST['method'];       // test only this method
00101     $iop->skipEndpointList = array(); // endpoints to skip
00102     $iop->nosave = 0; // 1= disable saving results to database
00103     // debug output
00104     $iop->show = 0;
00105     $iop->debug = 0;
00106     $iop->showFaults = 0; // used in result table output
00107     echo '<pre>';
00108     $iop->doTest();  // run a single set of tests using above options
00109     echo '</pre>';
00110 }
00111 ?>
00112 </body>
00113 </html>