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

1.1       misho       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: 
                     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: %s
                     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: }

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