[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/wact/tests/cases/compiler/attribute/ -> WactAttributeLiteralFragmentTest.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  
  10  require_once 'limb/wact/src/compiler/templatecompiler.inc.php';
  11  require_once 'limb/wact/src/compiler/attribute/WactAttributeLiteralFragment.class.php';
  12  
  13  class WactAttributeLiteralFragmentTest extends UnitTestCase
  14  {
  15    function testIsConstant()
  16    {
  17      $attribute =  new WactAttributeLiteralFragment('value');
  18      $this->assertTrue($attribute->isConstant());
  19    }
  20  
  21    function testGetValue()
  22    {
  23      $attribute = new WactAttributeLiteralFragment('value');
  24      $this->assertEqual($attribute->getValue(), 'value');
  25    }
  26  
  27    function testGetValueNull()
  28    {
  29      $Attribute = new WactAttributeLiteralFragment(NULL);
  30      $this->assertIdentical($Attribute->getValue(), NULL);
  31    }
  32  
  33    function testGenerateFragment()
  34    {
  35      $code_writer = new WactCodeWriter();
  36      $attribute =  new WactAttributeLiteralFragment('value');
  37      $attribute->generateFragment($code_writer);
  38      $this->assertEqual($code_writer->renderCode(), 'value');
  39    }
  40  
  41    function testGenerateExpression()
  42    {
  43      $code_writer = new WactCodeWriter();
  44      $attribute =  new WactAttributeLiteralFragment('value');
  45      $attribute->generatePreStatement($code_writer);
  46      $attribute->generateExpression($code_writer);
  47      $attribute->generatePostStatement($code_writer);
  48      $this->assertEqual($code_writer->renderCode(), "<?php 'value' ?>");
  49    }
  50  }
  51  ?>


Generated: Thu Jan 8 04:06:23 2009 Cross-referenced by PHPXref 0.7