Changeset 11021 for branches/1.0
- Timestamp:
- 08/21/08 17:34:34 (3 months ago)
- Files:
-
- branches/1.0/lib/util/sfBrowser.class.php (modified) (1 diff)
- branches/1.0/test/unit/util/sfBrowserTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/lib/util/sfBrowser.class.php
r10950 r11021 362 362 if ($element->getAttribute('checked')) 363 363 { 364 $value = $element-> getAttribute('value');364 $value = $element->hasAttribute('value') ? $element->getAttribute('value') : '1'; 365 365 } 366 366 } branches/1.0/test/unit/util/sfBrowserTest.php
r10950 r11021 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(4 4, new lime_output_color());13 $t = new lime_test(46, new lime_output_color()); 14 14 15 15 // ->click() … … 68 68 <input name="myarray[]" value="value2" /> 69 69 <input name="myarray[]" value="value3" /> 70 <input type="checkbox" name="checkbox1" value="checkboxvalue" checked="checked" /> 71 <input type="checkbox" name="checkbox2" checked="checked" /> 70 72 <input type="button" name="mybutton" value="mybuttonvalue" /> 71 73 <input type="submit" name="submit" value="submit" /> … … 147 149 $t->ok(!isset($parameters['mybutton']), '->click() do not populate buttons not clicked'); 148 150 $t->is($parameters['myarray'], array('value1', 'value2', 'value3'), '->click() recognizes array names'); 151 $t->is($parameters['checkbox1'], 'checkboxvalue', '->click() returns the value of the checkbox value attribute'); 152 $t->is($parameters['checkbox2'], '1', '->click() returns 1 if the checkbox has no value'); 149 153 150 154 list($method, $uri, $parameters) = $b->click('mybuttonvalue');