PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/oci8/tests/edition_2.phpt ('Set and check Oracle 11gR2 "edition" attribute')

Script

1: <?php
2:
3:
/* In 11.2, there can only be one child edition.  So this test will
4:  * fail to create the necessary editions if a child edition exists
5:  * already
6:  */
7:
8:
$testuser     'testuser_ed_2';  // Used in conn_attr.inc
9:
$testpassword 'testuser'
10:
11: require(
dirname(__FILE__)."/conn_attr.inc");
12:
13: echo
"**Test 1.1 - Default value for  the attribute **************\n";
14:
get_edit_attr($c);
15:
16: echo
"\n\n**Test 1.2 - Set a value and get the same with different connections *********\n";
17:
set_edit_attr('MYEDITION');
18:
19:
// With oci_connect, oci_pconnect, oci_new_connect
20:
$conn1 get_conn(1);
21:
get_edit_attr($conn1);
22:
23:
//pconnect
24:
$conn2 get_conn(2);
25:
get_edit_attr($conn2);
26:
27:
//new_connect
28:
$conn3 get_conn(3);
29:
get_edit_attr($conn3);
30:
31:
oci_close($conn1);
32:
33:
// With a oci_pconnect with a different charset.
34:
$pc1 oci_pconnect($testuser,$testpassword,$dbase,"utf8");
35:
get_edit_attr($pc1);
36:
oci_close($pc1);
37:
38:
39: echo
"\n\n**Test 1.3 change the value and verify with existing conenctions.*********\n";
40:
set_edit_attr('MYEDITION1');
41:
get_edit_attr($conn2);
42:
get_edit_attr($conn3); // Old value
43:
oci_close($conn2);
44:
oci_close($conn3);
45:
46:
//open a new connection and get the edition value . This will have the updated value.
47:
$c3 get_conn(3); //oci_new_connect()
48:
get_edit_attr($c3);
49:
50:
$c4 get_conn(2); //oci_pconnect()
51:
get_edit_attr($c4);
52:
53:
$c5 get_conn(1); //oci_connect()
54:
get_edit_attr($c5);
55:
56:
oci_close($c3);
57:
oci_close($c4);
58:
oci_close($c5);
59:
60: echo 
"\n\n**Test 1.4 - with different type of values *********\n";
61:
$values_array = array(123,NULL,'NO EDITION','edition name which has more than thirty chars!!!edition name which has more than thirty chars!!!');
62: foreach (
$values_array as $val ) {
63:     
set_edit_attr($val);
64:     
$c1 get_conn(1); //oci_connect()
65:     
if ($c1) {
66:         
get_edit_attr($c1);
67:         
oci_close($c1);
68:     }    
69: }
70:
71: echo 
"\n\n**Test 1.5 - Negative case with an invalid string value. *********\n";
72:
$c1 get_conn(3);
73:
$r set_edit_attr($c1);
74:
75: echo
"\n\n**Test 1.6 - Set Multiple times.*****\n";
76:
set_edit_attr('MYEDITION');
77:
set_edit_attr('MYEDITION1');
78:
$c1 get_conn(1);
79:
get_edit_attr($c1);
80:
oci_close($c1);
81:
82: echo 
"\n\n**Test 1.7 - Test with ALTER SESSION statement to change the edition *******\n";
83:
// Set the edition value to MYEDITION. open a conn .get the value.
84: // execute the alter system set edition ='MYEDITION' .get the value .
85: // set it back to MYEDITION using oci_set_edition. and get the value.
86:
87:
set_edit_attr('MYEDITION');
88:
$c1 get_conn(3);
89: echo 
"get the value set to MYEDITION with oci_set_edition \n";
90:
get_edit_attr($c1);
91:
92:
$alter_stmt "alter session set edition = MYEDITION1";
93:
$s oci_parse($c1,$alter_stmt);
94:
oci_execute($s);
95:
oci_commit($c1);
96: echo 
"Get the value set to MYEDITION1 with alter session\n";
97:
get_edit_attr($c1);
98:
99: echo 
" Get the value with a new connection \n";
100:
$c2 get_conn(1);
101:
get_edit_attr($c2);
102:
103: echo 
" Set the value back using oci-set_edition\n";
104:
set_edit_attr('MYEDITION');
105:
get_edit_attr($c2);
106:
107: echo 
" Get the value with a new conenction \n";
108:
$c3 get_conn(1);
109:
get_edit_attr($c3);
110:
111:
oci_close($c1);
112:
oci_close($c2);
113:
oci_close($c3);
114:
115:
116: echo 
"\n\n**Test 1.8 - Test setting the attribute with scope ends*******\n";
117:
set_scope();
118:
get_scope();
119:
120:
clean_up($c);
121: echo 
"Done\n";
122:
123:
124: function 
set_scope() {
125:     
$r set_edit_attr('MYEDITION1');
126: }
127:
128: function 
get_scope() {
129:     
$sc1 oci_connect($GLOBALS['testuser'],$GLOBALS['testpassword'],$GLOBALS['dbase']);
130:     if (
$sc1 === false) {
131:         
$m oci_error();
132:         die(
"Error:" $m['message']);
133:     }
134:     
get_edit_attr($sc1);
135:     
oci_close($sc1);
136: }
137:
?>
138:

