Skip to content

Commit 8b7f213

Browse files
committed
Misc test fixes
1 parent 1008c92 commit 8b7f213

17 files changed

+50
-230
lines changed

ext/standard/tests/assert/assert04.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ assert(1);
1616
assert_options(ASSERT_ACTIVE, 1);
1717
assert(2, "failure", 3);
1818

19-
/* Wrong parameter count in assert_options */
20-
assert_options(ASSERT_ACTIVE, 0, 2);
21-
2219
/* Wrong parameter name in assert_options */
2320
$test="ASSERT_FRED";
2421
assert_options($test, 1);
@@ -35,8 +32,6 @@ echo "not reached\n";
3532

3633
?>
3734
--EXPECTF--
38-
Warning: assert() expects at most 2 parameters, 3 given in %s on line %d
39-
4035
Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d
4136

4237
Warning: assert_options() expects parameter 1 to be int, string given in %s on line %d

ext/standard/tests/directory/DirectoryClass_error_001-mb.phpt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ var_dump($d->read());
2121
var_dump($d->rewind());
2222
var_dump($d->close());
2323

24-
echo "\n--> Try all methods with wrong number of args:\n";
25-
$d = new Directory($d);
26-
var_dump($d->read(1,2));
27-
var_dump($d->rewind(1,2));
28-
var_dump($d->close(1,2));
29-
3024
?>
3125
--CLEAN--
3226
<?php
@@ -56,14 +50,3 @@ bool(false)
5650

5751
Warning: Directory::close(): Unable to find my handle property in %s on line %d
5852
bool(false)
59-
60-
--> Try all methods with wrong number of args:
61-
62-
Warning: Directory::read() expects at most 1 parameter, 2 given in %s on line %d
63-
NULL
64-
65-
Warning: Directory::rewind() expects at most 1 parameter, 2 given in %s on line %d
66-
NULL
67-
68-
Warning: Directory::close() expects at most 1 parameter, 2 given in %s on line %d
69-
NULL

ext/standard/tests/directory/DirectoryClass_error_001.phpt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ var_dump($d->read());
1717
var_dump($d->rewind());
1818
var_dump($d->close());
1919

20-
echo "\n--> Try all methods with wrong number of args:\n";
21-
$d = new Directory(getcwd());
22-
var_dump($d->read(1,2));
23-
var_dump($d->rewind(1,2));
24-
var_dump($d->close(1,2));
25-
2620
?>
2721
--EXPECTF--
2822
--> Try all methods with bad handle:
@@ -46,14 +40,3 @@ bool(false)
4640

4741
Warning: Directory::close(): Unable to find my handle property in %s on line %d
4842
bool(false)
49-
50-
--> Try all methods with wrong number of args:
51-
52-
Warning: Directory::read() expects at most 1 parameter, 2 given in %s on line %d
53-
NULL
54-
55-
Warning: Directory::rewind() expects at most 1 parameter, 2 given in %s on line %d
56-
NULL
57-
58-
Warning: Directory::close() expects at most 1 parameter, 2 given in %s on line %d
59-
NULL

ext/standard/tests/filters/001.phpt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ var_dump(stream_filter_register("", ""));
77
var_dump(stream_filter_register("test", ""));
88
var_dump(stream_filter_register("", "test"));
99
var_dump(stream_filter_register("------", "nonexistentclass"));
10-
var_dump(stream_filter_register(array(), "aa"));
11-
var_dump(stream_filter_register("", array()));
1210

1311
echo "Done\n";
1412
?>
@@ -22,10 +20,4 @@ bool(false)
2220
Warning: stream_filter_register(): Filter name cannot be empty in %s on line %d
2321
bool(false)
2422
bool(true)
25-
26-
Warning: stream_filter_register() expects parameter 1 to be string, array given in %s on line %d
27-
bool(false)
28-
29-
Warning: stream_filter_register() expects parameter 2 to be string, array given in %s on line %d
30-
bool(false)
3123
Done

