xref: /PHP-8.2/ext/ftp/tests/003.phpt (revision e9f783fc)
1--TEST--
2FTP cwd
3--EXTENSIONS--
4ftp
5pcntl
6--FILE--
7<?php
8require 'server.inc';
9
10$ftp = ftp_connect('127.0.0.1', $port);
11if (!$ftp) die("Couldn't connect to the server");
12
13var_dump(ftp_login($ftp, 'user', 'pass'));
14
15var_dump(ftp_pwd($ftp));
16
17var_dump(ftp_chdir($ftp, 'mydir'));
18var_dump(ftp_pwd($ftp));
19
20var_dump(ftp_chdir($ftp, '/xpto/mydir'));
21var_dump(ftp_pwd($ftp));
22
23var_dump(ftp_cdup($ftp));
24var_dump(ftp_pwd($ftp));
25
26var_dump(ftp_chdir($ftp, '..'));
27var_dump(ftp_pwd($ftp));
28
29var_dump(ftp_close($ftp));
30?>
31--EXPECT--
32bool(true)
33string(1) "/"
34bool(true)
35string(6) "/mydir"
36bool(true)
37string(11) "/xpto/mydir"
38bool(true)
39string(5) "/xpto"
40bool(true)
41string(1) "/"
42bool(true)
43