File: rrd_015.phpt

package info (click to toggle)
php-rrd 2.0.3%2B1.1.3-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 496 kB
  • sloc: ansic: 2,447; xml: 665; makefile: 58; php: 3
file content (27 lines) | stat: -rw-r--r-- 640 bytes parent folder | download | duplicates (11)
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
--TEST--
rrd_restore test
--SKIPIF--
<?php include('skipif.inc');
include('data/definition.inc');
if (!file_exists($data_xmdDbdump)) {
	die("skip $data_xmdDbdump doesn't exist");
}
?>
--FILE--
<?php
include('data/definition.inc');
$xmlFile = $data_xmdDbdump;
$rrdFile = dirname(__FILE__) . "/restore-result.rrd";
//if rrd file isn't deleted, rrd_restore without options fails
@unlink($rrdFile);
var_dump(rrd_restore($xmlFile, $rrdFile));
var_dump(file_exists($rrdFile) && filesize($rrdFile));

//test "-f" options - force to overwrite
var_dump(rrd_restore($xmlFile, $rrdFile, array("-f")));
?>
--EXPECTF--
bool(true)
bool(true)
bool(true)