mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Fixed and improved tests
This commit is contained in:
parent
7f31a88bb8
commit
d73d9fecf6
@ -4,11 +4,14 @@ int memory_get_peak_usage ([ bool $real_usage = false ] );
|
||||
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(memory_get_peak_usage());
|
||||
var_dump($a = memory_get_peak_usage());
|
||||
var_dump(memory_get_peak_usage(true));
|
||||
var_dump(memory_get_peak_usage(false));
|
||||
$array = range(1,1024*1024);
|
||||
var_dump(memory_get_peak_usage() > $a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(%d)
|
||||
bool(true)
|
||||
|
@ -5,7 +5,7 @@ array pdo_drivers ( void );
|
||||
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
|
||||
--FILE--
|
||||
<?php
|
||||
print((is_array(PDO::getAvailableDrivers())) ? ("yes") : ("Test 'array stream_get_wrappers ( void );' has failed"));
|
||||
print((is_array(PDO::getAvailableDrivers())) ? ("yes") : ("Test failed"));
|
||||
?>
|
||||
--EXPECT--
|
||||
yes
|
||||
|
@ -7,17 +7,11 @@ marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao p
|
||||
if (!extension_loaded('sockets')) {
|
||||
die('SKIP sockets extension not available.');
|
||||
}
|
||||
if (!defined("SO_BINDTODEVICE")) {
|
||||
die('SKIP SO_BINDTODEVICE not supported on this platform.');
|
||||
}
|
||||
if (!function_exists("posix_getuid") || posix_getuid() != 0) {
|
||||
die('SKIP SO_BINDTODEVICE requires root permissions.');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
$socketConn = socket_connect($socket, "127.0.0.1", 21);
|
||||
$socketConn = socket_connect($socket, "127.0.0.1", 21248);
|
||||
var_dump(socket_last_error($socket));
|
||||
socket_clear_error($socket);
|
||||
var_dump(socket_last_error($socket));
|
@ -3,12 +3,11 @@ mixed socket_getopt( resource $socket , int $level , int $optname ) ;
|
||||
--CREDITS--
|
||||
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('sockets')) {
|
||||
die('skip sockets extension not available.');
|
||||
}
|
||||
if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) {
|
||||
die("skip interface 1 either doesn't exist or has no ipv4 address");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$domain = AF_INET;
|
||||
|
@ -7,4 +7,4 @@ marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao p
|
||||
var_dump(connection_aborted());
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(%i)
|
||||
int(0)
|
||||
|
@ -4,7 +4,7 @@ int connection_status ( void );
|
||||
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(connection_status());
|
||||
var_dump(connection_status() == CONNECTION_NORMAL);
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(%i)
|
||||
bool(true)
|
||||
|
@ -11,6 +11,11 @@ if (phpversion() < "5.3.0") {
|
||||
--FILE--
|
||||
<?php
|
||||
print((is_array(stream_get_wrappers())) ? ("yes") : ("Test 'array stream_get_wrappers ( void );' has failed"));
|
||||
echo "\n";
|
||||
class Foo { }
|
||||
stream_wrapper_register("foo", "Foo");
|
||||
var_dump(in_array("foo", stream_get_wrappers()));
|
||||
?>
|
||||
--EXPECT--
|
||||
yes
|
||||
bool(true)
|
||||
|
@ -5,6 +5,7 @@ marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao p
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (phpversion() < "5.3.0") { die('SKIP php version so lower.'); }
|
||||
if (!extension_loaded('openssl')) { die('ext/openssl required'); }
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
@ -39,7 +40,7 @@ bool(false)
|
||||
Warning: stream_socket_enable_crypto(): When enabling encryption you must specify the crypto type in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: stream_socket_enable_crypto(): SSLv2 unavailable in the OpenSSL library against which PHP is linked in %s on line %d
|
||||
Warning: stream_socket_enable_crypto(): SSLv2 %s in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: stream_socket_enable_crypto(): SSL: Broken pipe in %s on line %d
|
||||
|
Loading…
Reference in New Issue
Block a user