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(
__DIR__."/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

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

Invalid Connection resource

Fatal error: Uncaught TypeError: oci_set_action() expects parameter 1 to be resource, null given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/conn_attr_4.php:15
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/oci8/tests/conn_attr_4.php(15): oci_set_action(NULL, NULL)
#1 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/oci8/tests/conn_attr_4.php on line 15

Diff

005+ Fatal error: Uncaught TypeError: oci_set_action() expects parameter 1 to be resource, null given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/conn_attr_4.php:15
006+ Stack trace:
007+ #0 /var/php_gcov/PHP_HEAD/ext/oci8/tests/conn_attr_4.php(15): oci_set_action(NULL, NULL)
008+ #1 {main}
009+   thrown in /var/php_gcov/PHP_HEAD/ext/oci8/tests/conn_attr_4.php on line 15
005- Warning: oci_set_action() expects parameter 1 to be resource, null given in %s on line %d
006- NULL
007- 
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, 06 May 2019 17:58:35 +0000 (942 days ago)

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