PHPUnit bugs/fixes

From: Date: Mon, 12 Aug 2002 17:23:09 +0000
Subject: PHPUnit bugs/fixes
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-8331@lists.php.net to get a copy of this message
i was using PHPUnit for some testing, 2 problems occured comparing arrays using
    serialize($expected) != serilaize($actual)
is not succedding because of 1. the order of the keys is not the same
    ksort($expected);
    ksort($actual);
    serialize($expected) != serilaize($actual)
this helps 2.
    even if the values are the same the types might not be
    see:
    a:6:{s:10:"address_id";i:0;    s:10:"company_id";i:0;  ...
    a:6:{s:10:"address_id";s:1:"0";s:10:"company_id";s:1:"0";  ...
    one solutions would be
    the array has to be foreach'ed to set all the types to 'string'
    and compare it then, that should work
any easier ways? -- Wolfram ... translating template engine .... http://sf.net/projects/simpletpl ... authentication system .... http://sf.net/projects/auth

« previous php.pear.dev (#8331) next »