aboutsummaryrefslogtreecommitdiffstats
path: root/tests/version
diff options
context:
space:
mode:
Diffstat (limited to 'tests/version')
-rw-r--r--tests/version/version_fetch_test.php4
-rw-r--r--tests/version/version_helper_remote_test.php6
-rw-r--r--tests/version/version_test.php18
3 files changed, 22 insertions, 6 deletions
diff --git a/tests/version/version_fetch_test.php b/tests/version/version_fetch_test.php
index cfc87183cf..6ecc9b7223 100644
--- a/tests/version/version_fetch_test.php
+++ b/tests/version/version_fetch_test.php
@@ -28,13 +28,15 @@ class phpbb_version_helper_fetch_test extends phpbb_test_case
->disableOriginalConstructor()
->getMock();
+ $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
+
$this->version_helper = new \phpbb\version_helper(
$this->cache,
new \phpbb\config\config(array(
'version' => '3.1.0',
)),
new \phpbb\file_downloader(),
- new \phpbb\user('\phpbb\datetime')
+ new \phpbb\user(new \phpbb\language\language($lang_loader), '\phpbb\datetime')
);
}
diff --git a/tests/version/version_helper_remote_test.php b/tests/version/version_helper_remote_test.php
index 65ae7646b9..05ae320713 100644
--- a/tests/version/version_helper_remote_test.php
+++ b/tests/version/version_helper_remote_test.php
@@ -37,13 +37,15 @@ class version_helper_remote_test extends \phpbb_test_case
->will($this->returnValue(false));
$this->file_downloader = new phpbb_mock_file_downloader();
+ $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
+
$this->version_helper = new \phpbb\version_helper(
$this->cache,
$config,
$this->file_downloader,
- new \phpbb\user('\phpbb\datetime')
+ new \phpbb\user(new \phpbb\language\language($lang_loader), '\phpbb\datetime')
);
- $this->user = new \phpbb\user('\phpbb\datetime');
+ $this->user = new \phpbb\user(new \phpbb\language\language($lang_loader), '\phpbb\datetime');
$this->user->add_lang('acp/common');
}
diff --git a/tests/version/version_test.php b/tests/version/version_test.php
index 528f1602d6..05577f6a18 100644
--- a/tests/version/version_test.php
+++ b/tests/version/version_test.php
@@ -25,13 +25,15 @@ class phpbb_version_helper_test extends phpbb_test_case
->disableOriginalConstructor()
->getMock();
+ $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
+
$this->version_helper = new \phpbb\version_helper(
$this->cache,
new \phpbb\config\config(array(
'version' => '3.1.0',
)),
new \phpbb\file_downloader(),
- new \phpbb\user('\phpbb\datetime')
+ new \phpbb\user(new \phpbb\language\language($lang_loader), '\phpbb\datetime')
);
}
@@ -199,6 +201,11 @@ class phpbb_version_helper_test extends phpbb_test_case
*/
public function test_get_suggested_updates($current_version, $versions, $expected)
{
+ global $phpbb_root_path, $phpEx;
+
+ $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
+ $lang = new \phpbb\language\language($lang_loader);
+
$version_helper = $this
->getMockBuilder('\phpbb\version_helper')
->setMethods(array(
@@ -210,7 +217,7 @@ class phpbb_version_helper_test extends phpbb_test_case
'version' => $current_version,
)),
new \phpbb\file_downloader(),
- new \phpbb\user('\phpbb\datetime'),
+ new \phpbb\user($lang, '\phpbb\datetime'),
))
->getMock()
;
@@ -310,6 +317,11 @@ class phpbb_version_helper_test extends phpbb_test_case
*/
public function test_get_latest_on_current_branch($current_version, $versions, $expected)
{
+ global $phpbb_root_path, $phpEx;
+
+ $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
+ $lang = new \phpbb\language\language($lang_loader);
+
$version_helper = $this
->getMockBuilder('\phpbb\version_helper')
->setMethods(array(
@@ -321,7 +333,7 @@ class phpbb_version_helper_test extends phpbb_test_case
'version' => $current_version,
)),
new \phpbb\file_downloader(),
- new \phpbb\user('\phpbb\datetime'),
+ new \phpbb\user($lang, '\phpbb\datetime'),
))
->getMock()
;