-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
46 lines (36 loc) · 1.43 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
require 'vendor/autoload.php';
use ToolkitTester\TestableConditions;
use ToolkitTester\TestableCondition;
use ToolkitApi\CW;
$conditionsObj = new TestableConditions();
$conditions = $conditionsObj->getConditions();
echo '<style type="text/css"> .success{background-color:green; color:white;} .failure{background-color:red; color:black;}</style>';
foreach ($conditions as $condition)
{
echo "<b>-------Begin Test-------</b><br>";
echo "Version: ".$condition->getVersion()->getVersion()."<br>";
echo "Source: ".$condition->getSource()->getSource()."<br>";
echo "Transport type: ".$condition->getTransportType()->getTransportType()."<br>";
echo runtest($condition)."<br>";
echo "<b>-------End Test-------</b><br>";
echo "<br><br>";
}
/**
* @param TestableCondition $condition
* @return mixed
*/
function runTest(TestableCondition $condition)
{
// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, "http://10.0.6.2:10088/ToolkitTester/test.php?version=" . $condition->getVersion()->getVersion() . "&source=" . $condition->getSource()->getSource(). "&transportType=".$condition->getTransportType()->getTransportType());
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);
return $output;
}