xref: /PHP-8.1/ext/ftp/tests/002.phpt (revision e9f783fc)
1--TEST--
2FTP login (SSL)
3--EXTENSIONS--
4ftp
5pcntl
6openssl
7--SKIPIF--
8<?php
9if (!function_exists("ftp_ssl_connect")) die("skip ftp_ssl is disabled");
10?>
11--FILE--
12<?php
13$ssl = 1;
14require 'server.inc';
15
16$ftp = ftp_ssl_connect('127.0.0.1', $port);
17if (!$ftp) die("Couldn't connect to the server");
18
19var_dump(ftp_login($ftp, 'user', 'pass'));
20var_dump(ftp_raw($ftp, 'HELP'));
21var_dump(ftp_raw($ftp, 'HELP HELP'));
22
23var_dump(ftp_close($ftp));
24?>
25--EXPECT--
26bool(true)
27array(4) {
28  [0]=>
29  string(55) "214-There is help available for the following commands:"
30  [1]=>
31  string(5) " USER"
32  [2]=>
33  string(5) " HELP"
34  [3]=>
35  string(15) "214 end of list"
36}
37array(1) {
38  [0]=>
39  string(39) "214 Syntax: HELP [<SP> <string>] <CRLF>"
40}
41bool(true)
42