diff options
Diffstat (limited to 'ext/ftp/tests/ftp_fget_basic2.phpt')
-rw-r--r-- | ext/ftp/tests/ftp_fget_basic2.phpt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ext/ftp/tests/ftp_fget_basic2.phpt b/ext/ftp/tests/ftp_fget_basic2.phpt new file mode 100644 index 0000000..00a2675 --- /dev/null +++ b/ext/ftp/tests/ftp_fget_basic2.phpt @@ -0,0 +1,32 @@ +--TEST-- +Testing ftp_fget autoresume +--CREDITS-- +Rodrigo Moyle <eu [at] rodrigorm [dot] com [dot] br> +#testfest PHPSP on 2009-06-20 +--SKIPIF-- +<?php +require 'skipif.inc'; +?> +--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 = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.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(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"); +?> +--EXPECT-- +bool(true) +string(12) "ASCIIFooBar +" |