public function Twig_Test_NodeTestCase::assertNodeCompilation in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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
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()));
}
}