Expected

**Test 1.1 - Default value for  the attribute **************
The value of current EDITION is ORA$BASE


**Test 1.2 - Set a value and get the same with different connections *********
 The value of edition has been successfully set
Testing with oci_connect()
The value of current EDITION is MYEDITION
Testing with oci_pconnect()
The value of current EDITION is MYEDITION
Testing with oci_new_connect()
The value of current EDITION is MYEDITION
The value of current EDITION is MYEDITION


**Test 1.3 change the value and verify with existing conenctions.*********
 The value of edition has been successfully set
The value of current EDITION is MYEDITION
The value of current EDITION is MYEDITION
Testing with oci_new_connect()
The value of current EDITION is MYEDITION1
Testing with oci_pconnect()
The value of current EDITION is MYEDITION1
Testing with oci_connect()
The value of current EDITION is MYEDITION1


**Test 1.4 - with different type of values *********
 The value of edition has been successfully set
Testing with oci_connect()

Warning: oci_connect(): ORA-38801: %s ORA_EDITION in %s on line %d
 The value of edition has been successfully set
Testing with oci_connect()
The value of current EDITION is ORA$BASE
 The value of edition has been successfully set
Testing with oci_connect()

Warning: oci_connect(): ORA-38801: %s ORA_EDITION in %s on line %d
 The value of edition has been successfully set
Testing with oci_connect()

Warning: oci_connect(): ORA-38801: %s ORA_EDITION in %s on line %d


**Test 1.5 - Negative case with an invalid string value. *********
Testing with oci_new_connect()

Warning: oci_new_connect(): ORA-38801: %s ORA_EDITION in %s on line %d
 The value of edition has been successfully set


**Test 1.6 - Set Multiple times.*****
 The value of edition has been successfully set
 The value of edition has been successfully set
Testing with oci_connect()
The value of current EDITION is MYEDITION1


**Test 1.7 - Test with ALTER SESSION statement to change the edition *******
 The value of edition has been successfully set
Testing with oci_new_connect()
get the value set to MYEDITION with oci_set_edition 
The value of current EDITION is MYEDITION
Get the value set to MYEDITION1 with alter session
The value of current EDITION is MYEDITION1
 Get the value with a new connection 
Testing with oci_connect()
The value of current EDITION is MYEDITION
 Set the value back using oci-set_edition
 The value of edition has been successfully set
The value of current EDITION is MYEDITION
 Get the value with a new conenction 
Testing with oci_connect()
The value of current EDITION is MYEDITION


**Test 1.8 - Test setting the attribute with scope ends*******
 The value of edition has been successfully set
The value of current EDITION is MYEDITION1
Done

Output

***********************************************************************
Fatal NI connect error 12541, connecting to:
 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))

  VERSION INFORMATION:
	TNS for Linux: Version 11.2.0.2.0 - Beta
	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
  Time: 17-JUN-2018 05:33:31
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12541
    TNS-12541: TNS:no listener
    ns secondary err code: 12560
    nt main err code: 511
    TNS-00511: No listener