ext/standard/tests/filters/stream_filter_remove_error.phpt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@ $filter = stream_filter_append( $fp, "string.rot13", STREAM_FILTER_WRITE );
2020

2121
echo "*** Testing stream_filter_remove() : error conditions ***\n";
2222

23-
echo "\n-- Testing stream_filter_remove() function with Zero arguments --\n";
24-
var_dump( stream_filter_remove() );
25-
26-
echo "\n-- Testing stream_filter_remove() function with more than expected no. of arguments --\n";
27-
$arg = 'bogus arg';
28-
var_dump( stream_filter_remove( $filter, $arg ) );
29-
30-
echo "\n-- Testing stream_filter_remove() function with unexisting stream filter --\n";
31-
var_dump( stream_filter_remove( "fakefilter" ) );
32-
3323
echo "\n-- Testing stream_filter_remove() function with bad resource --\n";
3424
var_dump( stream_filter_remove( $fp ) );
3525

@@ -52,21 +42,6 @@ unlink( $file );
5242
--EXPECTF--
5343
*** Testing stream_filter_remove() : error conditions ***
5444

55-
-- Testing stream_filter_remove() function with Zero arguments --
56-
57-
Warning: stream_filter_remove() expects exactly 1 parameter, 0 given in %s on line %d
58-
bool(false)
59-
60-
-- Testing stream_filter_remove() function with more than expected no. of arguments --
61-
62-
Warning: stream_filter_remove() expects exactly 1 parameter, 2 given in %s on line %d
63-
bool(false)
64-
65-
-- Testing stream_filter_remove() function with unexisting stream filter --
66-
67-
Warning: stream_filter_remove() expects parameter 1 to be resource, string given in %s on line %d
68-
bool(false)
69-
7045
-- Testing stream_filter_remove() function with bad resource --
7146

7247
Warning: stream_filter_remove(): Invalid resource given, not a stream filter in %s on line %d

ext/standard/tests/image/image_type_to_extension.phpt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ image_type_to_extension()
2929
printf("Constant: %s\n\tWith dot: %s\n\tWithout dot: %s\n", $name, image_type_to_extension($constant), image_type_to_extension($constant, false));
3030
}
3131

32-
var_dump(image_type_to_extension(-1, array()));
33-
var_dump(image_type_to_extension(new stdclass));
3432
var_dump(image_type_to_extension(1000000, NULL));
35-
var_dump(image_type_to_extension());
3633
var_dump(image_type_to_extension(0));
37-
var_dump(image_type_to_extension(0, 0, 0));
3834
?>
3935
Done
4036
--EXPECTF--
@@ -89,18 +85,6 @@ Constant: IMAGETYPE_XBM
8985
Constant: IMAGETYPE_WEBP
9086
With dot: .webp
9187
Without dot: webp
92-
93-
Warning: image_type_to_extension() expects parameter 2 to be bool, array given in %s on line %d
94-
bool(false)
95-
96-
Warning: image_type_to_extension() expects parameter 1 to be int, object given in %s on line %d
97-
bool(false)
9888
bool(false)
99-
100-
Warning: image_type_to_extension() expects at least 1 parameter, 0 given in %s on line %d
101-
bool(false)
102-
bool(false)
103-
104-
Warning: image_type_to_extension() expects at most 2 parameters, 3 given in %s on line %d
10589
bool(false)
10690
Done

ext/standard/tests/misc/get_browser_error.phpt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ echo "*** Testing get_browser() : error functionality ***\n";
3030
/* Unknown browser uses defaults. */
3131
var_dump( get_browser( 'foobar', true ) );
3232

33-
/* More than expected arguments */
34-
var_dump( get_browser( 'foobar', true, 15 ) );
35-
3633
/* Some wrong parameters, no HTTP_USER_AGENT set */
3734
var_dump( get_browser( null, 'foobar' ) );
3835

@@ -111,9 +108,6 @@ array(34) {
111108
string(1) "0"
112109
}
113110

