dba003.phpt 718 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. DBA Insert/Replace/Fetch Test
  3. --EXTENSIONS--
  4. dba
  5. --SKIPIF--
  6. <?php
  7. require_once(__DIR__ .'/skipif.inc');
  8. die("info $HND handler used");
  9. ?>
  10. --FILE--
  11. <?php
  12. require_once(__DIR__ .'/test.inc');
  13. echo "database handler: $handler\n";
  14. if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
  15. dba_insert("key1", "This is a test insert", $db_file);
  16. dba_replace("key1", "This is the replacement text", $db_file);
  17. $a = dba_fetch("key1", $db_file);
  18. dba_close($db_file);
  19. echo $a;
  20. } else {
  21. echo "Error creating database\n";
  22. }
  23. ?>
  24. --CLEAN--
  25. <?php
  26. require(__DIR__ .'/clean.inc');
  27. ?>
  28. --EXPECTF--
  29. database handler: %s
  30. This is the replacement text