1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/ftp/tests/ftp_fget_basic2.phpt
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
724 B
PHP

--TEST--
Testing ftp_fget autoresume
--CREDITS--
Rodrigo Moyle <eu [at] rodrigorm [dot] com [dot] br>
#testfest PHPSP on 2009-06-20
--EXTENSIONS--
ftp
pcntl
--FILE--
<?php
require 'server.inc';
$ftp = ftp_connect('127.0.0.1', $port);
ftp_login($ftp, 'user', 'pass');
if (!$ftp) die("Couldn't connect to the server");
$local_file = __DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt";
file_put_contents($local_file, 'ASCIIFoo');
$handle = fopen($local_file, 'a');
var_dump(ftp_fget($ftp, $handle, 'fgetresume.txt', FTP_ASCII, FTP_AUTORESUME));
var_dump(file_get_contents($local_file));
?>
--CLEAN--
<?php
@unlink(__DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt");
?>
--EXPECT--
bool(true)
string(12) "ASCIIFooBar
"