summaryrefslogtreecommitdiff
path: root/ext/ftp/tests/ftp_nb_fget_basic1.phpt
blob: d5576f3710688f12761375940182f04535905b11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--TEST--
Testing ftp_nb_fget ignore autoresume if autoseek is switched off
--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");
ftp_set_option($ftp, FTP_AUTOSEEK, false);

$local_file = __DIR__ . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt";
$handle = fopen($local_file, 'w');

var_dump(ftp_nb_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME));
var_dump(file_get_contents($local_file));
?>
--CLEAN--
<?php
@unlink(__DIR__ . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt");
?>
--EXPECT--
int(2)
string(12) "ASCIIFooBar
"