Fatal error: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
    nt secondary err code: 111
    nt OS err code: 0

Diff

001+ ***********************************************************************
002+ Fatal NI connect error 12541, connecting to:
003+  (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
001- **Test 1.1 - Default value for  the attribute **************
002- The value of current EDITION is ORA$BASE
004- 
005- **Test 1.2 - Set a value and get the same with different connections *********
006-  The value of edition has been successfully set
007- Testing with oci_connect()
008- The value of current EDITION is MYEDITION
009- Testing with oci_pconnect()
010- The value of current EDITION is MYEDITION
011- Testing with oci_new_connect()
012- The value of current EDITION is MYEDITION
013- The value of current EDITION is MYEDITION
005+   VERSION INFORMATION:
006+ 	TNS for Linux: Version 11.2.0.2.0 - Beta
007+ 	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
008+   Time: 17-JUN-2018 05:33:31
009+   Tracing not turned on.
010+   Tns error struct:
011+     ns main err code: 12541
012+     TNS-12541: TNS:no listener
013+     ns secondary err code: 12560
014+     nt main err code: 511
015+     TNS-00511: No listener
015- 
016- **Test 1.3 change the value and verify with existing conenctions.*********
017-  The value of edition has been successfully set
017+ Fatal error: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
018+     nt secondary err code: 111
019+     nt OS err code: 0
018- The value of current EDITION is MYEDITION
019- The value of current EDITION is MYEDITION
020- Testing with oci_new_connect()
021- The value of current EDITION is MYEDITION1
022- Testing with oci_pconnect()
023- The value of current EDITION is MYEDITION1
024- Testing with oci_connect()
025- The value of current EDITION is MYEDITION1
026- 
027- 
028- **Test 1.4 - with different type of values *********
029-  The value of edition has been successfully set
030- Testing with oci_connect()
031- 
032- Warning: oci_connect(): ORA-38801: %s ORA_EDITION in %s on line %d
033-  The value of edition has been successfully set
034- Testing with oci_connect()
035- The value of current EDITION is ORA$BASE
036-  The value of edition has been successfully set
037- Testing with oci_connect()
038- 
039- Warning: oci_connect(): ORA-38801: %s ORA_EDITION in %s on line %d
040-  The value of edition has been successfully set
041- Testing with oci_connect()
042- 
043- Warning: oci_connect(): ORA-38801: %s ORA_EDITION in %s on line %d
044- 
045- 
046- **Test 1.5 - Negative case with an invalid string value. *********
047- Testing with oci_new_connect()
048- 
049- Warning: oci_new_connect(): ORA-38801: %s ORA_EDITION in %s on line %d
050-  The value of edition has been successfully set
051- 
052- 
053- **Test 1.6 - Set Multiple times.*****
054-  The value of edition has been successfully set
055-  The value of edition has been successfully set
056- Testing with oci_connect()
057- The value of current EDITION is MYEDITION1
058- 
059- 
060- **Test 1.7 - Test with ALTER SESSION statement to change the edition *******
061-  The value of edition has been successfully set
062- Testing with oci_new_connect()
063- get the value set to MYEDITION with oci_set_edition 
064- The value of current EDITION is MYEDITION
065- Get the value set to MYEDITION1 with alter session
066- The value of current EDITION is MYEDITION1
067-  Get the value with a new connection 
068- Testing with oci_connect()
069- The value of current EDITION is MYEDITION
070-  Set the value back using oci-set_edition
071-  The value of edition has been successfully set
072- The value of current EDITION is MYEDITION
073-  Get the value with a new conenction 
074- Testing with oci_connect()
075- The value of current EDITION is MYEDITION
076- 
077- 
078- **Test 1.8 - Test setting the attribute with scope ends*******
079-  The value of edition has been successfully set
080- The value of current EDITION is MYEDITION1
081- Done

 

Generated at Mon, 18 Jun 2018 17:33:50 +0000 (2 days ago)

Copyright © 2005-2018 The PHP Group
All rights reserved.