dba_tcadb.phpt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --TEST--
  2. DBA TCADB handler test
  3. --EXTENSIONS--
  4. dba
  5. --SKIPIF--
  6. <?php
  7. $handler = 'tcadb';
  8. require_once __DIR__ .'/skipif.inc';
  9. ?>
  10. --FILE--
  11. <?php
  12. $handler = 'tcadb';
  13. $lock_flag = 'l';
  14. $db_filename = $db_file = __DIR__ .'/test0.tch';
  15. @unlink($db_filename);
  16. @unlink($db_filename.'.lck');
  17. require_once __DIR__ .'/dba_handler.inc';
  18. ?>
  19. --CLEAN--
  20. <?php
  21. $db_filename = $db_file = __DIR__ .'/test0.tch';
  22. @unlink($db_filename);
  23. @unlink($db_filename.'.lck');
  24. ?>
  25. --EXPECT--
  26. database handler: tcadb
  27. 3NYNYY
  28. Content String 2
  29. Content 2 replaced
  30. Read during write: not allowed
  31. "key number 6" written
  32. Failed to write "key number 6" 2nd time
  33. Content 2 replaced 2nd time
  34. The 6th value
  35. array(3) {
  36. ["key number 6"]=>
  37. string(13) "The 6th value"
  38. ["key2"]=>
  39. string(27) "Content 2 replaced 2nd time"
  40. ["key5"]=>
  41. string(23) "The last content string"
  42. }
  43. --NO-LOCK--
  44. 3NYNYY
  45. Content String 2
  46. Content 2 replaced
  47. Read during write: not allowed
  48. "key number 6" written
  49. Failed to write "key number 6" 2nd time
  50. Content 2 replaced 2nd time
  51. The 6th value
  52. array(3) {
  53. ["key number 6"]=>
  54. string(13) "The 6th value"
  55. ["key2"]=>
  56. string(27) "Content 2 replaced 2nd time"
  57. ["key5"]=>
  58. string(23) "The last content string"
  59. }