xref: /PHP-5.6/ext/ftp/tests/bug39458-2.phpt (revision 1f655451)
1--TEST--
2Bug #39458 (ftp_nlist() returns false on empty directories (other server behaviour))
3--SKIPIF--
4<?php
5require 'skipif.inc';
6?>
7--FILE--
8<?php
9$bug39458=1;
10require 'server.inc';
11
12$ftp = ftp_connect('127.0.0.1', $port);
13if (!$ftp) die("Couldn't connect to the server");
14
15var_dump(ftp_login($ftp, 'user', 'pass'));
16
17var_dump(ftp_nlist($ftp, ''));
18var_dump(ftp_nlist($ftp, 'emptydir'));
19var_dump(ftp_nlist($ftp, 'bogusdir'));
20
21ftp_close($ftp);
22?>
23--EXPECT--
24bool(true)
25array(3) {
26  [0]=>
27  string(5) "file1"
28  [1]=>
29  string(5) "file1"
30  [2]=>
31  string(9) "file
32b0rk"
33}
34array(0) {
35}
36bool(false)
37