From 18f19b03ab703d0eb09627dcd162ba556316a451 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 10 Aug 2011 16:43:43 +0200 Subject: [PATCH] [ticket/9297] Unit tests for ftp_fsock PASV and EPSV. PHPBB3-9297 --- tests/network/ftp_fsock_test.php | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/network/ftp_fsock_test.php diff --git a/tests/network/ftp_fsock_test.php b/tests/network/ftp_fsock_test.php new file mode 100644 index 0000000000..c6364f7383 --- /dev/null +++ b/tests/network/ftp_fsock_test.php @@ -0,0 +1,48 @@ +assert_ls_contains_debian($ipv4); + $this->assert_ls_contains_debian("[$ipv6]"); + } + + protected function assert_ls_contains_debian($hostname) + { + $o = $this->get_object($hostname); + $o->_init(); + $this->assertContains('debian', $o->_ls()); + $o->_close(); + } + + protected function get_object($hostname) + { + return new ftp_fsock($hostname, 'anonymous', 'anonymous@localost.tld', '/'); + } +}