xref: /PHP-8.2/ext/oci8/tests/lob_028.phpt (revision b5a14e6c)
1--TEST--
2Test descriptor types for oci_new_descriptor()
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
8require(__DIR__.'/skipif.inc');
9?>
10--FILE--
11<?php
12
13require __DIR__.'/connect.inc';
14
15// Successful statements
16
17$d = oci_new_descriptor($c, OCI_D_FILE);
18var_dump($d);
19
20$d = oci_new_descriptor($c, OCI_DTYPE_FILE);
21var_dump($d);
22
23$d = oci_new_descriptor($c, OCI_D_LOB);
24var_dump($d);
25
26$d = oci_new_descriptor($c, OCI_DTYPE_LOB);
27var_dump($d);
28
29$d = oci_new_descriptor($c, OCI_D_ROWID);
30var_dump($d);
31
32$d = oci_new_descriptor($c, OCI_DTYPE_ROWID);
33var_dump($d);
34
35// Unsuccessful statements
36
37$d = oci_new_descriptor($c, OCI_B_CLOB);
38var_dump($d);
39
40$d = oci_new_descriptor($c, OCI_B_CLOB);
41var_dump($d);
42
43$d = oci_new_descriptor($c, OCI_DEFAULT);
44var_dump($d);
45
46$d = oci_new_descriptor($c, 1);
47var_dump($d);
48
49echo "Done\n";
50
51?>
52--EXPECTF--
53object(OCILob)#%d (1) {
54  ["descriptor"]=>
55  resource(%d) of type (oci8 descriptor)
56}
57object(OCILob)#%d (1) {
58  ["descriptor"]=>
59  resource(%d) of type (oci8 descriptor)
60}
61object(OCILob)#%d (1) {
62  ["descriptor"]=>
63  resource(%d) of type (oci8 descriptor)
64}
65object(OCILob)#%d (1) {
66  ["descriptor"]=>
67  resource(%d) of type (oci8 descriptor)
68}
69object(OCILob)#%d (1) {
70  ["descriptor"]=>
71  resource(%d) of type (oci8 descriptor)
72}
73object(OCILob)#%d (1) {
74  ["descriptor"]=>
75  resource(%d) of type (oci8 descriptor)
76}
77
78Warning: oci_new_descriptor(): Unknown descriptor type %d in %s on line %d
79NULL
80
81Warning: oci_new_descriptor(): Unknown descriptor type %d in %s on line %d
82NULL
83
84Warning: oci_new_descriptor(): Unknown descriptor type %d in %s on line %d
85NULL
86
87Warning: oci_new_descriptor(): Unknown descriptor type %d in %s on line %d
88NULL
89Done
90