From c659fe4cbe1e80b7d1ed7c46815ce2573412fd6b Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 4 Dec 2013 13:29:40 +0100 Subject: [PATCH] [ticket/12056] h_radio test: Fix "Creating default object from empty value" PHPBB3-12056 --- tests/functions_acp/h_radio_test.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/functions_acp/h_radio_test.php b/tests/functions_acp/h_radio_test.php index a61f2e8975..4c1872d341 100644 --- a/tests/functions_acp/h_radio_test.php +++ b/tests/functions_acp/h_radio_test.php @@ -11,6 +11,16 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_h_radio_test extends phpbb_test_case { + protected function setUp() + { + parent::setUp(); + + global $user; + + $user = new phpbb_mock_user(); + $user->lang = new phpbb_mock_lang(); + } + public function h_radio_data() { return array( @@ -111,10 +121,6 @@ class phpbb_functions_acp_h_radio_test extends phpbb_test_case */ public function test_h_radio($name, $input_ary, $input_default, $id, $key, $expected) { - global $user; - - $user->lang = new phpbb_mock_lang(); - $this->assertEquals($expected, h_radio($name, $input_ary, $input_default, $id, $key)); } }