dba_db4_011.phpt 833 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. DBA DB4 with repeated key
  3. --EXTENSIONS--
  4. dba
  5. --SKIPIF--
  6. <?php
  7. $handler = "db4";
  8. require_once(__DIR__ .'/skipif.inc');
  9. die("info $HND handler used");
  10. ?>
  11. --FILE--
  12. <?php
  13. $handler = "db4";
  14. require_once(__DIR__ .'/test.inc');
  15. echo "database handler: $handler\n";
  16. if (($db_file=dba_open($db_filename, "c", $handler))!==FALSE) {
  17. var_dump(dba_insert("key1", "Content String 1", $db_file));
  18. var_dump(dba_insert("key2", "Content String 2", $db_file));
  19. var_dump(dba_insert("key2", "Same key", $db_file));
  20. echo dba_fetch("key1", $db_file), "\n";
  21. echo dba_fetch("key2", $db_file), "\n";
  22. dba_close($db_file);
  23. } else {
  24. echo "Error creating database\n";
  25. }
  26. ?>
  27. --CLEAN--
  28. <?php
  29. require(__DIR__ .'/clean.inc');
  30. ?>
  31. --EXPECT--
  32. database handler: db4
  33. bool(true)
  34. bool(true)
  35. bool(false)
  36. Content String 1
  37. Content String 2