Annotation of embedaddon/php/ext/oci8/tests/conn_attr_3.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Set and get of connection attributes with oci_close().
                      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 oci_close() ************\n";
                     22: // With oci_connect ,oci_pconnect ,oci_new_connect
                     23: 
                     24: var_dump($conn1 = get_conn(1)); //oci_connect()
                     25: set_attr($conn1,'ACTION',1);
                     26: get_attr($conn1,'ACTION');
                     27: oci_close($conn1);
                     28: 
                     29: // Open another connect and verify the value.
                     30: var_dump($conn1 = get_conn(1)); //oci_connect()
                     31: get_attr($conn1,'ACTION');
                     32: oci_close($conn1);
                     33: 
                     34: var_dump($pconn1 = get_conn(2)); //oci_pconnect()
                     35: set_attr($pconn1,'MODULE',2);
                     36: get_attr($pconn1,'MODULE');
                     37: oci_close($pconn1);
                     38: 
                     39: // Open another connect and verify the value.
                     40: var_dump($pconn1 = get_conn(2)); //oci_pconnect()
                     41: get_attr($pconn1,'MODULE');
                     42: oci_close($pconn1);
                     43: 
                     44: var_dump($nconn1 = get_conn(3)); //oci_new_connect()
                     45: set_attr($nconn1,'CLIENT_INFO',3);
                     46: set_attr($nconn1,'CLIENT_IDENTIFIER',3);
                     47: get_attr($nconn1,'CLIENT_INFO');
                     48: get_attr($nconn1,'CLIENT_IDENTIFIER');
                     49: oci_close($nconn1);
                     50: 
                     51: // Open another connect and verify the value.
                     52: var_dump($nconn1 = get_conn(3)); //oci_new_connect()
                     53: get_attr($nconn1,'CLIENT_INFO');
                     54: get_attr($nconn1,'CLIENT_IDENTIFIER');
                     55: oci_close($nconn1);
                     56: 
                     57: clean_up($c);
                     58: echo "Done\n";
                     59: 
                     60: ?>
                     61: --EXPECTF--
                     62: **Test Set and get values for  the attributes with oci_close() ************
                     63: Testing with oci_connect()
                     64: resource(%d) of type (oci8 connection)
                     65: Value of ACTION has been set successfully
                     66: The value of ACTION is TASK1
                     67: Testing with oci_connect()
                     68: resource(%d) of type (oci8 connection)
                     69: The value of ACTION is 
                     70: Testing with oci_pconnect()
                     71: resource(%d) of type (oci8 persistent connection)
                     72: Value of MODULE has been set successfully
                     73: The value of MODULE is PHP TEST2
                     74: Testing with oci_pconnect()
                     75: resource(%d) of type (oci8 persistent connection)
                     76: The value of MODULE is PHP TEST2
                     77: Testing with oci_new_connect()
                     78: resource(%d) of type (oci8 connection)
                     79: Value of CLIENT_INFO has been set successfully
                     80: Value of CLIENT_IDENTIFIER has been set successfully
                     81: The value of CLIENT_INFO is INFO13
                     82: The value of CLIENT_IDENTIFIER is ID003
                     83: Testing with oci_new_connect()
                     84: resource(%d) of type (oci8 connection)
                     85: The value of CLIENT_INFO is 
                     86: The value of CLIENT_IDENTIFIER is 
                     87: Done

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