diff options
| author | Nuno Lopes <nlopess@php.net> | 2006-11-24 15:47:45 +0000 |
|---|---|---|
| committer | Nuno Lopes <nlopess@php.net> | 2006-11-24 15:47:45 +0000 |
| commit | d64b17543cfa5e171ca493eb3581eea0acd42dba (patch) | |
| tree | d12e15b9bd1f7cd9df672ab437a016908f6a83fd /ext/ftp/tests/bug39583.phpt | |
| parent | 050e32ed65e3f479e6af88cf5ed9f88c158af0dd (diff) | |
| download | php-git-d64b17543cfa5e171ca493eb3581eea0acd42dba.tar.gz | |
fix tests after Tony's commit and add a test for the bug he fixed
Diffstat (limited to 'ext/ftp/tests/bug39583.phpt')
| -rw-r--r-- | ext/ftp/tests/bug39583.phpt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/ftp/tests/bug39583.phpt b/ext/ftp/tests/bug39583.phpt new file mode 100644 index 0000000000..47d9e30802 --- /dev/null +++ b/ext/ftp/tests/bug39583.phpt @@ -0,0 +1,34 @@ +--TEST-- +Bug #39583: FTP always transfers in binary mode +--SKIPIF-- +<?php +require 'skipif.inc'; +?> +--FILE-- +<?php +require 'server.inc'; + +$ftp = ftp_connect('127.0.0.1', $port); +if (!$ftp) die("Couldn't connect to the server"); + +var_dump(ftp_login($ftp, 'user', 'pass')); + +$source_file = __FILE__; +$destination_file = basename(__FILE__); + +// upload the file +$upload = ftp_put($ftp, $destination_file, $source_file, FTP_ASCII); + +// check upload status +if (!$upload) { + echo "FTP upload has failed!"; + } else { + echo "Uploaded $source_file as $destination_file"; + } + +// close the FTP stream +ftp_close($ftp); +?> +--EXPECTF-- +bool(true) +Uploaded %sbug39583.php as bug39583.php |
