1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Files
archived-php-src/ext/ftp/tests/004.phpt
T
Max Semenik e9f783fcdd Migrate skip checks to --EXTENSIONS--, p3
For rationale, see #6787

Extensions migrated in part 3:
* ftp
* gmp
* iconv
* opcache
* shmop
2021-04-03 15:23:25 +02:00

32 lines
610 B
PHP

--TEST--
FTP with bogus parameters
--EXTENSIONS--
ftp
pcntl
--FILE--
<?php
require 'server.inc';
// Negative timeout
try {
ftp_connect('127.0.0.1', 0, -3);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
$ftp = ftp_connect('127.0.0.1', $port);
if (!$ftp) die("Couldn't connect to the server");
var_dump(ftp_login($ftp, 'user', 'pass'));
var_dump(ftp_login($ftp, 'user', 'bogus'));
var_dump(ftp_quit($ftp));
?>
--EXPECTF--
ftp_connect(): Argument #3 ($timeout) must be greater than 0
bool(true)
Warning: ftp_login(): Not logged in. in %s on line %d
bool(false)
bool(true)