From fb6b350c21f5f63991099ae2ef9f007c9786cb61 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Thu, 13 Mar 2014 19:38:20 -0500 Subject: [ticket/9871] Split fast and slow version tests PHPBB3-9871 --- tests/version/version_fetch_test.php | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 tests/version/version_fetch_test.php (limited to 'tests/version/version_fetch_test.php') diff --git a/tests/version/version_fetch_test.php b/tests/version/version_fetch_test.php new file mode 100644 index 0000000000..b4912861f4 --- /dev/null +++ b/tests/version/version_fetch_test.php @@ -0,0 +1,58 @@ +cache = $this->getMockBuilder('\phpbb\cache\service') + ->disableOriginalConstructor() + ->getMock(); + + $this->version_helper = new \phpbb\version_helper( + $this->cache, + new \phpbb\config\config(array( + 'version' => '3.1.0', + )), + new \phpbb\user() + ); + } + + public function test_version_phpbb_com() + { + global $phpbb_root_path, $phpEx; + include_once($phpbb_root_path . 'includes/functions.' . $phpEx); + + if (!phpbb_checkdnsrr('version.phpbb.com', 'A')) + { + $this->markTestSkipped(sprintf( + 'Could not find a DNS record for hostname %s. ' . + 'Assuming network is down.', + 'version.phpbb.com' + )); + } + + $this->version_helper->get_versions(); + + // get_versions checks to make sure we got a valid versions file or + // throws an exception if we did not. We don't need to test anything + // here, but adding an assertion so we do not get a warning about no + // assertions in this test + $this->assertSame(true, true); + } +} -- cgit v1.2.1 From 23289c89a19ef8c262c46d2761b75a2506354d4e Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 14 Mar 2014 07:02:25 -0500 Subject: [ticket/9871] Fix test name PHPBB3-9871 --- tests/version/version_fetch_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/version/version_fetch_test.php') diff --git a/tests/version/version_fetch_test.php b/tests/version/version_fetch_test.php index b4912861f4..7b3ba5e717 100644 --- a/tests/version/version_fetch_test.php +++ b/tests/version/version_fetch_test.php @@ -10,7 +10,7 @@ /* * @group slow */ -class phpbb_version_helper_test extends phpbb_test_case +class phpbb_version_helper_fetch_test extends phpbb_test_case { public function setUp() { -- cgit v1.2.1