Annotation of embedaddon/php/ext/dba/tests/dba_sync.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: DBA Sync Test
! 3: --SKIPIF--
! 4: <?php
! 5: require_once dirname(__FILE__) .'/skipif.inc';
! 6: die("info $HND handler used");
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10: require_once(dirname(__FILE__) .'/test.inc');
! 11: echo "database handler: $handler\n";
! 12: if (($db_file=dba_open($db_filename, "n", $handler))!==FALSE) {
! 13: dba_insert("key1", "Content String 1", $db_file);
! 14: dba_insert("key2", "Content String 2", $db_file);
! 15: $a = dba_firstkey($db_file);
! 16: $i=0;
! 17: while($a) {
! 18: $a = dba_nextkey($db_file);
! 19: $i++;
! 20: }
! 21: echo $i;
! 22: for ($i=1; $i<3; $i++) {
! 23: echo dba_exists("key$i", $db_file) ? "Y" : "N";
! 24: }
! 25: echo "\n";
! 26: var_dump(dba_sync());
! 27: var_dump(dba_sync(""));
! 28: var_dump(dba_sync($db_file));
! 29: dba_close($db_file);
! 30: } else {
! 31: echo "Error creating database\n";
! 32: }
! 33:
! 34: ?>
! 35: ===DONE===
! 36: <?php exit(0); ?>
! 37: --CLEAN--
! 38: <?php
! 39: require(dirname(__FILE__) .'/clean.inc');
! 40: ?>
! 41: --EXPECTF--
! 42: database handler: flatfile
! 43: 2YY
! 44:
! 45: Warning: dba_sync() expects exactly 1 parameter, 0 given in %sdba_sync.php on line %d
! 46: NULL
! 47:
! 48: Warning: dba_sync() expects parameter 1 to be resource, string given in %sdba_sync.php on line %d
! 49: NULL
! 50: bool(true)
! 51: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>