Changeset 11020
- Timestamp:
- 08/21/08 17:32:42 (11 months ago)
- Files:
-
- branches/1.1/lib/util/sfBrowser.class.php (modified) (1 diff)
- branches/1.1/test/unit/util/sfBrowserTest.php (modified) (3 diffs)
- branches/1.2/lib/util/sfBrowser.class.php (modified) (1 diff)
- branches/1.2/test/unit/util/sfBrowserTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/util/sfBrowser.class.php
r10950 r11020 567 567 if ($element->getAttribute('checked')) 568 568 { 569 $value = $element-> getAttribute('value');569 $value = $element->hasAttribute('value') ? $element->getAttribute('value') : '1'; 570 570 } 571 571 } branches/1.1/test/unit/util/sfBrowserTest.php
r10950 r11020 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(5 1, new lime_output_color());13 $t = new lime_test(53, new lime_output_color()); 14 14 15 15 // ->click() … … 77 77 <input name="myarray[]" value="value3" /> 78 78 <input type="file" name="myfile" /> 79 <input type="checkbox" name="checkbox1" value="checkboxvalue" checked="checked" /> 80 <input type="checkbox" name="checkbox2" checked="checked" /> 79 81 <input type="button" name="mybutton" value="mybuttonvalue" /> 80 82 <input type="submit" name="submit" value="submit" /> … … 157 159 $t->ok(!isset($parameters['mybutton']), '->click() do not populate buttons not clicked'); 158 160 $t->is($parameters['myarray'], array('value1', 'value2', 'value3'), '->click() recognizes array names'); 161 $t->is($parameters['checkbox1'], 'checkboxvalue', '->click() returns the value of the checkbox value attribute'); 162 $t->is($parameters['checkbox2'], '1', '->click() returns 1 if the checkbox has no value'); 159 163 160 164 list($method, $uri, $parameters) = $b->click('mybuttonvalue'); branches/1.2/lib/util/sfBrowser.class.php
r11019 r11020 631 631 if ($element->getAttribute('checked')) 632 632 { 633 $value = $element-> getAttribute('value');633 $value = $element->hasAttribute('value') ? $element->getAttribute('value') : '1'; 634 634 } 635 635 } branches/1.2/test/unit/util/sfBrowserTest.php
r11019 r11020 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(5 2, new lime_output_color());13 $t = new lime_test(54, new lime_output_color()); 14 14 15 15 // ->click() … … 77 77 <input name="myarray[]" value="value3" /> 78 78 <input type="file" name="myfile" /> 79 <input type="checkbox" name="checkbox1" value="checkboxvalue" checked="checked" /> 80 <input type="checkbox" name="checkbox2" checked="checked" /> 79 81 <input type="button" name="mybutton" value="mybuttonvalue" /> 80 82 <input type="submit" name="submit" value="submit" /> … … 162 164 $t->ok(!isset($parameters['mybutton']), '->click() do not populate buttons not clicked'); 163 165 $t->is($parameters['myarray'], array('value1', 'value2', 'value3'), '->click() recognizes array names'); 166 $t->is($parameters['checkbox1'], 'checkboxvalue', '->click() returns the value of the checkbox value attribute'); 167 $t->is($parameters['checkbox2'], '1', '->click() returns 1 if the checkbox has no value'); 164 168 165 169 list($method, $uri, $parameters) = $b->click('mybuttonvalue');

