1--TEST-- 2Set and get of connection attributes with all types of connections. 3--EXTENSIONS-- 4oci8 5--SKIPIF-- 6<?php 7if (getenv('SKIP_REPEAT')) die('skip fails with repeat'); 8require_once 'skipifconnectfailure.inc'; 9$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs 10require __DIR__.'/skipif.inc'; 11 12if (strcasecmp($user, "system") && strcasecmp($user, "sys")) 13 die("skip needs to be run as a DBA user"); 14if ($test_drcp) die("skip output might vary with DRCP"); 15 16preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); 17if (!(isset($matches[0]) && $matches[1] >= 10)) { 18 die("skip expected output only valid when using Oracle 10g or greater database server"); 19} 20?> 21--FILE-- 22<?php 23 24$testuser = 'testuser_attr_1'; // Used in conn_attr.inc 25$testpassword = 'testuser'; 26 27require __DIR__."/conn_attr.inc"; 28 29$attr_array = array('MODULE','ACTION','CLIENT_INFO','CLIENT_IDENTIFIER'); 30 31echo"**Test 1.1 - Default values for the attributes **************\n"; 32$c = get_conn(1); 33foreach($attr_array as $attr) { 34 get_attr($c,$attr); 35} 36 37echo"**Test 1.2 - Set and get values for the attributes **************\n"; 38 39// With oci_connect, oci_pconnect, oci_new_connect 40 41$conn1 = get_conn(1); //oci_connect() 42foreach($attr_array as $attr) { 43 set_attr($conn1,$attr,1); 44 get_attr($conn1,$attr); 45} 46 47$conn2 = get_conn(2); //oci_pconnect() 48foreach($attr_array as $attr) { 49 set_attr($conn2,$attr,2); 50 get_attr($conn2,$attr); 51} 52 53$conn3 = get_conn(3); //oci_new_connect() 54foreach($attr_array as $attr) { 55 set_attr($conn3,$attr,3); 56 get_attr($conn3,$attr); 57} 58 59// clean up 60oci_close($conn1); 61oci_close($conn2); 62oci_close($conn3); 63clean_up($c); 64 65echo "Done\n"; 66 67?> 68--EXPECTF-- 69**Test 1.1 - Default values for the attributes ************** 70Testing with oci_connect() 71The value of MODULE is %s 72The value of ACTION is 73The value of CLIENT_INFO is 74The value of CLIENT_IDENTIFIER is 75**Test 1.2 - Set and get values for the attributes ************** 76Testing with oci_connect() 77Value of MODULE has been set successfully 78The value of MODULE is PHP TEST1 79Value of ACTION has been set successfully 80The value of ACTION is TASK1 81Value of CLIENT_INFO has been set successfully 82The value of CLIENT_INFO is INFO11 83Value of CLIENT_IDENTIFIER has been set successfully 84The value of CLIENT_IDENTIFIER is ID001 85Testing with oci_pconnect() 86Value of MODULE has been set successfully 87The value of MODULE is PHP TEST2 88Value of ACTION has been set successfully 89The value of ACTION is TASK2 90Value of CLIENT_INFO has been set successfully 91The value of CLIENT_INFO is INFO12 92Value of CLIENT_IDENTIFIER has been set successfully 93The value of CLIENT_IDENTIFIER is ID002 94Testing with oci_new_connect() 95Value of MODULE has been set successfully 96The value of MODULE is PHP TEST3 97Value of ACTION has been set successfully 98The value of ACTION is TASK3 99Value of CLIENT_INFO has been set successfully 100The value of CLIENT_INFO is INFO13 101Value of CLIENT_IDENTIFIER has been set successfully 102The value of CLIENT_IDENTIFIER is ID003 103Done 104