Example #1
0
 /**
  * Tests white-listing of methods doesn't interfere with chaining.
  */
 public function testWhiteListChaining()
 {
     $node = Node::create(['type' => 'page', 'title' => 'Some node mmk', 'status' => 1, 'field_term' => $this->term->id()]);
     $node->save();
     $this->setRawContent(twig_render_template(drupal_get_path('theme', 'test_theme') . '/templates/node.html.twig', ['node' => $node]));
     $this->assertText('Sometimes people are just jerks');
 }
 /**
  * Loads a static template block.
  *
  * @param Twig_Environment $env
  *   The twig environment instance.
  * @param array $context
  *   An array of parameters passed to the template.
  */
 public function static_block(\Twig_Environment $env, array $context, $static_block_name, $variables = array())
 {
     return [['#markup' => twig_render_template(\Drupal::theme()->getActiveTheme()->getPath() . '/templates/static/' . $static_block_name . '.html.twig', array_merge($context, $variables, ['theme_hook_original' => '']))]];
 }
Example #3
0
<?php

$copy = \Drupal\Core\Site\Settings::getAll();
$copy['php_storage']['twig']['class'] = "Drupal\\Component\\PhpStorage\\FileStorage";
$foo = new \Drupal\Core\Site\Settings($copy);
require_once "core/themes/engines/twig/twig.engine";
while ($f = trim(fgets(STDIN))) {
    if (stripos($f, 'tests') === FALSE) {
        twig_render_template(substr($f, 2), []);
    }
}