|
From: SourceForge.net <no...@so...> - 2011-04-28 09:00:46
|
Bugs item #2798170, was opened at 2009-05-29 01:26 Message generated for change (Settings changed) made by pp11 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=547455&aid=2798170&group_id=76550 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Unit test framework Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) >Assigned to: Perrick Penet (pp11) Summary: PHP assertIsA using gettype() instead of is_*() Initial Comment: http://php.net warns that gettype has performance problems and recommends to use the is_ functions. That asside, there are more possibilities with is_, e.g. is_float, is_real, is_double (which are hard coded special cases in simpletest) and also is_numeric (helpful when i expect a number, but don't know if it'll be an integer or a double). for consideration (where testing against the type $type): $func='is_'.$type; if(is_callable($func)) return $func($compare); return false; ---------------------------------------------------------------------- >Comment By: Perrick Penet (pp11) Date: 2011-04-28 11:00 Message: The dependency upon gettype() was removed. We're now using is_*() functions. Thanks for the pointer. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=547455&aid=2798170&group_id=76550 |