xref: /PHP-5.6/ext/ftp/tests/003.phpt (revision bd519ae0)
1--TEST--
2FTP cwd
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_pwd($ftp));
17
18var_dump(ftp_chdir($ftp, 'mydir'));
19var_dump(ftp_pwd($ftp));
20
21var_dump(ftp_chdir($ftp, '/xpto/mydir'));
22var_dump(ftp_pwd($ftp));
23
24var_dump(ftp_cdup($ftp));
25var_dump(ftp_pwd($ftp));
26
27var_dump(ftp_chdir($ftp, '..'));
28var_dump(ftp_pwd($ftp));
29
30var_dump(ftp_close($ftp));
31?>
32--EXPECT--
33bool(true)
34string(1) "/"
35bool(true)
36string(6) "/mydir"
37bool(true)
38string(11) "/xpto/mydir"
39bool(true)
40string(5) "/xpto"
41bool(true)
42string(1) "/"
43bool(true)
44