@dataProvider getTestsForForOptimizer
public function testForOptimizer($template, $expected) {
$env = new Twig_Environment(new Twig_Loader_String(), 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 ' : ''));
}
}