instance = new TwigRenderer(static::$path);
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*
* @return void
*/
protected function tearDown(): void
{
}
/**
* Method to test render().
*
* @return void
*
* @covers \Windwalker\Renderer\TwigRenderer::render
*/
public function testRender()
{
$html = $this->instance->render('default');
$expect = <<
(_global/global) Lorem ipsum dolor sit amet
(default) Nulla sed libero sem. Praesent ac dignissim risus.
(foo/bar) Phasellus vitae bibendum neque, quis suscipit urna. Fusce eu odio ante.
(_global/global) Suspendisse finibus fermentum massa ut tempus.
HTML;
$this->assertDomStringEqualsDomString($expect, $html);
}
/**
* Method to test render().
*
* @return void
*
* @covers \Windwalker\Renderer\TwigRenderer::render
*/
public function testRenderWithDotPath()
{
$this->instance->config->set('path_separator', '.');
$html = $this->instance->render('default_dot');
$expect = <<
(_global/global) Lorem ipsum dolor sit amet
(default) Nulla sed libero sem. Praesent ac dignissim risus.
(foo/bar) Phasellus vitae bibendum neque, quis suscipit urna. Fusce eu odio ante.
(_global/global) Suspendisse finibus fermentum massa ut tempus.