114-
Warning: get_browser() expects at most 2 parameters, 3 given in %s on line %d
115-
NULL
116-
117111
Warning: get_browser(): HTTP_USER_AGENT variable is not set, cannot determine user agent name in %s on line %d
118112
bool(false)
119113
===DONE===

ext/standard/tests/network/fsockopen_error.phpt

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,6 @@ Test fsockopen() function : error conditions
1111

1212
echo "*** Testing fsockopen() : basic error conditions ***\n";
1313

14-
15-
echo "\n-- Testing fsockopen() function with more than expected no. of arguments --\n";
16-
$hostname = 'string_val';
17-
$port = 10;
18-
$errno = 10;
19-
$errstr = 'string_val';
20-
$timeout = 10.5;
21-
$extra_arg = 10;
22-
var_dump( fsockopen($hostname, $port, $errno, $errstr, $timeout, $extra_arg) );
23-
var_dump($errstr);
24-
var_dump($errno);
25-
26-
echo "\n-- Testing fsockopen() function with less than expected no. of arguments --\n";
27-
var_dump( fsockopen() );
28-
2914
echo "\n-- Attempting to connect to a non-existent socket --\n";
3015
$hostname = 'tcp://127.0.0.1'; // loopback address
3116
$port = 31337;
@@ -49,18 +34,6 @@ echo "Done";
4934
--EXPECTF--
5035
*** Testing fsockopen() : basic error conditions ***
5136

52-
-- Testing fsockopen() function with more than expected no. of arguments --
53-
54-
Warning: fsockopen() expects at most 5 parameters, 6 given in %s on line %d
55-
bool(false)
56-
string(10) "string_val"
57-
int(10)
58-
59-
-- Testing fsockopen() function with less than expected no. of arguments --
60-
61-
Warning: fsockopen() expects at least 1 parameter, 0 given in %s on line %d
62-
bool(false)
63-
6437
-- Attempting to connect to a non-existent socket --
6538

6639
Warning: fsockopen(): unable to connect to tcp://127.0.0.1:31337 (%a) in %s on line %d

ext/standard/tests/network/gethostbyaddr_error.phpt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@ Test gethostbyaddr() function : error conditions
1111

1212
echo "Testing gethostbyaddr : error conditions\n";
1313

14-
// Zero arguments
15-
echo "\n-- Testing gethostbyaddr function with Zero arguments --\n";
16-
var_dump( gethostbyaddr() );
17-
18-
//Test gethostbyaddr with one more than the expected number of arguments
19-
echo "\n-- Testing gethostbyaddr function with more than expected no. of arguments --\n";
20-
$ip_address = 'string_val';
21-
$extra_arg = 10;
22-
var_dump( gethostbyaddr($ip_address, $extra_arg) );
23-
2414
echo "\n-- Testing gethostbyaddr function with invalid addresses --\n";
2515

2616
$ip_address = 'invalid';
@@ -37,16 +27,6 @@ echo "Done";
3727
--EXPECTREGEX--
3828
Testing gethostbyaddr : error conditions
3929

40-
-- Testing gethostbyaddr function with Zero arguments --
41-
42-
Warning: gethostbyaddr\(\) expects exactly 1 parameter, 0 given in .* on line \d+
43-
NULL
44-
45-
-- Testing gethostbyaddr function with more than expected no. of arguments --
46-
47-
Warning: gethostbyaddr\(\) expects exactly 1 parameter, 2 given in .* on line \d+
48-
NULL
49-
5030
-- Testing gethostbyaddr function with invalid addresses --
5131

5232
Warning: gethostbyaddr\(\): Address is not (in a.b.c.d form|a valid IPv4 or IPv6 address) in .* on line \d+

ext/standard/tests/network/gethostname.phpt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ marcosptf - <[email protected]> - #phparty7 - @phpsp - novatec/2015 - sao p
55
--FILE--
66
<?php
77
var_dump(gethostname());
8-
var_dump(gethostname("php-zend-brazil"));
98
?>
109
--EXPECTF--
11-
%s
12-
13-
Warning: gethostname() expects exactly %d parameters, %d given in %s on line %d
14-
NULL
10+
string(%d) "%s"

