| [ Index ] |
PHP Cross Reference of Web Application Component Toolkit |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @package WACT_TESTS 4 * @version $Id: inputtext.test.php,v 1.3 2004/11/17 00:41:37 jeffmoore Exp $ 5 */ 6 /** 7 * Includes 8 */ 9 require_once WACT_ROOT . 'template/template.inc.php'; 10 require_once WACT_ROOT . 'template/components/form/form.inc.php'; 11 12 require_once TEST_CASES.'/template/components.test.php'; 13 14 /** 15 * @package WACT_TESTS 16 */ 17 class InputTextComponentTestCase extends TagComponentTestCase { 18 19 function InputTextComponentTestCase ($name = 'InputTextComponentTestCase') { 20 $this->UnitTestCase($name); 21 } 22 23 function testValue() { 24 25 $Template = '<form id="testForm" runat="server"> 26 <input type="text" id="test" name="myInput" value="Hello World" runat="server"> 27 </form>'; 28 RegisterTestingTemplate('/components/form/inputtext/value.html', $Template); 29 30 $Page =& new Template('/components/form/inputtext/value.html'); 31 32 $Form =& $Page->getChild('testForm'); 33 34 $Input =& $Page->getChild('test'); 35 36 $this->assertEqual($Input->getAttribute('value'),'Hello World'); 37 38 } 39 40 function testSetValueByName() { 41 42 $Template = '<form id="testForm" runat="server"> 43 <input type="text" id="test" name="myInput" runat="server"> 44 </form>'; 45 RegisterTestingTemplate('/components/form/inputtext/setvaluebyname.html', $Template); 46 47 $Page =& new Template('/components/form/inputtext/setvaluebyname.html'); 48 49 $Form =& $Page->getChild('testForm'); 50 51 $data =& new DataSpace(); 52 $data->set('myInput','Hello World'); 53 54 $Form->registerDataSource($data); 55 56 $Input =& $Page->getChild('test'); 57 58 $this->assertEqual($Input->getValue(),'Hello World'); 59 60 // Fails - see feature request 973071 61 // $this->assertEqual($Input->getAttribute('value'),'Hello World'); 62 63 } 64 65 66 } 67 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Sun Nov 28 19:36:09 2004 | Cross-referenced by PHPXref 0.5 |