You are here

public function TwigWhiteListTest::testWhiteListChaining in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Theme/TwigWhiteListTest.php \Drupal\system\Tests\Theme\TwigWhiteListTest::testWhiteListChaining()

Tests white-listing of methods doesn't interfere with chaining.

File

core/modules/system/src/Tests/Theme/TwigWhiteListTest.php, line 118
Contains \Drupal\system\Tests\Theme\TwigWhiteListTest.php.

Class

TwigWhiteListTest
Tests white-listing of entity properties.

Namespace

Drupal\system\Tests\Theme

Code

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');
}