Annotation of embedaddon/php/ext/oci8/tests/conn_attr_1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Set and get of connection attributes with all types of connections.
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded('oci8')) die("skip no oci8 extension");
! 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"))
! 9: die("skip needs to be run as a DBA user");
! 10: if ($test_drcp) die("skip output might vary with DRCP");
! 11:
! 12: if (preg_match('/Release 1[01]\./', oci_server_version($c), $matches) !== 1) {
! 13: die("skip expected output only valid when using Oracle 10g or greater database server");
! 14: } else if (preg_match('/^1[01]\./', oci_client_version()) != 1) {
! 15: die("skip test expected to work only with Oracle 10g or greater version of client");
! 16: }
! 17:
! 18: ?>
! 19: --FILE--
! 20: <?php
! 21: require(dirname(__FILE__)."/conn_attr.inc");
! 22:
! 23: $attr_array = array('MODULE','ACTION','CLIENT_INFO','CLIENT_IDENTIFIER');
! 24:
! 25: echo"**Test 1.1 - Default values for the attributes **************\n";
! 26: $c = get_conn(1);
! 27: foreach($attr_array as $attr) {
! 28: get_attr($c,$attr);
! 29: }
! 30:
! 31: echo"**Test 1.2 - Set and get values for the attributes **************\n";
! 32:
! 33: // With oci_connect, oci_pconnect, oci_new_connect
! 34:
! 35: $conn1 = get_conn(1); //oci_connect()
! 36: foreach($attr_array as $attr) {
! 37: set_attr($conn1,$attr,1);
! 38: get_attr($conn1,$attr);
! 39: }
! 40:
! 41: $conn2 = get_conn(2); //oci_pconnect()
! 42: foreach($attr_array as $attr) {
! 43: set_attr($conn2,$attr,2);
! 44: get_attr($conn2,$attr);
! 45: }
! 46:
! 47: $conn3 = get_conn(3); //oci_new_connect()
! 48: foreach($attr_array as $attr) {
! 49: set_attr($conn3,$attr,3);
! 50: get_attr($conn3,$attr);
! 51: }
! 52:
! 53: // clean up
! 54: oci_close($conn1);
! 55: oci_close($conn2);
! 56: oci_close($conn3);
! 57: clean_up($c);
! 58:
! 59: echo "Done\n";
! 60:
! 61: ?>
! 62: --EXPECTF--
! 63: **Test 1.1 - Default values for the attributes **************
! 64: Testing with oci_connect()
! 65: The value of MODULE is %s
! 66: The value of ACTION is
! 67: The value of CLIENT_INFO is
! 68: The value of CLIENT_IDENTIFIER is
! 69: **Test 1.2 - Set and get values for the attributes **************
! 70: Testing with oci_connect()
! 71: Value of MODULE has been set successfully
! 72: The value of MODULE is PHP TEST1
! 73: Value of ACTION has been set successfully
! 74: The value of ACTION is TASK1
! 75: Value of CLIENT_INFO has been set successfully
! 76: The value of CLIENT_INFO is INFO11
! 77: Value of CLIENT_IDENTIFIER has been set successfully
! 78: The value of CLIENT_IDENTIFIER is ID001
! 79: Testing with oci_pconnect()
! 80: Value of MODULE has been set successfully
! 81: The value of MODULE is PHP TEST2
! 82: Value of ACTION has been set successfully
! 83: The value of ACTION is TASK2
! 84: Value of CLIENT_INFO has been set successfully
! 85: The value of CLIENT_INFO is INFO12
! 86: Value of CLIENT_IDENTIFIER has been set successfully
! 87: The value of CLIENT_IDENTIFIER is ID002
! 88: Testing with oci_new_connect()
! 89: Value of MODULE has been set successfully
! 90: The value of MODULE is PHP TEST3
! 91: Value of ACTION has been set successfully
! 92: The value of ACTION is TASK3
! 93: Value of CLIENT_INFO has been set successfully
! 94: The value of CLIENT_INFO is INFO13
! 95: Value of CLIENT_IDENTIFIER has been set successfully
! 96: The value of CLIENT_IDENTIFIER is ID003
! 97: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>