/** * @dataProvider getTestsForForOptimizer */ public function testForOptimizer($template, $expected) { $env = new Apishka_Templater_Environment($this->createMock('Apishka_Templater_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 ' : '')); } }