You are here

public function Twig_Test_NodeTestCase::assertNodeCompilation in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/lib/Twig/Test/NodeTestCase.php \Twig_Test_NodeTestCase::assertNodeCompilation()
1 call to Twig_Test_NodeTestCase::assertNodeCompilation()
Twig_Test_NodeTestCase::testCompile in vendor/twig/twig/lib/Twig/Test/NodeTestCase.php
@dataProvider getTests

File

vendor/twig/twig/lib/Twig/Test/NodeTestCase.php, line 23

Class

Twig_Test_NodeTestCase

Code

public function assertNodeCompilation($source, Twig_Node $node, Twig_Environment $environment = null, $isPattern = false) {
  $compiler = $this
    ->getCompiler($environment);
  $compiler
    ->compile($node);
  if ($isPattern) {
    $this
      ->assertStringMatchesFormat($source, trim($compiler
      ->getSource()));
  }
  else {
    $this
      ->assertEquals($source, trim($compiler
      ->getSource()));
  }
}