Skip to content

Commit d73d9fe

Browse files
author
Julien Pauli
committed
Fixed and improved tests
1 parent 7f31a88 commit d73d9fe

File tree

8 files changed

+18
-16
lines changed

8 files changed

+18
-16
lines changed

Zend/tests/memory_get_peak_usage.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ int memory_get_peak_usage ([ bool $real_usage = false ] );
44
marcosptf - <[email protected]> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
55
--FILE--
66
<?php
7-
var_dump(memory_get_peak_usage());
7+
var_dump($a = memory_get_peak_usage());
88
var_dump(memory_get_peak_usage(true));
99
var_dump(memory_get_peak_usage(false));
10+
$array = range(1,1024*1024);
11+
var_dump(memory_get_peak_usage() > $a);
1012
?>
1113
--EXPECTF--
1214
int(%d)
1315
int(%d)
1416
int(%d)
17+
bool(true)

ext/pdo_mysql/tests/PDO_getAvaliableDrivers.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ array pdo_drivers ( void );
55
marcosptf - <[email protected]> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
66
--FILE--
77
<?php
8-
print((is_array(PDO::getAvailableDrivers())) ? ("yes") : ("Test 'array stream_get_wrappers ( void );' has failed"));
8+
print((is_array(PDO::getAvailableDrivers())) ? ("yes") : ("Test failed"));
99
?>
1010
--EXPECT--
1111
yes

socket_clear_error.phpt renamed to ext/sockets/tests/socket_clear_error.phpt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,11 @@ marcosptf - <[email protected]> - #phparty7 - @phpsp - novatec/2015 - sao p
77
if (!extension_loaded('sockets')) {
88
die('SKIP sockets extension not available.');
99
}
10-
if (!defined("SO_BINDTODEVICE")) {
11-
die('SKIP SO_BINDTODEVICE not supported on this platform.');
12-
}
13-
if (!function_exists("posix_getuid") || posix_getuid() != 0) {
14-
die('SKIP SO_BINDTODEVICE requires root permissions.');
15-
}
1610
?>
1711
--FILE--
1812
<?php
1913
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
20-
$socketConn = socket_connect($socket, "127.0.0.1", 21);
14+
$socketConn = socket_connect($socket, "127.0.0.1", 21248);
2115
var_dump(socket_last_error($socket));
2216
socket_clear_error($socket);
2317
var_dump(socket_last_error($socket));

ext/sockets/tests/socket_getopt.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ mixed socket_getopt( resource $socket , int $level , int $optname ) ;
33
--CREDITS--
44
marcosptf - <[email protected]> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
55
--SKIPIF--
6+
<?php
67
if (!extension_loaded('sockets')) {
78
die('skip sockets extension not available.');
89
}
9-
if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) {
10-
die("skip interface 1 either doesn't exist or has no ipv4 address");
11-
}
10+
?>
1211
--FILE--
1312
<?php
1413
$domain = AF_INET;

ext/standard/tests/general_functions/connection_aborted.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ marcosptf - <[email protected]> - #phparty7 - @phpsp - novatec/2015 - sao p
77
var_dump(connection_aborted());
88
?>
99
--EXPECTF--
10-
int(%i)
10+
int(0)

ext/standard/tests/general_functions/connection_status.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ int connection_status ( void );
44
marcosptf - <[email protected]> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
55
--FILE--
66
<?php
7-
var_dump(connection_status());
7+
var_dump(connection_status() == CONNECTION_NORMAL);
88
?>
99
--EXPECTF--
10-
int(%i)
10+
bool(true)

ext/standard/tests/streams/stream_get_wrappers.phpt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ if (phpversion() < "5.3.0") {
1111
--FILE--
1212
<?php
1313
print((is_array(stream_get_wrappers())) ? ("yes") : ("Test 'array stream_get_wrappers ( void );' has failed"));
14+
echo "\n";
15+
class Foo { }
16+
stream_wrapper_register("foo", "Foo");
17+
var_dump(in_array("foo", stream_get_wrappers()));
1418
?>
1519
--EXPECT--
1620
yes
21+
bool(true)

ext/standard/tests/streams/stream_socket_enable_crypto.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ marcosptf - <[email protected]> - #phparty7 - @phpsp - novatec/2015 - sao p
55
--SKIPIF--
66
<?php
77
if (phpversion() < "5.3.0") { die('SKIP php version so lower.'); }
8+
if (!extension_loaded('openssl')) { die('ext/openssl required'); }
89
?>
910
--FILE--
1011
<?php
@@ -39,7 +40,7 @@ bool(false)
3940
Warning: stream_socket_enable_crypto(): When enabling encryption you must specify the crypto type in %s on line %d
4041
bool(false)
4142

42-
Warning: stream_socket_enable_crypto(): SSLv2 unavailable in the OpenSSL library against which PHP is linked in %s on line %d
43+
Warning: stream_socket_enable_crypto(): SSLv2 %s in %s on line %d
4344
bool(false)
4445

4546
Warning: stream_socket_enable_crypto(): SSL: Broken pipe in %s on line %d

0 commit comments

Comments
 (0)