Changeset 6129
- Timestamp:
- 11/21/07 11:06:02 (10 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
r4750 r6129 334 334 if (!$form = $xpath->query(sprintf('//input[((@type="submit" or @type="button") and @value="%s") or (@type="image" and @alt="%s")]/ancestor::form', $name, $name))->item(0)) 335 335 { 336 throw new sfException(sprintf('Cannot find the "%s" link or button.', $name)); 336 if (!$form = $xpath->query(sprintf('//button[.="%s" or @id="%s" or @name="%s"]/ancestor::form', $name, $name, $name))->item(0)) 337 { 338 throw new sfException(sprintf('Cannot find the "%s" link or button.', $name)); 339 } 337 340 } 338 341 branches/1.0/test/unit/util/sfBrowserTest.php
r3277 r6129 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(4 2, new lime_output_color());13 $t = new lime_test(43, new lime_output_color()); 14 14 15 15 // ->click() … … 93 93 </span></div> 94 94 </form> 95 96 <form action="/myform5"> 97 <div><span> 98 <button id="submit5">Click</button> 99 <input type="image" src="myimage.png" alt="image submit" name="submit_image" value="image" /> 100 </span></div> 101 </form> 95 102 </body> 96 103 </html> … … 108 115 $t->pass('->click() throws an error if the name does not exist'); 109 116 } 117 118 try 119 { 120 list($method, $uri, $parameters) = $b->click('submit5'); 121 $t->pass('->click() clicks on button links'); 122 } 123 catch(Exception $e) 124 { 125 $t->fail('->click() clicks on button links'); 126 } 127 110 128 111 129 list($method, $uri, $parameters) = $b->click('test link');