mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/9871] Split fast and slow version tests
PHPBB3-9871
This commit is contained in:
parent
feed1441ad
commit
fb6b350c21
2 changed files with 58 additions and 26 deletions
58
tests/version/version_fetch_test.php
Normal file
58
tests/version/version_fetch_test.php
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @package testing
|
||||||
|
* @copyright (c) 2014 phpBB Group
|
||||||
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @group slow
|
||||||
|
*/
|
||||||
|
class phpbb_version_helper_test extends phpbb_test_case
|
||||||
|
{
|
||||||
|
public function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
|
||||||
|
global $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
|
include_once($phpbb_root_path . 'includes/functions.' . $phpEx);
|
||||||
|
|
||||||
|
$this->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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,9 +7,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* @group slow
|
|
||||||
*/
|
|
||||||
class phpbb_version_helper_test extends phpbb_test_case
|
class phpbb_version_helper_test extends phpbb_test_case
|
||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
|
@ -318,27 +315,4 @@ class phpbb_version_helper_test extends phpbb_test_case
|
||||||
|
|
||||||
$this->assertSame($expected, $version_helper->get_latest_on_current_branch());
|
$this->assertSame($expected, $version_helper->get_latest_on_current_branch());
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue