From 6b00d7aa096b01ce6e59a8467f79eb193c25a35b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 1 Feb 2011 14:09:52 +0100 Subject: [PATCH] [ticket/9823] Update Unit tests to the new system and correct some minor issues PHPBB3-9823 --- tests/functions_acp/all_tests.php | 48 ------------------- ...mplate.php => build_cfg_template_test.php} | 15 +++--- ...build_select.php => build_select_test.php} | 7 ++- .../{h_radio.php => h_radio_test.php} | 7 ++- ...vars.php => validate_config_vars_test.php} | 5 +- ...date_range.php => validate_range_test.php} | 5 +- 6 files changed, 17 insertions(+), 70 deletions(-) delete mode 100644 tests/functions_acp/all_tests.php rename tests/functions_acp/{build_cfg_template.php => build_cfg_template_test.php} (94%) rename tests/functions_acp/{build_select.php => build_select_test.php} (86%) rename tests/functions_acp/{h_radio.php => h_radio_test.php} (94%) rename tests/functions_acp/{validate_config_vars.php => validate_config_vars_test.php} (96%) rename tests/functions_acp/{validate_range.php => validate_range_test.php} (97%) diff --git a/tests/functions_acp/all_tests.php b/tests/functions_acp/all_tests.php deleted file mode 100644 index 64956593fd..0000000000 --- a/tests/functions_acp/all_tests.php +++ /dev/null @@ -1,48 +0,0 @@ -addTestSuite('phpbb_functions_acp_build_cfg_template_test'); - $suite->addTestSuite('phpbb_functions_acp_built_select_test'); - $suite->addTestSuite('phpbb_functions_acp_h_radio_test'); - $suite->addTestSuite('phpbb_functions_acp_validate_config_vars_test'); - $suite->addTestSuite('phpbb_functions_acp_validate_range_test'); - - return $suite; - } -} - -if (PHPUnit_MAIN_METHOD == 'phpbb_functions_acp_all_tests::main') -{ - phpbb_functions_acp_all_tests::main(); -} diff --git a/tests/functions_acp/build_cfg_template.php b/tests/functions_acp/build_cfg_template_test.php similarity index 94% rename from tests/functions_acp/build_cfg_template.php rename to tests/functions_acp/build_cfg_template_test.php index 07f82e933a..c573c7cdb0 100644 --- a/tests/functions_acp/build_cfg_template.php +++ b/tests/functions_acp/build_cfg_template_test.php @@ -7,9 +7,8 @@ * */ -require_once 'test_framework/framework.php'; -require_once 'functions_acp/user_mock.php'; -require_once '../phpBB/includes/functions_acp.php'; +require_once dirname(__FILE__) . 'user_mock.php'; +require_once dirname(__FILE__) . '../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case { @@ -50,7 +49,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case { global $user; - $user->lang =new phpbb_mock_lang(); + $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); } @@ -84,7 +83,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case { global $user; - $user->lang =new phpbb_mock_lang(); + $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); } @@ -110,7 +109,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case { global $user; - $user->lang =new phpbb_mock_lang(); + $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); } @@ -160,7 +159,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case { global $user; - $user->lang =new phpbb_mock_lang(); + $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); } @@ -186,7 +185,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case { global $user; - $user->lang =new phpbb_mock_lang(); + $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars)); } diff --git a/tests/functions_acp/build_select.php b/tests/functions_acp/build_select_test.php similarity index 86% rename from tests/functions_acp/build_select.php rename to tests/functions_acp/build_select_test.php index 5a097fefab..a4f5e419ea 100644 --- a/tests/functions_acp/build_select.php +++ b/tests/functions_acp/build_select_test.php @@ -7,9 +7,8 @@ * */ -require_once 'test_framework/framework.php'; -require_once 'functions_acp/user_mock.php'; -require_once '../phpBB/includes/functions_acp.php'; +require_once dirname(__FILE__) . 'user_mock.php'; +require_once dirname(__FILE__) . '../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_built_select_test extends phpbb_test_case { @@ -50,7 +49,7 @@ class phpbb_functions_acp_built_select_test extends phpbb_test_case { global $user; - $user->lang =new phpbb_mock_lang(); + $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, build_select($option_ary, $option_default)); } diff --git a/tests/functions_acp/h_radio.php b/tests/functions_acp/h_radio_test.php similarity index 94% rename from tests/functions_acp/h_radio.php rename to tests/functions_acp/h_radio_test.php index 6550c8f818..924b502ede 100644 --- a/tests/functions_acp/h_radio.php +++ b/tests/functions_acp/h_radio_test.php @@ -7,9 +7,8 @@ * */ -require_once 'test_framework/framework.php'; -require_once 'functions_acp/user_mock.php'; -require_once '../phpBB/includes/functions_acp.php'; +require_once dirname(__FILE__) . 'user_mock.php'; +require_once dirname(__FILE__) . '../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_h_radio_test extends phpbb_test_case { @@ -115,7 +114,7 @@ class phpbb_functions_acp_h_radio_test extends phpbb_test_case { global $user; - $user->lang =new phpbb_mock_lang(); + $user->lang = new phpbb_mock_lang(); $this->assertEquals($expected, h_radio($name, $input_ary, $input_default, $id, $key)); } diff --git a/tests/functions_acp/validate_config_vars.php b/tests/functions_acp/validate_config_vars_test.php similarity index 96% rename from tests/functions_acp/validate_config_vars.php rename to tests/functions_acp/validate_config_vars_test.php index 04a5fead7a..722d0ebddb 100644 --- a/tests/functions_acp/validate_config_vars.php +++ b/tests/functions_acp/validate_config_vars_test.php @@ -7,9 +7,8 @@ * */ -require_once 'test_framework/framework.php'; -require_once 'functions_acp/user_mock.php'; -require_once '../phpBB/includes/functions_acp.php'; +require_once dirname(__FILE__) . 'user_mock.php'; +require_once dirname(__FILE__) . '../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case { diff --git a/tests/functions_acp/validate_range.php b/tests/functions_acp/validate_range_test.php similarity index 97% rename from tests/functions_acp/validate_range.php rename to tests/functions_acp/validate_range_test.php index cac54dd5ed..fb1d15c032 100644 --- a/tests/functions_acp/validate_range.php +++ b/tests/functions_acp/validate_range_test.php @@ -7,9 +7,8 @@ * */ -require_once 'test_framework/framework.php'; -require_once 'functions_acp/user_mock.php'; -require_once '../phpBB/includes/functions_acp.php'; +require_once dirname(__FILE__) . 'user_mock.php'; +require_once dirname(__FILE__) . '../../phpBB/includes/functions_acp.php'; class phpbb_functions_acp_validate_range_test extends phpbb_test_case {