xref: /PHP-8.0/ext/oci8/tests/coll_002.phpt (revision ff66e494)
1--TEST--
2oci_new_collection() + free()
3--SKIPIF--
4<?php
5$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
6require(__DIR__.'/skipif.inc');
7?>
8--FILE--
9<?php
10
11require __DIR__."/connect.inc";
12require __DIR__."/create_type.inc";
13
14var_dump($coll1 = oci_new_collection($c, $type_name));
15var_dump($coll1->free());
16
17try {
18    var_dump($coll1->size());
19} catch (TypeError $error) {
20    var_dump($error->getMessage());
21}
22
23var_dump(oci_new_collection($c, "NONEXISTENT"));
24
25echo "Done\n";
26
27require __DIR__."/drop_type.inc";
28
29?>
30--EXPECTF--
31object(OCICollection)#%d (1) {
32  ["collection"]=>
33  resource(%d) of type (oci8 collection)
34}
35bool(true)
36string(%d) "OCICollection::size(): supplied resource is not a valid oci8 collection resource"
37
38Warning: oci_new_collection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d
39bool(false)
40Done
41