aboutsummaryrefslogtreecommitdiffstats
path: root/tests/version
diff options
context:
space:
mode:
authorMateBartus <mate.bartus@gmail.com>2015-04-14 02:31:23 +0200
committerMateBartus <mate.bartus@gmail.com>2015-05-02 13:37:12 +0200
commit179a4700221aa49071b07d638c44b9326c7a14a8 (patch)
tree3dd78a5fb9353afabaa629e8dae58b7f8d99c144 /tests/version
parent2f480be02d25421fa4c372c103604f24d4adf0ab (diff)
downloadforums-179a4700221aa49071b07d638c44b9326c7a14a8.tar
forums-179a4700221aa49071b07d638c44b9326c7a14a8.tar.gz
forums-179a4700221aa49071b07d638c44b9326c7a14a8.tar.bz2
forums-179a4700221aa49071b07d638c44b9326c7a14a8.tar.xz
forums-179a4700221aa49071b07d638c44b9326c7a14a8.zip
[ticket/13762] Moving language related functionality into a separate class
PHPBB3-13762
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()
;