| [ 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/tests/cases/WactTemplateTestCase.class.php'); 11 12 class WactLabelTagTest extends WactTemplateTestCase { 13 14 var $Control; 15 16 function testErrorClass() { 17 18 $template = '<form runat="server"> 19 <label id="test" errorclass="warning" runat="server">A label</label> 20 </form>'; 21 $this->registerTestingTemplate('/tags/form/label/errorclass.html', $template); 22 23 $page = $this->initTemplate('/tags/form/label/errorclass.html'); 24 $Label = $page->findChild('test'); 25 $Label->setError(); 26 $this->assertEqual('warning',$Label->getAttribute('class')); 27 } 28 29 function testErrorStyle() { 30 31 $template = '<form runat="server"> 32 <label id="test" errorstyle="warning" runat="server">A label</label> 33 </form>'; 34 $this->registerTestingTemplate('/tags/form/label/errorstyle.html', $template); 35 36 $page = $this->initTemplate('/tags/form/label/errorstyle.html'); 37 $Label = $page->findChild('test'); 38 $Label->setError(); 39 $this->assertEqual('warning',$Label->getAttribute('style')); 40 41 } 42 43 function testSetError() { 44 45 $template = '<form id="testForm" runat="server"> 46 <label id="test" class="Normal" style="Normal" 47 errorclass="ErrorClass" errorstyle="ErrorStyle" runat="server"> 48 </label> 49 </form>'; 50 $this->registerTestingTemplate('/components/form/label/seterror.html', $template); 51 52 $page = $this->initTemplate('/components/form/label/seterror.html'); 53 54 $Label = $page->getChild('test'); 55 $this->assertEqual('Normal',$Label->getAttribute('class')); 56 $this->assertEqual('Normal',$Label->getAttribute('style')); 57 $Label->setError(); 58 $this->assertEqual('ErrorClass',$Label->getAttribute('class')); 59 $this->assertEqual('ErrorStyle',$Label->getAttribute('style')); 60 61 } 62 63 64 } 65 ?>
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 |