aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-08-24 12:33:32 +0200
committerTristan Darricau <github@nicofuma.fr>2016-12-03 16:37:35 +0100
commit8481bd4e1831e3f9911263957637f4095fb088b0 (patch)
tree38f1b70929abfa155cea422172e6301a1ed03d2a /tests
parent376042d845a18058d93d289a1227096794da06d2 (diff)
downloadforums-8481bd4e1831e3f9911263957637f4095fb088b0.tar
forums-8481bd4e1831e3f9911263957637f4095fb088b0.tar.gz
forums-8481bd4e1831e3f9911263957637f4095fb088b0.tar.bz2
forums-8481bd4e1831e3f9911263957637f4095fb088b0.tar.xz
forums-8481bd4e1831e3f9911263957637f4095fb088b0.zip
[ticket/12610] Use exception_interface
PHPBB3-12610
Diffstat (limited to 'tests')
-rw-r--r--tests/console/update/check_test.php5
-rw-r--r--tests/version/version_fetch_test.php5
-rw-r--r--tests/version/version_helper_remote_test.php7
-rw-r--r--tests/version/version_test.php5
4 files changed, 9 insertions, 13 deletions
diff --git a/tests/console/update/check_test.php b/tests/console/update/check_test.php
index 2101a3f33a..de57e4df08 100644
--- a/tests/console/update/check_test.php
+++ b/tests/console/update/check_test.php
@@ -62,6 +62,9 @@ class phpbb_console_command_check_test extends phpbb_test_case
$this->assertSame($status, 1);
}
+ /**
+ * @expectedException phpbb\exception\runtime_exception
+ */
public function test_error()
{
$command_tester = $this->get_command_tester('1');
@@ -87,7 +90,7 @@ class phpbb_console_command_check_test extends phpbb_test_case
->getMock();
$config = new \phpbb\config\config(array('version' => $current_version));
- $this->version_helper = new \phpbb\version_helper($cache, $config, new \phpbb\file_downloader(), $user);
+ $this->version_helper = new \phpbb\version_helper($cache, $config, new \phpbb\file_downloader());
$container = new phpbb_mock_container_builder;
$container->set('version_helper', $this->version_helper);
diff --git a/tests/version/version_fetch_test.php b/tests/version/version_fetch_test.php
index 6ecc9b7223..c44bd5514a 100644
--- a/tests/version/version_fetch_test.php
+++ b/tests/version/version_fetch_test.php
@@ -28,15 +28,12 @@ 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(new \phpbb\language\language($lang_loader), '\phpbb\datetime')
+ new \phpbb\file_downloader()
);
}
diff --git a/tests/version/version_helper_remote_test.php b/tests/version/version_helper_remote_test.php
index 724c4c970c..fa383d487f 100644
--- a/tests/version/version_helper_remote_test.php
+++ b/tests/version/version_helper_remote_test.php
@@ -42,8 +42,7 @@ class version_helper_remote_test extends \phpbb_test_case
$this->version_helper = new \phpbb\version_helper(
$this->cache,
$config,
- $this->file_downloader,
- new \phpbb\user(new \phpbb\language\language($lang_loader), '\phpbb\datetime')
+ $this->file_downloader
);
$this->user = new \phpbb\user(new \phpbb\language\language($lang_loader), '\phpbb\datetime');
$this->user->add_lang('acp/common');
@@ -161,8 +160,8 @@ class version_helper_remote_test extends \phpbb_test_case
{
try {
$return = $this->version_helper->get_versions();
- } catch (\RuntimeException $e) {
- $this->assertEquals((string)$e->getMessage(), $this->user->lang('VERSIONCHECK_FAIL'));
+ } catch (\phpbb\exception\runtime_exception $e) {
+ $this->assertEquals((string)$e->getMessage(), 'VERSIONCHECK_FAIL');
}
}
else
diff --git a/tests/version/version_test.php b/tests/version/version_test.php
index 05577f6a18..93d47a40a6 100644
--- a/tests/version/version_test.php
+++ b/tests/version/version_test.php
@@ -25,15 +25,12 @@ 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(new \phpbb\language\language($lang_loader), '\phpbb\datetime')
+ new \phpbb\file_downloader()
);
}