mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/9823] Update Unit tests to the new system and correct some minor issues
PHPBB3-9823
This commit is contained in:
parent
2b70f3d0e2
commit
6b00d7aa09
6 changed files with 17 additions and 70 deletions
|
@ -1,48 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @package testing
|
|
||||||
* @copyright (c) 2010 phpBB Group
|
|
||||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!defined('PHPUnit_MAIN_METHOD'))
|
|
||||||
{
|
|
||||||
define('PHPUnit_MAIN_METHOD', 'phpbb_functions_all_tests::main');
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once 'test_framework/framework.php';
|
|
||||||
require_once 'PHPUnit/TextUI/TestRunner.php';
|
|
||||||
|
|
||||||
require_once 'functions_acp/build_cfg_template.php';
|
|
||||||
require_once 'functions_acp/build_select.php';
|
|
||||||
require_once 'functions_acp/h_radio.php';
|
|
||||||
require_once 'functions_acp/validate_config_vars.php';
|
|
||||||
require_once 'functions_acp/validate_range.php';
|
|
||||||
|
|
||||||
class phpbb_functions_acp_all_tests
|
|
||||||
{
|
|
||||||
public static function main()
|
|
||||||
{
|
|
||||||
PHPUnit_TextUI_TestRunner::run(self::suite());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function suite()
|
|
||||||
{
|
|
||||||
$suite = new PHPUnit_Framework_TestSuite('phpBB Network Functions');
|
|
||||||
|
|
||||||
$suite->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();
|
|
||||||
}
|
|
|
@ -7,9 +7,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'test_framework/framework.php';
|
require_once dirname(__FILE__) . 'user_mock.php';
|
||||||
require_once 'functions_acp/user_mock.php';
|
require_once dirname(__FILE__) . '../../phpBB/includes/functions_acp.php';
|
||||||
require_once '../phpBB/includes/functions_acp.php';
|
|
||||||
|
|
||||||
class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
|
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;
|
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));
|
$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;
|
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));
|
$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;
|
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));
|
$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;
|
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));
|
$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;
|
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));
|
$this->assertEquals($expected, build_cfg_template($tpl_type, $key, $new, $config_key, $vars));
|
||||||
}
|
}
|
|
@ -7,9 +7,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'test_framework/framework.php';
|
require_once dirname(__FILE__) . 'user_mock.php';
|
||||||
require_once 'functions_acp/user_mock.php';
|
require_once dirname(__FILE__) . '../../phpBB/includes/functions_acp.php';
|
||||||
require_once '../phpBB/includes/functions_acp.php';
|
|
||||||
|
|
||||||
class phpbb_functions_acp_built_select_test extends phpbb_test_case
|
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;
|
global $user;
|
||||||
|
|
||||||
$user->lang =new phpbb_mock_lang();
|
$user->lang = new phpbb_mock_lang();
|
||||||
|
|
||||||
$this->assertEquals($expected, build_select($option_ary, $option_default));
|
$this->assertEquals($expected, build_select($option_ary, $option_default));
|
||||||
}
|
}
|
|
@ -7,9 +7,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'test_framework/framework.php';
|
require_once dirname(__FILE__) . 'user_mock.php';
|
||||||
require_once 'functions_acp/user_mock.php';
|
require_once dirname(__FILE__) . '../../phpBB/includes/functions_acp.php';
|
||||||
require_once '../phpBB/includes/functions_acp.php';
|
|
||||||
|
|
||||||
class phpbb_functions_acp_h_radio_test extends phpbb_test_case
|
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;
|
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));
|
$this->assertEquals($expected, h_radio($name, $input_ary, $input_default, $id, $key));
|
||||||
}
|
}
|
|
@ -7,9 +7,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'test_framework/framework.php';
|
require_once dirname(__FILE__) . 'user_mock.php';
|
||||||
require_once 'functions_acp/user_mock.php';
|
require_once dirname(__FILE__) . '../../phpBB/includes/functions_acp.php';
|
||||||
require_once '../phpBB/includes/functions_acp.php';
|
|
||||||
|
|
||||||
class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case
|
class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case
|
||||||
{
|
{
|
|
@ -7,9 +7,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'test_framework/framework.php';
|
require_once dirname(__FILE__) . 'user_mock.php';
|
||||||
require_once 'functions_acp/user_mock.php';
|
require_once dirname(__FILE__) . '../../phpBB/includes/functions_acp.php';
|
||||||
require_once '../phpBB/includes/functions_acp.php';
|
|
||||||
|
|
||||||
class phpbb_functions_acp_validate_range_test extends phpbb_test_case
|
class phpbb_functions_acp_validate_range_test extends phpbb_test_case
|
||||||
{
|
{
|
Loading…
Add table
Reference in a new issue