Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_alloc_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_alloc error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_alloc($notFtp, 1, $result);

?>
--EXPECTF--
Warning: ftp_alloc(): supplied resource is not a valid FTP Buffer resource in %s on line %d
15 changes: 15 additions & 0 deletions ext/ftp/tests/ftp_append_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Testing ftp_append error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
$destination_file = basename(__FILE__);
ftp_append($notFtp, $destination_file, 'a storty.txt', FTP_ASCII);

?>
--EXPECTF--
Warning: ftp_append(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_cdup_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_cdup error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_cdup($notFtp);

?>
--EXPECTF--
Warning: ftp_cdup(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_chdir_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_chdir error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_chdir($notFtp, '/path/to/some/dir');

?>
--EXPECTF--
Warning: ftp_chdir(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_chmod_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_chmod error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_chmod($notFtp, 0000, '/path/to/some/dir');

?>
--EXPECTF--
Warning: ftp_chmod(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_close_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_close error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_close($notFtp);

?>
--EXPECTF--
Warning: ftp_close(): supplied resource is not a valid FTP Buffer resource in %s on line %d
15 changes: 15 additions & 0 deletions ext/ftp/tests/ftp_delete_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Testing ftp_delete error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
$destination_file = basename(__FILE__);
ftp_delete($notFtp, $destination_file);

?>
--EXPECTF--
Warning: ftp_delete(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_exec_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_exec error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_exec($notFtp, 'ls -hal');

?>
--EXPECTF--
Warning: ftp_exec(): supplied resource is not a valid FTP Buffer resource in %s on line %d
15 changes: 15 additions & 0 deletions ext/ftp/tests/ftp_fget_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Testing ftp_fget error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
$fp = tmpfile();
ftp_fget($notFtp, $fp, 'a story.txt', FTP_ASCII);

?>
--EXPECTF--
Warning: ftp_fget(): supplied resource is not a valid FTP Buffer resource in %s on line %d
16 changes: 16 additions & 0 deletions ext/ftp/tests/ftp_fput_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--TEST--
Testing ftp_fput error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
$destination_file = basename(__FILE__);
$source_file = fopen(__FILE__, 'r');
ftp_fput($notFtp, $destination_file, $source_file, FTP_ASCII);

?>
--EXPECTF--
Warning: ftp_fput(): supplied resource is not a valid FTP Buffer resource in %s on line %d
16 changes: 16 additions & 0 deletions ext/ftp/tests/ftp_get_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--TEST--
Testing ftp_get error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
$tmpfname = tempnam(__DIR__, "ftp_test");
ftp_get($notFtp, $tmpfname, 'a story.txt', FTP_ASCII);
unlink($tmpfname);

?>
--EXPECTF--
Warning: ftp_get(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_get_option_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_get_option error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_get_option($notFtp, FTP_TIMEOUT_SEC);

?>
--EXPECTF--
Warning: ftp_get_option(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_login_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_login error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_login($notFtp, 'user', 'pass');

?>
--EXPECTF--
Warning: ftp_login(): supplied resource is not a valid FTP Buffer resource in %s on line %d
15 changes: 15 additions & 0 deletions ext/ftp/tests/ftp_mdtm_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Testing ftp_mdtm error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
$destination_file = basename(__FILE__);
ftp_mdtm($notFtp, $destination_file);

?>
--EXPECTF--
Warning: ftp_mdtm(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_mkdir_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_mkdir error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_mkdir($notFtp, '/path/to/some/dir');

?>
--EXPECTF--
Warning: ftp_mkdir(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_mlsd_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_mlsd error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_mlsd($notFtp, '/path/to/some/dir');

?>
--EXPECTF--
Warning: ftp_mlsd(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_nb_continue_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_nb_continue error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_nb_continue($notFtp);

?>
--EXPECTF--
Warning: ftp_nb_continue(): supplied resource is not a valid FTP Buffer resource in %s on line %d
15 changes: 15 additions & 0 deletions ext/ftp/tests/ftp_nb_fget_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Testing ftp_nb_fget error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
$fp = tmpfile();
ftp_nb_fget($notFtp, $fp, 'a story.txt', FTP_ASCII);

?>
--EXPECTF--
Warning: ftp_nb_fget(): supplied resource is not a valid FTP Buffer resource in %s on line %d
16 changes: 16 additions & 0 deletions ext/ftp/tests/ftp_nb_fput_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--TEST--
Testing ftp_nb_fput error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
$destination_file = basename(__FILE__);
$source_file = fopen(__FILE__, 'r');
ftp_nb_fput($notFtp, $destination_file, $source_file, FTP_ASCII);

?>
--EXPECTF--
Warning: ftp_nb_fput(): supplied resource is not a valid FTP Buffer resource in %s on line %d
15 changes: 15 additions & 0 deletions ext/ftp/tests/ftp_nb_get_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Testing ftp_nb_get error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
$tmpfname = tempnam(__DIR__, "ftp_test");
ftp_nb_get($notFtp, $tmpfname, 'a story.txt', FTP_ASCII);
unlink($tmpfname);
?>
--EXPECTF--
Warning: ftp_nb_get(): supplied resource is not a valid FTP Buffer resource in %s on line %d
15 changes: 15 additions & 0 deletions ext/ftp/tests/ftp_nb_put_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Testing ftp_nb_put error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
$destination_file = basename(__FILE__);
ftp_nb_put($notFtp, $destination_file, 'a storty.txt', FTP_ASCII);

?>
--EXPECTF--
Warning: ftp_nb_put(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_nlist_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_nlist error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_nlist($notFtp, '/path/to/some/dir');

?>
--EXPECTF--
Warning: ftp_nlist(): supplied resource is not a valid FTP Buffer resource in %s on line %d
14 changes: 14 additions & 0 deletions ext/ftp/tests/ftp_pasv_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Testing ftp_pasv error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
ftp_pasv($notFtp, true);

?>
--EXPECTF--
Warning: ftp_pasv(): supplied resource is not a valid FTP Buffer resource in %s on line %d
15 changes: 15 additions & 0 deletions ext/ftp/tests/ftp_put_error.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--TEST--
Testing ftp_put error conditions
--CREDITS--
Chance Garcia <chance [at] chancegarcia [dot] com>
#testfest php[tek] 2018-06-01
--FILE--
<?php

$notFtp = fopen('php://stdin', 'r+');
$destination_file = basename(__FILE__);
ftp_put($notFtp, $destination_file, 'a storty.txt', FTP_ASCII);

?>
--EXPECTF--
Warning: ftp_put(): supplied resource is not a valid FTP Buffer resource in %s on line %d
Loading