mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/11824] Reorganize test file
PHPBB3-11824
This commit is contained in:
parent
6f4ad0bcfa
commit
2f91fc9f6c
1 changed files with 17 additions and 18 deletions
|
@ -40,6 +40,23 @@ class phpbb_controller_helper_url_test extends phpbb_test_case
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider helper_url_data_no_rewrite()
|
||||||
|
*/
|
||||||
|
public function test_helper_url_no_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
||||||
|
{
|
||||||
|
global $phpbb_dispatcher, $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
|
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
|
||||||
|
$this->user = $this->getMock('phpbb_user');
|
||||||
|
$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
|
||||||
|
|
||||||
|
// We don't use mod_rewrite in these tests
|
||||||
|
$config = new phpbb_config(array('enable_mod_rewrite' => '0'));
|
||||||
|
$helper = new phpbb_controller_helper($this->template, $this->user, $config, '', 'php');
|
||||||
|
$this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
|
||||||
|
}
|
||||||
|
|
||||||
public function helper_url_data_with_rewrite()
|
public function helper_url_data_with_rewrite()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
@ -68,23 +85,6 @@ class phpbb_controller_helper_url_test extends phpbb_test_case
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @dataProvider helper_url_data_no_rewrite()
|
|
||||||
*/
|
|
||||||
public function test_helper_url_no_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
|
|
||||||
{
|
|
||||||
global $phpbb_dispatcher, $phpbb_root_path, $phpEx;
|
|
||||||
|
|
||||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
|
|
||||||
$this->user = $this->getMock('phpbb_user');
|
|
||||||
$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
|
|
||||||
|
|
||||||
// We don't use mod_rewrite in tests
|
|
||||||
$config = new phpbb_config(array('enable_mod_rewrite' => '0'));
|
|
||||||
$helper = new phpbb_controller_helper($this->template, $this->user, $config, '', 'php');
|
|
||||||
$this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider helper_url_data_with_rewrite()
|
* @dataProvider helper_url_data_with_rewrite()
|
||||||
*/
|
*/
|
||||||
|
@ -96,7 +96,6 @@ class phpbb_controller_helper_url_test extends phpbb_test_case
|
||||||
$this->user = $this->getMock('phpbb_user');
|
$this->user = $this->getMock('phpbb_user');
|
||||||
$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
|
$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
|
||||||
|
|
||||||
// We don't use mod_rewrite in tests
|
|
||||||
$config = new phpbb_config(array('enable_mod_rewrite' => '1'));
|
$config = new phpbb_config(array('enable_mod_rewrite' => '1'));
|
||||||
$helper = new phpbb_controller_helper($this->template, $this->user, $config, '', 'php');
|
$helper = new phpbb_controller_helper($this->template, $this->user, $config, '', 'php');
|
||||||
$this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
|
$this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
|
||||||
|
|
Loading…
Add table
Reference in a new issue