當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。