diff options
Diffstat (limited to 'tests/profilefields')
-rw-r--r-- | tests/profilefields/type_bool_test.php | 7 | ||||
-rw-r--r-- | tests/profilefields/type_date_test.php | 7 | ||||
-rw-r--r-- | tests/profilefields/type_dropdown_test.php | 7 | ||||
-rw-r--r-- | tests/profilefields/type_googleplus_test.php | 8 | ||||
-rw-r--r-- | tests/profilefields/type_int_test.php | 7 | ||||
-rw-r--r-- | tests/profilefields/type_string_test.php | 12 | ||||
-rw-r--r-- | tests/profilefields/type_url_test.php | 8 |
7 files changed, 41 insertions, 15 deletions
diff --git a/tests/profilefields/type_bool_test.php b/tests/profilefields/type_bool_test.php index 41c40ddb4b..10239172c3 100644 --- a/tests/profilefields/type_bool_test.php +++ b/tests/profilefields/type_bool_test.php @@ -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'))); diff --git a/tests/profilefields/type_date_test.php b/tests/profilefields/type_date_test.php index 123955198e..e0807b2f9b 100644 --- a/tests/profilefields/type_date_test.php +++ b/tests/profilefields/type_date_test.php @@ -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'))); diff --git a/tests/profilefields/type_dropdown_test.php b/tests/profilefields/type_dropdown_test.php index 3845a8e96b..ab02353fb9 100644 --- a/tests/profilefields/type_dropdown_test.php +++ b/tests/profilefields/type_dropdown_test.php @@ -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'))); diff --git a/tests/profilefields/type_googleplus_test.php b/tests/profilefields/type_googleplus_test.php index f3db6ef01f..9222362214 100644 --- a/tests/profilefields/type_googleplus_test.php +++ b/tests/profilefields/type_googleplus_test.php @@ -11,8 +11,6 @@ * */ -require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php'; - class phpbb_profilefield_type_googleplus_test extends phpbb_test_case { protected $field; @@ -21,7 +19,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'); diff --git a/tests/profilefields/type_int_test.php b/tests/profilefields/type_int_test.php index 07b22525e2..33f3f575c8 100644 --- a/tests/profilefields/type_int_test.php +++ b/tests/profilefields/type_int_test.php @@ -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'))); diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php index 43f88c01ae..a5e1d89ef2 100644 --- a/tests/profilefields/type_string_test.php +++ b/tests/profilefields/type_string_test.php @@ -11,10 +11,6 @@ * */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; -require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php'; -require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php'; - class phpbb_profilefield_type_string_test extends phpbb_test_case { protected $cp; @@ -28,13 +24,17 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case */ public function setUp() { - global $request, $user, $cache; + global $config, $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') ->will($this->returnCallback(array($this, 'return_callback_implode'))); + $config = new \phpbb\config\config([]); $request = $this->getMock('\phpbb\request\request'); $template = $this->getMock('\phpbb\template\template'); diff --git a/tests/profilefields/type_url_test.php b/tests/profilefields/type_url_test.php index af17cc125a..3bb5d52899 100644 --- a/tests/profilefields/type_url_test.php +++ b/tests/profilefields/type_url_test.php @@ -28,10 +28,14 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case */ public function setUp() { - global $request, $user, $cache; + global $config, $request, $user, $cache, $phpbb_root_path, $phpEx; + $config = new \phpbb\config\config([]); $cache = new phpbb_mock_cache; - $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' + )); $user->expects($this->any()) ->method('lang') ->will($this->returnCallback(array($this, 'return_callback_implode'))); |