xref: /php-src/ext/ftp/tests/ftp_fget_basic1.phpt (revision e9f783fc)
1--TEST--
2Testing ftp_fget ignore autoresume if autoseek is switched off
3--CREDITS--
4Rodrigo Moyle <eu [at] rodrigorm [dot] com [dot] br>
5#testfest PHPSP on 2009-06-20
6--EXTENSIONS--
7ftp
8pcntl
9--FILE--
10<?php
11require 'server.inc';
12
13$ftp = ftp_connect('127.0.0.1', $port);
14ftp_login($ftp, 'user', 'pass');
15if (!$ftp) die("Couldn't connect to the server");
16ftp_set_option($ftp, FTP_AUTOSEEK, false);
17
18$local_file = __DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt";
19$handle = fopen($local_file, 'w');
20
21var_dump(ftp_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME));
22var_dump(file_get_contents($local_file));
23?>
24--CLEAN--
25<?php
26@unlink(__DIR__ . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt");
27?>
28--EXPECT--
29bool(true)
30string(12) "ASCIIFooBar
31"
32