public function assertTwigTemplate($value, string
$message = ''
): void
{ $this->
assertInstanceOf(TemplateWrapper::
class,
$value,
$message);
} /**
* Tests template discovery using namespaces.
*/
public function testTemplateDiscovery() { // Tests resolving namespaced templates in modules.
$this->
assertTwigTemplate($this->twig->
load('@node/node.html.twig'
), 'Found node.html.twig in node module.'
);
// Tests resolving namespaced templates in themes.
$this->
assertTwigTemplate($this->twig->
load('@olivero/layout/page.html.twig'
), 'Found page.html.twig in Olivero theme.'
);
} /**
* Tests template extension and includes using namespaces.
*/
public function testTwigNamespaces() { // Test twig @extends and @include in template files.
$test =
['#theme' => 'twig_namespace_test'
];