public function Twig_Tests_NodeVisitor_OptimizerTest::testForOptimizer in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php \Twig_Tests_NodeVisitor_OptimizerTest::testForOptimizer()
@dataProvider getTestsForForOptimizer
File
- vendor/
twig/ twig/ test/ Twig/ Tests/ NodeVisitor/ OptimizerTest.php, line 55
Class
Code
public function testForOptimizer($template, $expected) {
$env = new Twig_Environment($this
->getMock('Twig_LoaderInterface'), array(
'cache' => false,
));
$stream = $env
->parse($env
->tokenize($template, 'index'));
foreach ($expected as $target => $withLoop) {
$this
->assertTrue($this
->checkForConfiguration($stream, $target, $withLoop), sprintf('variable %s is %soptimized', $target, $withLoop ? 'not ' : ''));
}
}