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/conn_attr_4.phpt ('Set and get of connection attributes with errors.')

Script

1: <?php
2:
3: $testuser     
'testuser_attr_4';  // Used in conn_attr.inc
4:
$testpassword 'testuser'
5:
6: require(
dirname(__FILE__)."/conn_attr.inc");
7:
8:
$attr_array = array('MODULE','ACTION','CLIENT_INFO','CLIENT_IDENTIFIER');
9:
10: echo
"**Test  Negative cases************\n";
11:
12: echo 
"\nInvalid Connection resource\n";
13:
$nc1=NULL;
14:
// Invalid connection handle.
15:
var_dump(oci_set_action($nc1,$nc1));
16:
17:
// Variable instead of a connection resource.
18:
echo "\nInvalid Connection resource 2\n";
19:
$str1'not a conn';
20:
var_dump(oci_set_client_info($str1,$str1));
21:
22:
// Setting an Invalid value.
23:
echo "\nInvalid Value \n";
24:
$c1=oci_connect($testuser,$testpassword,$dbase);
25:
var_dump(oci_set_action($c1,$c1));
26:
27:
// Setting values multiple times.
28:
echo "\nSet Values multiple times \n";
29:
var_dump(oci_set_action($c1,'ACTION1'));
30:
var_dump(oci_set_action($c1,'ACTION1'));
31:
var_dump(oci_set_action($c1,'ACTION2'));
32:
var_dump(oci_set_action($c1,'ACTION1'));
33:
get_attr($c1,'ACTION');
34:
35:
// Testing with different types of values
36: // NB.  This may diff in 11.1.0.6 due to a bug causing CLIENT_INFO of NULL to be ignored.
37:
echo "\nSetting to different values \n";
38:
$values_array = array(1000,NULL,'this is a very huge string with a length  > 64 !!!!!this is a very huge string with a length  > 64 !!!!!this is a very huge string with a length  > 64 !!!!!this is a very huge string with a length  > 64 !!!!!');
39:
40: foreach(
$values_array as $val ) {
41:     
oci_set_module_name($c1,$val);
42:     
oci_set_client_identifier($c1,$val);
43:     
oci_set_client_info($c1,$val);
44:     
$r oci_set_action($c1,$val);    
45:     if (
$r) {
46:         echo 
"Values set successfully to $val\n";
47:         foreach(
$attr_array as $attr) {
48:             
get_attr($c1,$attr);
49:         }
50:     }
51: }
52:
53:
clean_up($c);
54: echo 
"Done\n";
55:
?>
56:

Expected

**Test  Negative cases************

Invalid Connection resource

Warning: oci_set_action() expects parameter 1 to be resource, null given in %s on line %d
NULL

Invalid Connection resource 2

Warning: oci_set_client_info() expects parameter 1 to be resource, %s given in %s on line %d
NULL

Invalid Value 

Warning: oci_set_action() expects parameter 2 to be %s, resource given in %s on line %d
NULL

Set Values multiple times 
bool(true)
bool(true)
bool(true)
bool(true)
The value of ACTION is ACTION1

Setting to different values 
Values set successfully to 1000
The value of MODULE is 1000
The value of ACTION is 1000
The value of CLIENT_INFO is 1000
The value of CLIENT_IDENTIFIER is 1000
Values set successfully to 
The value of MODULE is 
The value of ACTION is 
The value of CLIENT_INFO is 
The value of CLIENT_IDENTIFIER is 

Warning: oci_set_module_name(): ORA-24960: %s OCI_ATTR_MODULE %s on line %d

Warning: oci_set_client_identifier(): ORA-24960: %s OCI_ATTR_CLIENT_IDENTIFIER %s on line %d

Warning: oci_set_client_info(): ORA-24960: %s OCI_ATTR_CLIENT_INFO %s on line %d

Warning: oci_set_action(): ORA-24960: %s OCI_ATTR_ACTION %s on line %d
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:18:57
  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  Negative cases************
003- Invalid Connection resource
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:18:57
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
005- Warning: oci_set_action() expects parameter 1 to be resource, null given in %s on line %d
006- NULL
007- 
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
008- Invalid Connection resource 2
009- 
010- Warning: oci_set_client_info() expects parameter 1 to be resource, %s given in %s on line %d
011- NULL
012- 
013- Invalid Value 
014- 
015- Warning: oci_set_action() expects parameter 2 to be %s, resource given in %s on line %d
016- NULL
017- 
018- Set Values multiple times 
019- bool(true)
020- bool(true)
021- bool(true)
022- bool(true)
023- The value of ACTION is ACTION1
024- 
025- Setting to different values 
026- Values set successfully to 1000
027- The value of MODULE is 1000
028- The value of ACTION is 1000
029- The value of CLIENT_INFO is 1000
030- The value of CLIENT_IDENTIFIER is 1000
031- Values set successfully to 
032- The value of MODULE is 
033- The value of ACTION is 
034- The value of CLIENT_INFO is 
035- The value of CLIENT_IDENTIFIER is 
036- 
037- Warning: oci_set_module_name(): ORA-24960: %s OCI_ATTR_MODULE %s on line %d
038- 
039- Warning: oci_set_client_identifier(): ORA-24960: %s OCI_ATTR_CLIENT_IDENTIFIER %s on line %d
040- 
041- Warning: oci_set_client_info(): ORA-24960: %s OCI_ATTR_CLIENT_INFO %s on line %d
042- 
043- Warning: oci_set_action(): ORA-24960: %s OCI_ATTR_ACTION %s on line %d
044- Done

 

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

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