ext/standard/tests/network/getprotobyname_error.phpt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@ getprotobyname function errors test
44
edgarsandi - <[email protected]>
55
--FILE--
66
<?php
7-
// empty protocol name
8-
var_dump(getprotobyname());
9-
10-
// invalid protocol name
11-
var_dump(getprotobyname('abc'));
7+
// invalid protocol name
8+
var_dump(getprotobyname('abc'));
129
?>
13-
--EXPECTF--
14-
Warning: getprotobyname() expects exactly 1 parameter, 0 given in %s on line %d
15-
NULL
10+
--EXPECT--
1611
bool(false)

ext/standard/tests/network/getprotobynumber_error.phpt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@ getprotobynumber function errors test
44
edgarsandi - <[email protected]>
55
--FILE--
66
<?php
7-
// empty protocol number
8-
var_dump(getprotobynumber());
9-
10-
// invalid protocol number
11-
var_dump(getprotobynumber(999));
7+
// invalid protocol number
8+
var_dump(getprotobynumber(999));
129
?>
13-
--EXPECTF--
14-
Warning: getprotobynumber() expects exactly 1 parameter, 0 given in %s on line %d
15-
NULL
10+
--EXPECT--
1611
bool(false)

ext/standard/tests/network/inet.phpt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ var_dump(inet_ntop($packed));
1414
$packed = chr(255) . chr(255) . chr(255) . chr(0);
1515
var_dump(inet_ntop($packed));
1616

17-
var_dump(inet_ntop());
1817
var_dump(inet_ntop(-1));
1918
var_dump(inet_ntop(""));
2019
var_dump(inet_ntop("blah-blah"));
2120

22-
var_dump(inet_pton());
2321
var_dump(inet_pton(""));
2422
var_dump(inet_pton(-1));
2523
var_dump(inet_pton("abra"));
@@ -40,15 +38,9 @@ echo "Done\n";
4038
--EXPECTF--
4139
string(9) "127.0.0.1"
4240
string(13) "255.255.255.0"
43-
44-
Warning: inet_ntop() expects exactly 1 parameter, 0 given in %s on line %d
45-
bool(false)
4641
bool(false)
4742
bool(false)
4843
bool(false)
49-
50-
Warning: inet_pton() expects exactly 1 parameter, 0 given in %s on line %d
51-
bool(false)
5244
bool(false)
5345
bool(false)
5446
bool(false)

ext/standard/tests/network/ip_x86_64.phpt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,11 @@ foreach ($array as $ip) {
2121
var_dump(long2ip($long));
2222
}
2323

24-
var_dump(ip2long());
2524
var_dump(ip2long(""));
2625
var_dump(ip2long("777.777.777.777"));
2726
var_dump(ip2long("111.111.111.111"));
28-
var_dump(ip2long(array()));
2927

30-
var_dump(long2ip());
3128
var_dump(long2ip(-110000));
32-
var_dump(long2ip(""));
33-
var_dump(long2ip(array()));
3429

3530
echo "Done\n";
3631
?>
@@ -47,23 +42,8 @@ int(0)
4742
string(7) "0.0.0.0"
4843
int(1118019956)
4944
string(14) "66.163.161.116"
50-
51-
Warning: ip2long() expects exactly 1 parameter, 0 given in %sip_x86_64.php on line %d
52-
NULL
5345
bool(false)
5446
bool(false)
5547
int(1869573999)
56-
57-
Warning: ip2long() expects parameter 1 to be string, array given in %sip_x86_64.php on line %d
58-
NULL
59-
60-
Warning: long2ip() expects exactly 1 parameter, 0 given in %sip_x86_64.php on line %d
61-
NULL
6248
string(13) "255.254.82.80"
63-
64-
Warning: long2ip() expects parameter 1 to be int, string given in %sip_x86_64.php on line %d
65-
NULL
66-
67-
Warning: long2ip() expects parameter 1 to be int, array given in %sip_x86_64.php on line %d
68-
NULL
6949
Done

0 commit comments

Comments
 (0)