1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 19:24:01 +02:00

[ticket/13762] Moving language related functionality into a separate class

PHPBB3-13762
This commit is contained in:
MateBartus
2015-04-14 02:31:23 +02:00
parent 2f480be02d
commit 179a470022
67 changed files with 1663 additions and 679 deletions

View File

@@ -25,7 +25,12 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case
*/
public function setUp()
{
$user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
global $phpbb_root_path, $phpEx;
$user = $this->getMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime'
));
$user->expects($this->any())
->method('lang')
->will($this->returnCallback(array($this, 'return_callback_implode')));

View File

@@ -25,7 +25,12 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case
*/
public function setUp()
{
$this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
global $phpbb_root_path, $phpEx;
$this->user = $this->getMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime'
));
$this->user->expects($this->any())
->method('lang')
->will($this->returnCallback(array($this, 'return_callback_implode')));

View File

@@ -25,7 +25,12 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case
*/
public function setUp()
{
$user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
global $phpbb_root_path, $phpEx;
$user = $this->getMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime'
));
$user->expects($this->any())
->method('lang')
->will($this->returnCallback(array($this, 'return_callback_implode')));

View File

@@ -21,7 +21,11 @@ class phpbb_profilefield_type_googleplus_test extends phpbb_test_case
{
parent::setUp();
$user = new \phpbb\user('\phpbb\datetime');
global $phpbb_root_path, $phpEx;
$lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
$lang = new \phpbb\language\language($lang_loader);
$user = new \phpbb\user($lang, '\phpbb\datetime');
$user->add_lang('ucp');
$request = $this->getMock('\phpbb\request\request');
$template = $this->getMock('\phpbb\template\template');

View File

@@ -24,7 +24,12 @@ class phpbb_profilefield_type_int_test extends phpbb_test_case
*/
public function setUp()
{
$user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
global $phpbb_root_path, $phpEx;
$user = $this->getMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime'
));
$user->expects($this->any())
->method('lang')
->will($this->returnCallback(array($this, 'return_callback_implode')));

View File

@@ -28,9 +28,12 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case
*/
public function setUp()
{
global $request, $user, $cache;
global $request, $user, $cache, $phpbb_root_path, $phpEx;
$user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
$user = $this->getMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime'
));
$cache = new phpbb_mock_cache;
$user->expects($this->any())
->method('lang')

View File

@@ -26,7 +26,12 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case
*/
public function setUp()
{
$user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
global $phpbb_root_path, $phpEx;
$user = $this->getMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime'
));
$user->expects($this->any())
->method('lang')
->will($this->returnCallback(array($this, 'return_callback_implode')));