xref: /PHP-8.0/ext/ftp/tests/ftp_mlsd.phpt (revision 5b1300b6)
1--TEST--
2ftp_mlsd() return parsed lines
3--SKIPIF--
4<?php
5require 'skipif.inc';
6?>
7--FILE--
8<?php
9require 'server.inc';
10
11$ftp = ftp_connect('127.0.0.1', $port);
12if (!$ftp) die("Couldn't connect to the server");
13
14var_dump(ftp_login($ftp, 'user', 'pass'));
15
16var_dump(ftp_mlsd($ftp, '.'));
17
18ftp_close($ftp);
19?>
20--EXPECTF--
21bool(true)
22
23Warning: ftp_mlsd(): Missing pathname in MLSD response in %s on line %d
24
25Warning: ftp_mlsd(): Malformed fact in MLSD response in %s on line %d
26
27Warning: ftp_mlsd(): Malformed fact in MLSD response in %s on line %d
28array(4) {
29  [0]=>
30  array(8) {
31    ["name"]=>
32    string(1) "."
33    ["modify"]=>
34    string(14) "20170127230002"
35    ["perm"]=>
36    string(7) "flcdmpe"
37    ["type"]=>
38    string(4) "cdir"
39    ["unique"]=>
40    string(11) "811U4340002"
41    ["UNIX.group"]=>
42    string(2) "33"
43    ["UNIX.mode"]=>
44    string(4) "0755"
45    ["UNIX.owner"]=>
46    string(2) "33"
47  }
48  [1]=>
49  array(8) {
50    ["name"]=>
51    string(2) ".."
52    ["modify"]=>
53    string(14) "20170127230002"
54    ["perm"]=>
55    string(7) "flcdmpe"
56    ["type"]=>
57    string(4) "pdir"
58    ["unique"]=>
59    string(11) "811U4340002"
60    ["UNIX.group"]=>
61    string(2) "33"
62    ["UNIX.mode"]=>
63    string(4) "0755"
64    ["UNIX.owner"]=>
65    string(2) "33"
66  }
67  [2]=>
68  array(9) {
69    ["name"]=>
70    string(6) "foobar"
71    ["modify"]=>
72    string(14) "20170126121225"
73    ["perm"]=>
74    string(5) "adfrw"
75    ["size"]=>
76    string(4) "4729"
77    ["type"]=>
78    string(4) "file"
79    ["unique"]=>
80    string(11) "811U4340CB9"
81    ["UNIX.group"]=>
82    string(2) "33"
83    ["UNIX.mode"]=>
84    string(4) "0644"
85    ["UNIX.owner"]=>
86    string(2) "33"
87  }
88  [3]=>
89  array(3) {
90    ["name"]=>
91    string(9) "path;name"
92    ["fact"]=>
93    string(6) "val=ue"
94    ["empty"]=>
95    string(0) ""
96  }
97}
98