mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/12143] Fix those tests
I always have to fix them.. :( PHPBB3-12143
This commit is contained in:
parent
ca17bc7187
commit
981bd8bed4
3 changed files with 11 additions and 6 deletions
|
@ -1133,7 +1133,7 @@ switch ($mode)
|
|||
|
||||
$template->assign_vars(array(
|
||||
'GROUP_DESC' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),
|
||||
'GROUP_NAME' => $group_helper->get_name($row['group_name']),
|
||||
'GROUP_NAME' => $group_helper->get_name($group_row['group_name']),
|
||||
'GROUP_COLOR' => $group_row['group_colour'],
|
||||
'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']],
|
||||
'GROUP_RANK' => $user_rank_data['title'],
|
||||
|
|
|
@ -45,15 +45,15 @@ class phpbb_group_helper_test extends phpbb_test_case
|
|||
public function test_get_name()
|
||||
{
|
||||
// They should be totally fine
|
||||
$this->assertEquals('Bots', 'Bots');
|
||||
$this->assertEquals('Some new group', 'new_group');
|
||||
$this->assertEquals('Should work', 'group_with_ümlauts');
|
||||
$this->assertEquals('Bots', $this->group_helper->get_name('Bots'));
|
||||
$this->assertEquals('Some new group', $this->group_helper->get_name('new_group'));
|
||||
$this->assertEquals('Should work', $this->group_helper->get_name('group_with_ümlauts'));
|
||||
|
||||
// This should fail (obviously)
|
||||
$this->assertNotEquals('They key does not contain uppercase letters', 'not_uppercase');
|
||||
$this->assertNotEquals('They key does not contain uppercase letters', $this->group_helper->get_name('not_uppercase'));
|
||||
|
||||
// The key doesn't exist so just return group name...
|
||||
$this->assertEquals('Awesome group', 'Awesome group');
|
||||
$this->assertEquals('Awesome group', $this->group_helper->get_name('Awesome group'));
|
||||
}
|
||||
|
||||
protected function get_test_language_data_set()
|
||||
|
|
|
@ -49,6 +49,11 @@ class phpbb_notification_group_request_test extends phpbb_tests_notification_bas
|
|||
$this->user,
|
||||
$this->cache->get_driver()
|
||||
));
|
||||
$this->container->set('group_helper', new \phpbb\group\helper(
|
||||
new \phpbb\language\language(
|
||||
new phpbb\language\language_file_loader($phpbb_root_path, $phpEx)
|
||||
)
|
||||
));
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
|
||||
$phpbb_log = new \phpbb\log\dummy();
|
||||
$this->get_test_case_helpers()->set_s9e_services();
|
||||
|
|
Loading…
Add table
Reference in a new issue