| [ Index ] |
PHP Cross Reference of Limb3 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 * Limb PHP Framework 4 * 5 * @link http://limb-project.com 6 * @copyright Copyright © 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/components/form/form.inc.php'; 11 require_once 'limb/wact/src/components/form/WactOptionRenderer.class.php'; 12 13 class WactOptionRendererTest extends UnitTestCase 14 { 15 protected $renderer; 16 17 function setUp() 18 { 19 $this->renderer= new WactOptionRenderer(); 20 } 21 22 function testRender() 23 { 24 ob_start(); 25 $this->renderer->renderOption('foo','bar',FALSE); 26 $out = ob_get_contents(); 27 ob_end_clean(); 28 $this->assertEqual($out,'<option value="foo">bar</option>'); 29 } 30 31 function testRenderNoContents() 32 { 33 ob_start(); 34 $this->renderer->renderOption('foo','',$selected = FALSE); 35 $out = ob_get_contents(); 36 ob_end_clean(); 37 $this->assertEqual($out,'<option value="foo">foo</option>'); 38 } 39 40 function testRenderEntities() 41 { 42 ob_start(); 43 $this->renderer->renderOption('x > y','& v < z',$selected = FALSE); 44 $out = ob_get_contents(); 45 ob_end_clean(); 46 $this->assertEqual($out,'<option value="x > y">& v < z</option>'); 47 } 48 49 function testRenderEntitiesNoContents() 50 { 51 ob_start(); 52 $this->renderer->renderOption('x > y', FALSE, $selected = FALSE); 53 $out = ob_get_contents(); 54 ob_end_clean(); 55 $this->assertEqual($out,'<option value="x > y">x > y</option>'); 56 } 57 58 function testSelected() 59 { 60 ob_start(); 61 $this->renderer->renderOption('foo','bar',TRUE); 62 $out = ob_get_contents(); 63 ob_end_clean(); 64 $this->assertEqual($out,'<option value="foo" selected="true">bar</option>'); 65 } 66 } 67 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Jan 8 04:06:23 2009 | Cross-referenced by PHPXref 0.7 |