Annotation of embedaddon/php/ext/dba/tests/dba_db4_018.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: DBA DB4 with persistent connections
                      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: 
                     12: $handler = "db4";
                     13: require_once(dirname(__FILE__) .'/test.inc');
                     14: echo "database handler: $handler\n";
                     15: 
                     16: echo "Test 1\n";
                     17: $db_file1 = dba_popen($db_filename, 'n', 'flatfile');
                     18: dba_insert("key1", "This is a test insert 1", $db_file1);
                     19: echo dba_fetch("key1", $db_file1), "\n";
                     20: 
                     21: 
                     22: echo "Test 2\n";
                     23: $db_file2 = dba_popen($db_filename, 'n', 'flatfile');
                     24: if ($db_file1 === $db_file2) {
                     25:     echo "resources are the same\n";
                     26: } else {
                     27:     echo "resources are different\n";
                     28: }
                     29: 
                     30: 
                     31: echo "Test 3 - fetch both rows from second resource\n";
                     32: dba_insert("key2", "This is a test insert 2", $db_file2);
                     33: echo dba_fetch("key1", $db_file2), "\n";
                     34: echo dba_fetch("key2", $db_file2), "\n";
                     35: 
                     36: 
                     37: echo "Test 4 - fetch both rows from first resource\n";
                     38: echo dba_fetch("key1", $db_file1), "\n";
                     39: echo dba_fetch("key2", $db_file1), "\n";
                     40: 
                     41: echo "Test 5 - close 2nd resource\n";
                     42: dba_close($db_file2);
                     43: var_dump($db_file1);
                     44: var_dump($db_file2);
                     45: 
                     46: echo "Test 6 - query after closing 2nd resource\n";
                     47: echo dba_fetch("key1", $db_file1), "\n";
                     48: echo dba_fetch("key2", $db_file1), "\n";
                     49: 
                     50: ?>
                     51: ===DONE===
                     52: --CLEAN--
                     53: <?php 
                     54:        require(dirname(__FILE__) .'/clean.inc'); 
                     55: ?>
                     56: --XFAIL--
                     57: Test 6 crashes with dba pointer of NULL, bug http://bugs.php.net/bug.php?id=51278
                     58: --EXPECTF--
                     59: database handler: db4
                     60: Test 1
                     61: This is a test insert 1
                     62: Test 2
                     63: resources are different
                     64: Test 3 - fetch both rows from second resource
                     65: This is a test insert 1
                     66: This is a test insert 2
                     67: Test 4 - fetch both rows from first resource
                     68: This is a test insert 1
                     69: This is a test insert 2
                     70: Test 5 - close 2nd resource
                     71: resource(%d) of type (dba persistent)
                     72: resource(%d) of type (Unknown)
                     73: Test 6 - query after closing 2nd resource
                     74: This is a test insert 1
                     75: This is a test insert 2
                     76: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>