"Fossies" - the Fresh Open Source Software Archive

Member "php-7.4.1/ext/ftp/tests/001.phpt" (17 Dec 2019, 631 Bytes) of package /linux/www/php-7.4.1.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 --TEST--
    2 FTP login
    3 --SKIPIF--
    4 <?php
    5 require 'skipif.inc';
    6 ?>
    7 --FILE--
    8 <?php
    9 require 'server.inc';
   10 
   11 $ftp = ftp_connect('127.0.0.1', $port);
   12 if (!$ftp) die("Couldn't connect to the server");
   13 
   14 var_dump(ftp_login($ftp, 'user', 'pass'));
   15 var_dump(ftp_raw($ftp, 'HELP'));
   16 var_dump(ftp_raw($ftp, 'HELP HELP'));
   17 
   18 var_dump(ftp_close($ftp));
   19 ?>
   20 --EXPECT--
   21 bool(true)
   22 array(4) {
   23   [0]=>
   24   string(55) "214-There is help available for the following commands:"
   25   [1]=>
   26   string(5) " USER"
   27   [2]=>
   28   string(5) " HELP"
   29   [3]=>
   30   string(15) "214 end of list"
   31 }
   32 array(1) {
   33   [0]=>
   34   string(39) "214 Syntax: HELP [<SP> <string>] <CRLF>"
   35 }
   36 bool(true)