PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/oci8/tests/coll_018.phpt ('Collection trim tests')

Script

1: <?php
2:
3:
require __DIR__."/connect.inc";
4: require 
__DIR__."/create_type.inc";
5:
6:
$coll1 oci_new_collection($c$type_name);
7:
8: echo 
"Test 1.\n";
9:
var_dump($coll1->trim());
10:
11: echo 
"\nTest 2.\n";
12:
var_dump($coll1->trim(0));
13:
14: echo 
"\nTest 3.\n";
15:
var_dump($coll1->append(1));
16:
var_dump($coll1->append(2));
17:
var_dump($coll1->append(3));
18:
var_dump($coll1->append(4));
19:
20:
var_dump($coll1->getElem(-1));  // check before the beginning
21:
var_dump($coll1->getElem(0));
22:
var_dump($coll1->getElem(1));
23:
var_dump($coll1->getElem(2));
24:
var_dump($coll1->getElem(3));
25:
var_dump($coll1->getElem(4));  // check past the end
26:
27:
echo "\nTest 4.\n";
28:
var_dump($coll1->trim(1));
29:
var_dump($coll1->getElem(2));  // this should be the last element
30:
var_dump($coll1->getElem(3));  // this element should have gone
31:
32:
echo "\nTest 5.\n";
33:
var_dump($coll1->trim(2));
34:
var_dump($coll1->getElem(0));  // this should be the last element
35:
var_dump($coll1->getElem(1));  // this element should have gone
36:
37:
echo "\nTest 6.\n";
38:
var_dump($coll1->trim(0));
39:
var_dump($coll1->getElem(0));  // this should still be the last element
40:
41:
echo "\nTest 7.\n";
42:
var_dump($coll1->trim(1));
43:
var_dump($coll1->getElem(0));  // this should have gone
44:
45:
echo "Done\n";
46:
47: require 
__DIR__."/drop_type.inc";
48:
49:
?>
50:

Expected

Test 1.

Warning: OCI-Collection::trim() expects exactly 1 parameter, 0 given in %s on line 9
NULL

Test 2.
bool(true)

Test 3.
bool(true)
bool(true)
bool(true)
bool(true)
bool(false)
float(1)
float(2)
float(3)
float(4)
bool(false)

Test 4.
bool(true)
float(3)
bool(false)

Test 5.
bool(true)
float(1)
bool(false)

Test 6.
bool(true)
float(1)

Test 7.
bool(true)
bool(false)
Done

Output

Test 1.

Fatal error: Uncaught ArgumentCountError: OCI-Collection::trim() expects exactly 1 parameter, 0 given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/coll_018.php:9
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/oci8/tests/coll_018.php(9): OCI-Collection->trim()
#1 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/oci8/tests/coll_018.php on line 9

Diff

003+ Fatal error: Uncaught ArgumentCountError: OCI-Collection::trim() expects exactly 1 parameter, 0 given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/coll_018.php:9
004+ Stack trace:
005+ #0 /var/php_gcov/PHP_HEAD/ext/oci8/tests/coll_018.php(9): OCI-Collection->trim()
006+ #1 {main}
007+   thrown in /var/php_gcov/PHP_HEAD/ext/oci8/tests/coll_018.php on line 9
003- Warning: OCI-Collection::trim() expects exactly 1 parameter, 0 given in %s on line 9
004- NULL
005- 
006- Test 2.
007- bool(true)
008- 
009- Test 3.
010- bool(true)
011- bool(true)
012- bool(true)
013- bool(true)
014- bool(false)
015- float(1)
016- float(2)
017- float(3)
018- float(4)
019- bool(false)
020- 
021- Test 4.
022- bool(true)
023- float(3)
024- bool(false)
025- 
026- Test 5.
027- bool(true)
028- float(1)
029- bool(false)
030- 
031- Test 6.
032- bool(true)
033- float(1)
034- 
035- Test 7.
036- bool(true)
037- bool(false)
038- Done

 

Generated at Mon, 06 May 2019 17:58:35 +0000 (942 days ago)

Copyright © 2005-2021 The PHP Group
All rights reserved.