Example #1
0
 protected function getEnvironment()
 {
     if (version_compare(phpversion(), '5.3.0', '>=')) {
         return include 'PHP53/TestInclude.php';
     }
     return parent::getEnvironment();
 }
Example #2
0
 protected function getEnvironment()
 {
     if (PHP_VERSION_ID >= 50300) {
         return include 'PHP53/FunctionInclude.php';
     }
     return parent::getEnvironment();
 }
Example #3
0
 /**
  * @covers Twig_Node_Expression_Filter::compile
  * @dataProvider getTests
  */
 public function testCompile($node, $source, $environment = null)
 {
     parent::testCompile($node, $source, $environment);
     $expr = new Twig_Node_Expression_Constant('foo', 0);
     $node = $this->createFilter($expr, 'foobar', array(new Twig_Node_Expression_Constant('bar', 0), new Twig_Node_Expression_Constant('foobar', 0)));
     try {
         $node->compile($this->getCompiler());
         $this->fail();
     } catch (Exception $e) {
         $this->assertEquals('Twig_Error_Syntax', get_class($e));
     }
 }
Example #4
0
 /**
  * @covers Twig_Node_Expression_Unary_Not::compile
  * @covers Twig_Node_Expression_Unary_Not::operator
  * @dataProvider getTests
  */
 public function testCompile($node, $source, $environment = null)
 {
     parent::testCompile($node, $source, $environment);
 }
 /**
  * @covers Twig_Node_Block::compile
  * @dataProvider getTests
  */
 public function testCompile($node, $source, $environment = null, $isPattern = false)
 {
     parent::testCompile($node, $source, $environment, $isPattern);
 }