[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/wact/tests/cases/component/form/ -> WactTextAreaComponentTest.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/tests/cases/WactTemplateTestCase.class.php');
  11  require_once('limb/wact/src/components/form/form.inc.php');
  12  
  13  class WactTextAreaComponentTest extends WactTemplateTestCase
  14  {
  15    protected $text_area;
  16    protected $form;
  17  
  18    function setUp()
  19    {
  20      parent :: setUp();
  21  
  22      $this->form = new WactFormComponent('test_form');
  23      $this->text_area = new WactTextAreaComponent('my_text_area');
  24      $this->form->addChild($this->text_area);
  25    }
  26  
  27    function testRenderContents()
  28    {
  29      $this->form->set('my_text_area', 'foo');
  30  
  31      ob_start();
  32      $this->text_area->renderContents();
  33      $out = ob_get_contents();
  34      ob_end_clean();
  35  
  36      $this->assertEqual($out, 'foo');
  37    }
  38  
  39    function testRenderEscapesHtmlEntities()
  40    {
  41      $this->form->set('my_text_area', 'x < y > z & a');
  42  
  43      ob_start();
  44      $this->text_area->renderContents();
  45      $out = ob_get_contents();
  46      ob_end_clean();
  47  
  48      $this->assertEqual($out, 'x &lt; y &gt; z &amp; a');
  49    }
  50  }
  51  ?>


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