dba007.phpt 1.3 KB

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