Annotation of embedaddon/php/ext/pgsql/tests/22pg_fetch_object.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: PostgreSQL pg_fetch_object()
        !             3: --SKIPIF--
        !             4: <?php include("skipif.inc"); ?>
        !             5: --FILE--
        !             6: <?php
        !             7: error_reporting(E_ALL);
        !             8: 
        !             9: include 'config.inc';
        !            10: 
        !            11: class test_class {
        !            12:        function __construct($arg1, $arg2) {
        !            13:                echo __METHOD__ . "($arg1,$arg2)\n";
        !            14:        }
        !            15: }
        !            16: 
        !            17: $db = pg_connect($conn_str);
        !            18: 
        !            19: $sql = "SELECT * FROM $table_name WHERE num = 0";
        !            20: $result = pg_query($db, $sql) or die('Cannot qeury db');
        !            21: $rows = pg_num_rows($result);
        !            22: 
        !            23: var_dump(pg_fetch_object($result, NULL, 'test_class', array(1, 2)));
        !            24: 
        !            25: echo "Ok\n";
        !            26: ?>
        !            27: --EXPECT--
        !            28: test_class::__construct(1,2)
        !            29: object(test_class)#1 (3) {
        !            30:   ["num"]=>
        !            31:   string(1) "0"
        !            32:   ["str"]=>
        !            33:   string(3) "ABC"
        !            34:   ["bin"]=>
        !            35:   NULL
        !            36: }
        !            37: Ok

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