summaryrefslogtreecommitdiff
path: root/ext/ftp/tests/003.phpt
blob: db57ed56b7d61da9b9bec7143526a3302cf457e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--TEST--
FTP cwd
--SKIPIF--
<?php
require 'skipif.inc';
?>
--FILE--
<?php
require 'server.inc';

$ftp = ftp_connect('127.0.0.1', $port);
if (!$ftp) die("Couldn't connect to the server");

var_dump(ftp_login($ftp, 'user', 'pass'));

var_dump(ftp_pwd($ftp));

var_dump(ftp_chdir($ftp, 'mydir'));
var_dump(ftp_pwd($ftp));

var_dump(ftp_chdir($ftp, '/xpto/mydir'));
var_dump(ftp_pwd($ftp));

var_dump(ftp_cdup($ftp));
var_dump(ftp_pwd($ftp));

var_dump(ftp_chdir($ftp, '..'));
var_dump(ftp_pwd($ftp));

var_dump(ftp_close($ftp));
?>
--EXPECT--
bool(true)
string(1) "/"
bool(true)
string(6) "/mydir"
bool(true)
string(11) "/xpto/mydir"
bool(true)
string(5) "/xpto"
bool(true)
string(1) "/"
bool(true)