dba_db4_009.phpt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --TEST--
  2. DBA DB4 Multiple File Creation Test
  3. --SKIPIF--
  4. <?php
  5. $handler = "db4";
  6. require_once(dirname(__FILE__) .'/skipif.inc');
  7. die("info $HND handler used");
  8. ?>
  9. --FILE--
  10. <?php
  11. $handler = "db4";
  12. require_once(dirname(__FILE__) .'/test.inc');
  13. echo "database handler: $handler\n";
  14. $db_file1 = $db_filename1 = dirname(__FILE__).'/test1.dbm';
  15. $db_file2 = $db_filename2 = dirname(__FILE__).'/test2.dbm';
  16. if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
  17. echo "database file created\n";
  18. } else {
  19. echo "$db_file does not exist\n";
  20. }
  21. if (($db_file1=dba_open($db_file1, "n", $handler))!==FALSE) {
  22. echo "database file created\n";
  23. } else {
  24. echo "$db_file does not exist\n";
  25. }
  26. if (($db_file2=dba_open($db_file2, "n", $handler))!==FALSE) {
  27. echo "database file created\n";
  28. } else {
  29. echo "$db_file does not exist\n";
  30. }
  31. var_dump(dba_list());
  32. dba_close($db_file);
  33. @unlink($db_filename1);
  34. @unlink($db_filename2);
  35. ?>
  36. --CLEAN--
  37. <?php
  38. require(dirname(__FILE__) .'/clean.inc');
  39. ?>
  40. --EXPECTF--
  41. database handler: db4
  42. database file created
  43. database file created
  44. database file created
  45. array(3) {
  46. [%d]=>
  47. string(%d) "%stest0.dbm"
  48. [%d]=>
  49. string(%d) "%stest1.dbm"
  50. [%d]=>
  51. string(%d) "%stest2.dbm"
  52. }