mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/11768] Added methods to access the library's parser/renderer
PHPBB3-11768
This commit is contained in:
parent
414dcae422
commit
c1ba3a678d
4 changed files with 35 additions and 0 deletions
|
@ -191,6 +191,16 @@ class parser extends \phpbb\textformatter\parser
|
|||
return array_unique($errors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the instance of s9e\TextFormatter\Parser used by this object
|
||||
*
|
||||
* @return s9e\TextFormatter\Parser
|
||||
*/
|
||||
public function get_parser()
|
||||
{
|
||||
return $this->parser;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
@ -121,6 +121,16 @@ class renderer extends \phpbb\textformatter\renderer
|
|||
$this->renderer->setParameter('STYLE_ID', $user->style['style_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the instance of s9e\TextFormatter\Renderer used by this object
|
||||
*
|
||||
* @return s9e\TextFormatter\Renderer
|
||||
*/
|
||||
public function get_renderer()
|
||||
{
|
||||
return $this->renderer;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
*/
|
||||
require_once __DIR__ . '/../../../phpBB/includes/functions.php';
|
||||
require_once __DIR__ . '/../../../phpBB/includes/functions_content.php';
|
||||
require_once __DIR__ . '/../../mock/user.php';
|
||||
require_once __DIR__ . '/../../mock/cache.php';
|
||||
|
||||
|
@ -164,4 +165,11 @@ class phpbb_textformatter_s9e_parser_test extends phpbb_test_case
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function test_get_parser()
|
||||
{
|
||||
$container = $this->get_test_case_helpers()->set_s9e_services();
|
||||
$parser = $container->get('text_formatter.parser');
|
||||
$this->assertInstanceOf('s9e\\TextFormatter\\Parser', $parser->get_parser());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -353,4 +353,11 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_get_renderer()
|
||||
{
|
||||
$container = $this->get_test_case_helpers()->set_s9e_services();
|
||||
$renderer = $container->get('text_formatter.renderer');
|
||||
$this->assertInstanceOf('s9e\\TextFormatter\\Renderer', $renderer->get_renderer());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue