当前位置: 首页>>代码示例>>PHP>>正文


PHP Twig_Tests_Node_TestCase类代码示例

本文整理汇总了PHP中Twig_Tests_Node_TestCase的典型用法代码示例。如果您正苦于以下问题:PHP Twig_Tests_Node_TestCase类的具体用法?PHP Twig_Tests_Node_TestCase怎么用?PHP Twig_Tests_Node_TestCase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Twig_Tests_Node_TestCase类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCompile

 /**
  * @covers Twig_Node_Trans::compile
  * @covers Twig_Node_Trans::compileString
  * @dataProvider getTests
  */
 public function testCompile($node, $source, $environment = null)
 {
     parent::testCompile($node, $source, $environment);
     $body = new Twig_Node(array(new Twig_Node_Expression_Constant('Hello', 0)), array(), 0);
     $node = new Twig_Node_Trans(null, $body, null, 0);
     try {
         $node->compile($this->getCompiler());
         $this->fail();
     } catch (Exception $e) {
         $this->assertEquals('Twig_SyntaxError', get_class($e));
     }
 }
开发者ID:sbbowers,项目名称:Twig,代码行数:17,代码来源:TransTest.php

示例2: testCompile

 /**
  * @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));
     }
 }
开发者ID:gembux2012,项目名称:lesson2_1,代码行数:16,代码来源:FilterTest.php

示例3: testCompile

 /**
  * @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);
     $filters = new Twig_Node(array(new Twig_Node_Expression_Constant('foobar', 0), new Twig_Node(array(new Twig_Node_Expression_Constant('bar', 0), new Twig_Node_Expression_Constant('foobar', 0)))), array(), 0);
     $node = new Twig_Node_Expression_Filter($expr, $filters, 0);
     $tests[] = array($node, '$this->resolveMissingFilter("foobar", array("foo", "bar", "foobar"))');
     try {
         $node->compile($this->getCompiler());
         $this->fail();
     } catch (Exception $e) {
         $this->assertEquals('Twig_SyntaxError', get_class($e));
     }
 }
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:18,代码来源:FilterTest.php

示例4: testCompile

 /**
  * @covers Twig_Node_Expression_Conditional::compile
  * @dataProvider getTests
  */
 public function testCompile($node, $source, $environment = null)
 {
     parent::testCompile($node, $source, $environment);
 }
开发者ID:BGCX067,项目名称:fajr-svn-to-git,代码行数:8,代码来源:ConditionalTest.php


注:本文中的Twig_Tests_Node_TestCase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。