Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.4

Bug #14317 Testing_Selenium::getString() improperly returns exception
Submitted: 2008-07-09 18:25 UTC
From: wmoran Assigned: shin
Status: Closed Package: Testing_Selenium (version 0.4.2)
PHP Version: 5.2.6 OS: FreeBSD
Roadmaps: (Not assigned)    
Subscription  


 [2008-07-09 18:25 UTC] wmoran (Bill Moran)
Description: ------------ The function getString() improperly _returns_ an exception instead of _throwing_ it. This causes grief for anyone trying to catch the exception, as it ends up in the return value, where it doesn't belong. Function definition: private function getString($verb, $args = array()) { try { $result = $this->doCommand($verb, $args); } catch (Testing_Selenium_Exception $e) { return $e; } return (strlen($result) > 3) ? substr($result, 3) : ''; } Since it does nothing with the caught exception, it seems to me that this could be: private function getString($verb, $args = array()) { $result = $this->doCommand($verb, $args); return (strlen($result) > 3) ? substr($result, 3) : ''; }

Comments

 [2008-07-10 23:34 UTC] shin (Shin Ohno)
Thanks Bill, I think you are right, and try catch cause statement there should not be here. I will fix it soon in next release.
 [2008-07-15 17:25 UTC] shin (Shin Ohno)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Testing_Selenium Fixed in 0.4.3. Please use the version above 0.4.3. Thanks,