TwigLoaderTest.php in Zircon Profile 8
File
core/modules/system/src/Tests/Theme/TwigLoaderTest.php
View source
<?php
namespace Drupal\system\Tests\Theme;
use Drupal\simpletest\WebTestBase;
class TwigLoaderTest extends WebTestBase {
public static $modules = [
'twig_loader_test',
];
public function testTwigLoaderAddition() {
$environment = \Drupal::service('twig');
$template = $environment
->loadTemplate('kittens');
$this
->assertEqual($template
->render(array()), 'kittens', 'Passing "kittens" to the custom Twig loader returns "kittens".');
$template = $environment
->loadTemplate('meow');
$this
->assertEqual($template
->render(array()), 'cats', 'Passing something other than "kittens" to the custom Twig loader returns "cats".');
}
}