dba007.phpt 1.3 KB

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