Ejemplo n.º 1
0
$plot->SetPlotAreaWorld(NULL, 0, NULL, 10);
$plot->SetPrintImage(False);
# StartStream does no output, only headers (which we cannot catch using the
# CLI), so just check the variables it sets:
$plot->StartStream();
$boundary = $plot->GET_stream_boundary();
# Check: Stream frame header includes content-type with expected MIME type
$sfh = $plot->GET_stream_frame_header();
if (!preg_match("Content-Type: {$mime_type}", $sfh)) {
    fwrite(STDERR, "Error: Did not match Content type in header:\n{$sfh}\n");
    $errors++;
}
$plot->SetDataValues($data1);
$plot->DrawGraph();
ob_start();
$plot->PrintImageFrame();
$frame1 = ob_get_clean();
$plot->SetDataValues($data2);
$plot->DrawGraph();
ob_start();
$plot->PrintImageFrame();
$frame2 = ob_get_clean();
if (!check_frame($frame1, $boundary) || !check_frame($frame2, $boundary)) {
    # This is kind of useless for debugging, but the frame isn't text so
    # we can't just print it...
    fwrite(STDERR, "Error: Frame(s) did not match expected pattern\n");
    $errors++;
}
ob_start();
$plot->EndStream();
$eof = ob_get_clean();