xref: /PHP-8.3/ext/oci8/tests/error_set.phpt (revision a53e5617)
1--TEST--
2Check oci_set_{action,client_identifier,module_name,client_info} error handling
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8?>
9--FILE--
10<?php
11
12require __DIR__.'/connect.inc';
13
14error_reporting(E_ALL);
15ini_set('display_errors', 'Off');
16
17echo "Test 1\n";
18
19// Generates "ORA-24960: the attribute OCI_ATTR_* is greater than the maximum allowable length of 64"
20$s = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
21
22$r = oci_set_action($c, $s);
23var_dump($r);
24$m = oci_error($c);
25echo $m['code'] , "\n";
26
27$r = oci_set_client_identifier($c, $s);
28var_dump($r);
29$m = oci_error($c);
30echo $m['code'] , "\n";
31
32$r = oci_set_module_name($c, $s);
33var_dump($r);
34$m = oci_error($c);
35echo $m['code'] , "\n";
36
37$r = oci_set_client_info($c, $s);
38var_dump($r);
39$m = oci_error($c);
40echo $m['code'] , "\n";
41
42echo "\nTest 2\n";
43$s = "x";
44
45$r = oci_set_action($c, $s);
46var_dump($r);
47
48$r = oci_set_client_identifier($c, $s);
49var_dump($r);
50
51$r = oci_set_module_name($c, $s);
52var_dump($r);
53
54$r = oci_set_client_info($c, $s);
55var_dump($r);
56
57?>
58--EXPECT--
59Test 1
60bool(false)
6124960
62bool(false)
6324960
64bool(false)
6524960
66bool(false)
6724960
68
69Test 2
70bool(true)
71bool(true)
72bool(true)
73bool(true)
74