public function testFrontMatter($yaml,
$line,
$content = ComponentFrontMatterTest::SOURCE
) { // Create a temporary Twig template.
$source = ComponentFrontMatterTest::
createFrontMatterSource($yaml,
$content);
$file =
$this->
createTwigTemplate($source);
$name =
basename($file);
// Ensure the proper metadata is returned.
$metadata =
$this->twig->
getTemplateMetadata($name);
$this->
assertEquals($yaml === NULL ?
[] :
$yaml,
$metadata);
// Ensure the metadata is never rendered.
$output =
$this->twig->
load($name)->
render();
$this->
assertEquals($content,
$output);