xref: /PHP-5.4/ext/ftp/tests/ftp_mdtm_basic.phpt (revision 9271f528)
1--TEST--
2Test the File Modification Time as described in http://tools.ietf.org/html/rfc3659#section-3.1
3--CREDITS--
4Nathaniel McHugh
5--SKIPIF--
6<?php
7require 'skipif.inc';
8?>
9--FILE--
10<?php
11
12require 'server.inc';
13
14$ftp = ftp_connect('127.0.0.1', $port);
15if (!$ftp) die("Couldn't connect to the server");
16
17var_dump(ftp_login($ftp, 'user', 'pass'));
18
19
20date_default_timezone_set('UTC');
21
22$time = ftp_mdtm($ftp, "A");
23echo date("F d Y H:i:s u",$time), PHP_EOL;
24
25$time = ftp_mdtm($ftp, "B");
26echo date("F d Y H:i:s u",$time), PHP_EOL;
27
28$time = ftp_mdtm($ftp, "C");
29echo date("F d Y H:i:s u",$time), PHP_EOL;
30
31$time = ftp_mdtm($ftp, "D");
32var_dump($time);
33
34$time = ftp_mdtm($ftp, "19990929043300 File6");
35echo date("F d Y H:i:s u",$time), PHP_EOL;
36
37$time = ftp_mdtm($ftp, "MdTm 19990929043300 file6");
38var_dump($time);
39
40?>
41--EXPECTF--
42bool(true)
43June 15 1998 10:00:45 000000
44June 15 1998 10:00:45 000000
45July 05 1998 13:23:16 000000
46int(-1)
47October 05 1999 21:31:02 000000
48int(-1)
49