|
From: Chris C. <ch...@w3...> - 2010-04-22 09:19:09
|
You need to use assertIdentical() if you're looking to check types too. PHP considers 0, "", null, false (and others) equal. e: ch...@w3... t (en): http://twitter.com/d11wtq t (it): http://twitter.com/cosadici Il giorno 22/apr/2010, alle ore 18.12, Nicolas Terray ha scritto: > On Thu, Apr 22, 2010 at 9:52 AM, <min...@fr...> wrote: >> I'm trying to test a variable like this : >> $a = 0; >> assertFalse($a); >> >> The problem is that $a is not false, but an integer equal to 0. >> Could the assert method use === instead of a simple == ? >> >> Something like : return $compare === false; >> Instead of : return ! (boolean)$compare; > > > I disagree since 0 is equal to false (as well as '', null, ...) in PHP > > Maybe you should use assertIdentical($a, false) instead ? > > Yours, > Nicolas Terray > > ------------------------------------------------------------------------------ > _______________________________________________ > Simpletest-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpletest-support |