Annotation of embedaddon/php/ext/dba/tests/dba_handlers.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: DBA Handler Test
        !             3: --SKIPIF--
        !             4: <?php 
        !             5: $handler="flatfile";
        !             6: require(dirname(__FILE__) .'/skipif.inc');
        !             7: die("info $HND handler used");
        !             8: ?>
        !             9: --FILE--
        !            10: <?php
        !            11: $handler="flatfile";
        !            12: require_once(dirname(__FILE__) .'/test.inc');
        !            13: echo "database handler: $handler\n";
        !            14: 
        !            15: function check($h)
        !            16: {
        !            17:     if (!$h) {
        !            18:         return;
        !            19:     }
        !            20: 
        !            21:     foreach ($h as $key) {
        !            22:         if ($key === "flatfile") {
        !            23:             echo "Success: flatfile enabled\n";
        !            24:         }
        !            25:     }
        !            26: }
        !            27: 
        !            28: echo "Test 1\n";
        !            29: 
        !            30: check(dba_handlers());
        !            31: 
        !            32: echo "Test 2\n";
        !            33: 
        !            34: check(dba_handlers(null));
        !            35: 
        !            36: echo "Test 3\n";
        !            37: 
        !            38: check(dba_handlers(1, 2));
        !            39: 
        !            40: echo "Test 4\n";
        !            41: 
        !            42: check(dba_handlers(0));
        !            43: 
        !            44: echo "Test 5 - full info\n";
        !            45: $h = dba_handlers(1);
        !            46: foreach ($h as $key => $val) {
        !            47:     if ($key === "flatfile") {
        !            48:         echo "Success: flatfile enabled\n";
        !            49:     }
        !            50: }
        !            51: 
        !            52: ?>
        !            53: --CLEAN--
        !            54: <?php 
        !            55: require(dirname(__FILE__) .'/clean.inc'); 
        !            56: ?>
        !            57: --EXPECTF--
        !            58: database handler: flatfile
        !            59: Test 1
        !            60: Success: flatfile enabled
        !            61: Test 2
        !            62: Success: flatfile enabled
        !            63: Test 3
        !            64: 
        !            65: Warning: dba_handlers() expects at most 1 parameter, 2 given in %sdba_handlers.php on line %d
        !            66: Test 4
        !            67: Success: flatfile enabled
        !            68: Test 5 - full info
        !            69: Success: flatfile enabled

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