Annotation of embedaddon/php/ext/oci8/tests/conn_attr_5.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Set and get connection attributes with scope end.
        !             3: --SKIPIF--
        !             4: <?php
        !             5: $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
        !             6: require(dirname(__FILE__).'/skipif.inc');
        !             7: 
        !             8: if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user");
        !             9: if ($test_drcp) die("skip output might vary with DRCP");
        !            10: 
        !            11: if (preg_match('/Release 1[01]\./', oci_server_version($c), $matches) !== 1) {
        !            12:        die("skip expected output only valid when using Oracle 10g or greater database server");
        !            13: } else if (preg_match('/^1[01]\./', oci_client_version()) != 1) {
        !            14:     die("skip test expected to work only with Oracle 10g or greater version of client");
        !            15: }
        !            16: ?>
        !            17: --FILE--
        !            18: <?php
        !            19: require(dirname(__FILE__)."/conn_attr.inc");
        !            20: 
        !            21: echo"**Test - Set and get values for the attributes with scope end ************\n";
        !            22: 
        !            23: // Set the attributes in one scope and verify the values from another scope.
        !            24: set_scope();
        !            25: 
        !            26: echo "Get the Values from a different scope \n";
        !            27: get_scope();
        !            28: 
        !            29: function set_scope() {
        !            30:     $conn1 = get_conn(1);
        !            31:     set_attr($conn1,'CLIENT_INFO',50);
        !            32:     set_attr($conn1,'CLIENT_IDENTIFIER',50);
        !            33:     $conn2 = get_conn(3);
        !            34:     set_attr($conn2,'ACTION',50);
        !            35:     $conn3 = get_conn(2);
        !            36:     set_attr($conn3,'MODULE',50);
        !            37:     
        !            38: }
        !            39: 
        !            40: function get_scope() {
        !            41:     $conn1 = get_conn(1);
        !            42:     get_attr($conn1,'CLIENT_INFO');
        !            43:     get_attr($conn1,'CLIENT_IDENTIFIER');
        !            44:     $conn2 = get_conn(3);
        !            45:     get_attr($conn2,'ACTION');
        !            46:     $conn3 = get_conn(2);
        !            47:     get_attr($conn3,'MODULE');
        !            48: }
        !            49: clean_up($c);
        !            50: echo "Done";
        !            51: ?>
        !            52: --EXPECTF--
        !            53: **Test - Set and get values for the attributes with scope end ************
        !            54: Testing with oci_connect()
        !            55: Value of CLIENT_INFO has been set successfully
        !            56: Value of CLIENT_IDENTIFIER has been set successfully
        !            57: Testing with oci_new_connect()
        !            58: Value of ACTION has been set successfully
        !            59: Testing with oci_pconnect()
        !            60: Value of MODULE has been set successfully
        !            61: Get the Values from a different scope 
        !            62: Testing with oci_connect()
        !            63: The value of CLIENT_INFO is 
        !            64: The value of CLIENT_IDENTIFIER is 
        !            65: Testing with oci_new_connect()
        !            66: The value of ACTION is 
        !            67: Testing with oci_pconnect()
        !            68: The value of MODULE is PHP TEST50
        !            69: Done

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