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