From a7e709d92092de1eb9b0e35f45f1679ee10ce39b Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sun, 14 Aug 2011 14:47:16 -0400 Subject: [ticket/9297] Rename test class to reflect its contents. setUpBeforeClass logic makes this test specific to PASV/EPSV tests. PHPBB3-9297 --- tests/network/ftp_fsock_pasv_epsv_test.php | 63 ++++++++++++++++++++++++++++++ tests/network/ftp_fsock_test.php | 63 ------------------------------ 2 files changed, 63 insertions(+), 63 deletions(-) create mode 100644 tests/network/ftp_fsock_pasv_epsv_test.php delete mode 100644 tests/network/ftp_fsock_test.php (limited to 'tests') diff --git a/tests/network/ftp_fsock_pasv_epsv_test.php b/tests/network/ftp_fsock_pasv_epsv_test.php new file mode 100644 index 0000000000..af45fc2d61 --- /dev/null +++ b/tests/network/ftp_fsock_pasv_epsv_test.php @@ -0,0 +1,63 @@ +assert_ls_contains_debian(self::$ipv4); + } + + public function test_epsv() + { + $ipv4 = self::$ipv4; + // EPSV + $this->assert_ls_contains_debian("[::ffff:$ipv4]"); + } + + protected function assert_ls_contains_debian($hostname) + { + $o = $this->get_object($hostname); + $result = $o->_init(); + // This test may fail on IPv6 addresses if IPv6 support is + // not available. PHP must be compiled with IPv6 support enabled, + // and your operating system must be configured for IPv6 as well. + if ($result !== true) + { + $this->markTestSkipped("Failed to connect to $hostname: $result"); + } + $this->assertContains('debian', $o->_ls()); + $o->_close(); + } + + protected function get_object($hostname) + { + return new ftp_fsock($hostname, 'anonymous', 'anonymous@localost.tld', '/'); + } +} diff --git a/tests/network/ftp_fsock_test.php b/tests/network/ftp_fsock_test.php deleted file mode 100644 index cfffe8fd67..0000000000 --- a/tests/network/ftp_fsock_test.php +++ /dev/null @@ -1,63 +0,0 @@ -assert_ls_contains_debian(self::$ipv4); - } - - public function test_epsv() - { - $ipv4 = self::$ipv4; - // EPSV - $this->assert_ls_contains_debian("[::ffff:$ipv4]"); - } - - protected function assert_ls_contains_debian($hostname) - { - $o = $this->get_object($hostname); - $result = $o->_init(); - // This test may fail on IPv6 addresses if IPv6 support is - // not available. PHP must be compiled with IPv6 support enabled, - // and your operating system must be configured for IPv6 as well. - if ($result !== true) - { - $this->markTestSkipped("Failed to connect to $hostname: $result"); - } - $this->assertContains('debian', $o->_ls()); - $o->_close(); - } - - protected function get_object($hostname) - { - return new ftp_fsock($hostname, 'anonymous', 'anonymous@localost.tld', '/'); - } -} -- cgit v1.2.1