Esempio n. 1
0
 /**
  * @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 ' : ''));
     }
 }
Esempio n. 2
0
 /**
  * @expectedException        Apishka_Templater_Error_Syntax
  * @expectedExceptionMessage The "block" function takes at least one argument (the variable and the attributes) in "index" at line 1.
  */
 public function testBlockNoArgs()
 {
     $env = new Apishka_Templater_Environment($this->createMock('Apishka_Templater_LoaderInterface'), array('cache' => false, 'autoescape' => false));
     $parser = new Apishka_Templater_Parser($env);
     $parser->parse($env->tokenize('{{ block() }}', 'index'));
 }