005.phpt 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. --TEST--
  2. FTP with bogus server responses
  3. --EXTENSIONS--
  4. ftp
  5. pcntl
  6. --FILE--
  7. <?php
  8. $bogus = 1;
  9. require 'server.inc';
  10. $ftp = ftp_connect('127.0.0.1', $port);
  11. if (!$ftp) die("Couldn't connect to the server");
  12. var_dump(ftp_login($ftp, 'anonymous', 'mail@example.com'));
  13. var_dump(ftp_alloc($ftp, 400));
  14. var_dump(ftp_cdup($ftp));
  15. var_dump(ftp_chdir($ftp, '~'));
  16. var_dump(ftp_chmod($ftp, 0666, 'x'));
  17. var_dump(ftp_delete($ftp, 'x'));
  18. var_dump(ftp_exec($ftp, 'x'));
  19. try {
  20. ftp_fget($ftp, STDOUT, 'x', 0);
  21. } catch (ValueError $exception) {
  22. echo $exception->getMessage() . "\n";
  23. }
  24. try {
  25. ftp_fput($ftp, 'x', fopen(__FILE__, 'r'), 0);
  26. } catch (ValueError $exception) {
  27. echo $exception->getMessage() . "\n";
  28. }
  29. try {
  30. ftp_get($ftp, 'x', 'y', 0);
  31. } catch (ValueError $exception) {
  32. echo $exception->getMessage() . "\n";
  33. }
  34. var_dump(ftp_mdtm($ftp, 'x'));
  35. var_dump(ftp_mkdir($ftp, 'x'));
  36. var_dump(ftp_nb_continue($ftp));
  37. try {
  38. ftp_nb_fget($ftp, STDOUT, 'x', 0);
  39. } catch (ValueError $exception) {
  40. echo $exception->getMessage() . "\n";
  41. }
  42. try {
  43. ftp_nb_fput($ftp, 'x', fopen(__FILE__, 'r'), 0);
  44. } catch (ValueError $exception) {
  45. echo $exception->getMessage() . "\n";
  46. }
  47. var_dump(ftp_systype($ftp));
  48. var_dump(ftp_pwd($ftp));
  49. var_dump(ftp_size($ftp, ''));
  50. var_dump(ftp_rmdir($ftp, ''));
  51. ?>
  52. --EXPECTF--
  53. bool(true)
  54. bool(false)
  55. Warning: ftp_cdup(): Command not implemented (1). in %s005.php on line %d
  56. bool(false)
  57. Warning: ftp_chdir(): Command not implemented (2). in %s005.php on line %d
  58. bool(false)
  59. Warning: ftp_chmod(): Command not implemented (3). in %s005.php on line %d
  60. bool(false)
  61. Warning: ftp_delete(): Command not implemented (4). in %s005.php on line %d
  62. bool(false)
  63. Warning: ftp_exec(): Command not implemented (5). in %s005.php on line %d
  64. bool(false)
  65. ftp_fget(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
  66. ftp_fput(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
  67. ftp_get(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
  68. int(-1)
  69. Warning: ftp_mkdir(): Command not implemented (7). in %s005.php on line %d
  70. bool(false)
  71. Warning: ftp_nb_continue(): No nbronous transfer to continue in %s005.php on line %d
  72. int(0)
  73. ftp_nb_fget(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
  74. ftp_nb_fput(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY
  75. Warning: ftp_systype(): Command not implemented (8). in %s005.php on line %d
  76. bool(false)
  77. Warning: ftp_pwd(): Command not implemented (9). in %s005.php on line %d
  78. bool(false)
  79. int(-1)
  80. Warning: ftp_rmdir(): Command not implemented (11). in %s005.php on line %d
  81. bool(false)