Re: Code Testing

From: Date: Fri, 04 Feb 2005 22:48:46 +0000
Subject: Re: Code Testing
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-17395@lists.php.net to get a copy of this message
Hi Michael Am Freitag, 4. Februar 2005 23:10 schrieb Michael Caplan: > I am currently in the process of figuring out the best method for > testin g PHP libraries, and (as per usual when it comes to best > coding practices) I turn to see what the PEAR folks are doing in > this area. The testing applications that I have been looking into > includes PEAR's PHPUnit, Simple Test, and the .phpt method (which I > don't know what to call). I was surprised to see that of the > several PEAR packages I looked at there is no standard amongst > them (or at least their appears that their is not). Is this > something that is in the fold for PEAR, or does PEAR have no > preference to testing? I assume that PEAR is concerned about > providing a consisting manner for testing packages (with the new QA > group). Considering that much of my work these days draws heavily > from PEAR, I would like to implement a test method that works well > with PEAR packages as well. I am going through the same process of thinking as you at the moment. After reading Harry Fuecks book on advenaced PHP5 (don't know the English name of that book...), I found, that unit testing would be also good for me... ;-) I strugled over simpletest and PEAR's PHPUnit as well. I really like PHPUnit2, since it seems to be quite mature. Anyway, I like the idea of simpletest with its auto-generated mock-object as well. As far as I could find out, simpletest is not strictly php5 :-( On the other hand, simpletest implements mock-object which PHPUnit2 does not :-( (AFAIK...). So I am about to get more information on mock-object, that I maybe could implement for PHPUnit2. It seems like there is already work in progress to implement mock's in PHPUnit2 by Sebastian (I found a class PHPUnit2_Tests_MockRunner in the Tests directory, but I cannot find the sens with it...) I also think I found out, that the other pear-packages do not use unitest that much, by running (or the test-code is not delivered with the packages) : ~> find /opt/lampp/lib/php/ -type f | xargs grep -nH PHPUnit2_Framework_TestCase ...does not give that much output... Hope there is some guys knowing more about these open questions... -- Cheers! Marco

« previous php.pear.general (#17395) next »