1--TEST-- 2Collection trim tests 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 14$coll1 = oci_new_collection($c, $type_name); 15 16echo "\nTest 2.\n"; 17var_dump($coll1->trim(0)); 18 19echo "\nTest 3.\n"; 20var_dump($coll1->append(1)); 21var_dump($coll1->append(2)); 22var_dump($coll1->append(3)); 23var_dump($coll1->append(4)); 24 25var_dump($coll1->getElem(-1)); // check before the beginning 26var_dump($coll1->getElem(0)); 27var_dump($coll1->getElem(1)); 28var_dump($coll1->getElem(2)); 29var_dump($coll1->getElem(3)); 30var_dump($coll1->getElem(4)); // check past the end 31 32echo "\nTest 4.\n"; 33var_dump($coll1->trim(1)); 34var_dump($coll1->getElem(2)); // this should be the last element 35var_dump($coll1->getElem(3)); // this element should have gone 36 37echo "\nTest 5.\n"; 38var_dump($coll1->trim(2)); 39var_dump($coll1->getElem(0)); // this should be the last element 40var_dump($coll1->getElem(1)); // this element should have gone 41 42echo "\nTest 6.\n"; 43var_dump($coll1->trim(0)); 44var_dump($coll1->getElem(0)); // this should still be the last element 45 46echo "\nTest 7.\n"; 47var_dump($coll1->trim(1)); 48var_dump($coll1->getElem(0)); // this should have gone 49 50echo "Done\n"; 51 52require __DIR__."/drop_type.inc"; 53 54?> 55--EXPECT-- 56Test 2. 57bool(true) 58 59Test 3. 60bool(true) 61bool(true) 62bool(true) 63bool(true) 64bool(false) 65float(1) 66float(2) 67float(3) 68float(4) 69bool(false) 70 71Test 4. 72bool(true) 73float(3) 74bool(false) 75 76Test 5. 77bool(true) 78float(1) 79bool(false) 80 81Test 6. 82bool(true) 83float(1) 84 85Test 7. 86bool(true) 87bool(false) 88Done 89