@@ -15,7 +15,7 @@ if (!(isset($matches[0]) &&
15
15
($ matches [1 ] >= 12 )
16
16
))) {
17
17
// Bug fixed in 11.2 prevents client_info being reset
18
- die ("skip expected output only valid when using Oracle 11gR2 or greater database server " );
18
+ die ("skip expected output only valid when using Oracle 11gR2 or greater database server " );
19
19
}
20
20
?>
21
21
--FILE--
@@ -30,20 +30,32 @@ $attr_array = array('MODULE','ACTION','CLIENT_INFO','CLIENT_IDENTIFIER');
30
30
31
31
echo "**Test Negative cases************ \n" ;
32
32
33
- echo "\nInvalid Connection resource \n" ;
33
+ echo "\nInvalid Connection resource 1 \n" ;
34
34
$ nc1 =NULL ;
35
35
// Invalid connection handle.
36
- var_dump (oci_set_action ($ nc1 ,$ nc1 ));
36
+ try {
37
+ oci_set_action ($ nc1 ,$ nc1 );
38
+ } catch (TypeError $ e ) {
39
+ var_dump ($ e ->getMessage ());
40
+ }
37
41
38
42
// Variable instead of a connection resource.
39
43
echo "\nInvalid Connection resource 2 \n" ;
40
44
$ str1 = 'not a conn ' ;
41
- var_dump (oci_set_client_info ($ str1 ,$ str1 ));
45
+ try {
46
+ oci_set_client_info ($ str1 ,$ str1 );
47
+ } catch (TypeError $ e ) {
48
+ var_dump ($ e ->getMessage ());
49
+ }
42
50
43
51
// Setting an Invalid value.
44
- echo "\nInvalid Value \n" ;
52
+ echo "\nInvalid Action value \n" ;
45
53
$ c1 =oci_connect ($ testuser ,$ testpassword ,$ dbase );
46
- var_dump (oci_set_action ($ c1 ,$ c1 ));
54
+ try {
55
+ oci_set_action ($ c1 ,$ c1 );
56
+ } catch (TypeError $ e ) {
57
+ var_dump ($ e ->getMessage ());
58
+ }
47
59
48
60
// Setting values multiple times.
49
61
echo "\nSet Values multiple times \n" ;
@@ -77,39 +89,33 @@ echo "Done\n";
77
89
--EXPECTF--
78
90
**Test Negative cases************
79
91
80
- Invalid Connection resource
81
-
82
- Warning: oci_set_action(): Argument #1 must be of type resource, null given in %s on line %d
83
- NULL
92
+ Invalid Connection resource 1
93
+ string(89) "oci_set_action(): Argument #1 ($connection_resource) must be of type resource, null given"
84
94
85
95
Invalid Connection resource 2
96
+ string(96) "oci_set_client_info(): Argument #1 ($connection_resource) must be of type resource, string given"
86
97
87
- Warning: oci_set_client_info(): Argument #1 must be of type resource, %s given in %s on line %d
88
- NULL
89
-
90
- Invalid Value
91
-
92
- Warning: oci_set_action(): Argument #2 must be of type %s, resource given in %s on line %d
93
- NULL
98
+ Invalid Action value
99
+ string(78) "oci_set_action(): Argument #2 ($action) must be of type string, resource given"
94
100
95
- Set Values multiple times
101
+ Set Values multiple times
96
102
bool(true)
97
103
bool(true)
98
104
bool(true)
99
105
bool(true)
100
106
The value of ACTION is ACTION1
101
107
102
- Setting to different values
108
+ Setting to different values
103
109
Values set successfully to 1000
104
110
The value of MODULE is 1000
105
111
The value of ACTION is 1000
106
112
The value of CLIENT_INFO is 1000
107
113
The value of CLIENT_IDENTIFIER is 1000
108
- Values set successfully to
109
- The value of MODULE is
110
- The value of ACTION is
111
- The value of CLIENT_INFO is
112
- The value of CLIENT_IDENTIFIER is
114
+ Values set successfully to
115
+ The value of MODULE is
116
+ The value of ACTION is
117
+ The value of CLIENT_INFO is
118
+ The value of CLIENT_IDENTIFIER is
113
119
114
120
Warning: oci_set_module_name(): ORA-24960: %s OCI_ATTR_MODULE %s on line %d
115
121
0 commit comments