Example #1
0
                $files = $this->GetFiles();
                break;
            case 2:
                $files = $this->GetCSIMFiles();
                break;
            default:
                die('Panic: Unknown type of test');
                break;
        }
        $n = count($files);
        echo "<h2>Visual test suit for JpGraph</h2>";
        echo "Testtype: " . ($this->iType == 1 ? ' Standard images ' : ' Image map tests ');
        echo "<br>Number of tests: {$n}<p>";
        echo "<ol>";
        for ($i = 0; $i < $n; ++$i) {
            if ($this->iType == 1) {
                echo '<li><a href="show-example.php?target=' . urlencode($files[$i]) . '"><img src="' . $files[$i] . '" border=0 align=top></a><br><strong>Filename:</strong> <i>' . basename($files[$i]) . "</i>\n";
            } else {
                echo '<li><a href="show-example.php?target=' . urlencode($files[$i]) . '">' . $files[$i] . "</a>\n";
            }
        }
        echo "</ol>";
        echo "<p>Done.</p>";
    }
}
$type = @$HTTP_GET_VARS['t'];
if (empty($type)) {
    $type = 1;
}
$driver = new TestDriver($type);
$driver->Run();
Example #2
0
{
    echo "<!-- {$type} :  {$msg} -->\n";
}
// Include composer autoload
include_once "../../../../../vendor/autoload.php";
class TestDriver
{
    // include trait XCache Driver to allow method be called withour starting '_'
    use XCacheDriver;
    // Define yuor method with '_' to be available to xcache
    public function _currentTime()
    {
        return date('Y-m-d H:i:s');
    }
    public function _testOne($param = '')
    {
        return "Param={$param} , date=" . $this->currentTime();
    }
}
$test = new TestDriver();
echo HTMLCODE_HR;
echo "Cache started : " . $test->currentTime() . HTMLCODE_BR;
echo HTMLCODE_HR;
echo "TestOne (1): " . $test->testOne('Example') . HTMLCODE_BR;
echo HTMLCODE_HR;
echo "TestOne (2): " . $test->testOne(date('Y-m-d H:i')) . HTMLCODE_BR;
echo HTMLCODE_HR;
echo "TestOne (3): " . $test->testOne(date('Y-m-d H:i:s')) . HTMLCODE_BR;
echo HTMLCODE_HR;
echo "CurrentTime (nocache): " . $test->_currentTime() . HTMLCODE_BR;
echo HTMLCODE_HR;