aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2013-12-04 13:33:19 +0100
committerAndreas Fischer <bantu@phpbb.com>2013-12-04 13:33:19 +0100
commit70e47bc9290ff0ce54b53374f703a3574c54325c (patch)
tree170b3a00f34503b733f94c838455d13c8b599e40 /tests
parentc07b44716c87ca2c74b49fd37b7fe7381f6a3769 (diff)
downloadforums-70e47bc9290ff0ce54b53374f703a3574c54325c.tar
forums-70e47bc9290ff0ce54b53374f703a3574c54325c.tar.gz
forums-70e47bc9290ff0ce54b53374f703a3574c54325c.tar.bz2
forums-70e47bc9290ff0ce54b53374f703a3574c54325c.tar.xz
forums-70e47bc9290ff0ce54b53374f703a3574c54325c.zip
[ticket/12056] validate_range: Fix "Creating default object from empty value"
PHPBB3-12056
Diffstat (limited to 'tests')
-rw-r--r--tests/functions_acp/validate_range_test.php26
1 files changed, 10 insertions, 16 deletions
diff --git a/tests/functions_acp/validate_range_test.php b/tests/functions_acp/validate_range_test.php
index 8606158251..cb028d4d07 100644
--- a/tests/functions_acp/validate_range_test.php
+++ b/tests/functions_acp/validate_range_test.php
@@ -12,6 +12,16 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php';
class phpbb_functions_acp_validate_range_test extends phpbb_test_case
{
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $user;
+
+ $user = new phpbb_mock_user();
+ $user->lang = new phpbb_mock_lang();
+ }
+
/**
* Data sets that don't throw an error.
*/
@@ -52,10 +62,6 @@ class phpbb_functions_acp_validate_range_test extends phpbb_test_case
*/
public function test_validate_range_fit($test_data)
{
- global $user;
-
- $user->lang = new phpbb_mock_lang();
-
$phpbb_error = array();
validate_range($test_data, $phpbb_error);
@@ -91,10 +97,6 @@ class phpbb_functions_acp_validate_range_test extends phpbb_test_case
*/
public function test_validate_range_too_low($test_data)
{
- global $user;
-
- $user->lang = new phpbb_mock_lang();
-
$phpbb_error = array();
validate_range($test_data, $phpbb_error);
@@ -130,10 +132,6 @@ class phpbb_functions_acp_validate_range_test extends phpbb_test_case
*/
public function test_validate_range_too_big($test_data)
{
- global $user;
-
- $user->lang = new phpbb_mock_lang();
-
$phpbb_error = array();
validate_range($test_data, $phpbb_error);
@@ -158,10 +156,6 @@ class phpbb_functions_acp_validate_range_test extends phpbb_test_case
*/
public function test_validate_range_too_long($test_data)
{
- global $user;
-
- $user->lang = new phpbb_mock_lang();
-
$phpbb_error = array();
validate_range($test_data, $phpbb_error);