1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-02 12:34:59 +02:00

[ticket/13713] Add mention_helper for testing in helpers

PHPBB3-13713
This commit is contained in:
lavigor 2018-08-02 22:11:48 +03:00 committed by Marc Alexander
parent e3cee76077
commit 224d753414
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -579,6 +579,9 @@ class phpbb_test_case_helpers
}
$user->add_lang('common');
// Get an auth interface
$auth = ($container->has('auth')) ? $container->get('auth') : new \phpbb\auth\auth;
// Create and register a quote_helper
$quote_helper = new \phpbb\textformatter\s9e\quote_helper(
$container->get('user'),
@ -587,6 +590,16 @@ class phpbb_test_case_helpers
);
$container->set('text_formatter.s9e.quote_helper', $quote_helper);
// Create and register a mention_helper
$mention_helper = new \phpbb\textformatter\s9e\mention_helper(
$db_driver,
$auth,
$container->get('user'),
$phpbb_root_path,
$phpEx
);
$container->set('text_formatter.s9e.mention_helper', $mention_helper);
// Create and register the text_formatter.s9e.parser service and its alias
$parser = new \phpbb\textformatter\s9e\parser(
$cache,
@ -607,8 +620,8 @@ class phpbb_test_case_helpers
);
// Calls configured in services.yml
$auth = ($container->has('auth')) ? $container->get('auth') : new \phpbb\auth\auth;
$renderer->configure_quote_helper($quote_helper);
$renderer->configure_mention_helper($mention_helper);
$renderer->configure_smilies_path($config, $path_helper);
$renderer->configure_user($user, $config, $auth);