Simple Test or phpUnit
Moderator: General Moderators
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Simple Test or phpUnit
Which is better and why???
What does Zend use?
What does Zend use?
Last edited by alex.barylski on Mon Sep 04, 2006 3:47 pm, edited 1 time in total.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Edit: I've found there are indeed 2 versions of phpUnit the one on SF is the newbie??? I prefer the other as it has a O'Reilley cookbook
Ok, I've searched for both and have concluded there are at least seperate concurrent versions for phpUnit
One by a fellow named Sebastien(sp?) and the other which pops up as SF when Googled???
I like the Former as it's in version 3.0 but I cannot seem to find the URL to download or instructions, etc???
The SF version only appears to be in BETA???
WTF???
Ok, I've searched for both and have concluded there are at least seperate concurrent versions for phpUnit
One by a fellow named Sebastien(sp?) and the other which pops up as SF when Googled???
I like the Former as it's in version 3.0 but I cannot seem to find the URL to download or instructions, etc???
The SF version only appears to be in BETA???
WTF???
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
http://www.phpunit.de/Hockey wrote: Which one does Zend framework use? Seeing how I'm using ZF I might as well stick with convention...
Make sure you are installing PHPUnit2 though.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
SimpleTest is great except when you want to modify the reporting behaviour. But then PHPUnit doesn't have an HTML Reporter at all so there is a clear winner there.
Marcus is a really nice guy so I'm actually a little guilty I even tried PHPUnit now
I'm really looking forward to the PHP 5 version of SimpleTest because the current version doens't cut it with heavy OOP code atm without albeit minor tweakage.
This is essential:
Marcus is a really nice guy so I'm actually a little guilty I even tried PHPUnit now
I'm really looking forward to the PHP 5 version of SimpleTest because the current version doens't cut it with heavy OOP code atm without albeit minor tweakage.
This is essential:
Code: Select all
class BlahWhatever extends UnitTestCase {
// get the value of a private or protected property, properly and politey
static function expose($obj, $prop)
{
$reflection = new ReflectionClass($obj);
$prop = $reflection->getProperty($prop);
return $prop->getValue($obj);
}
}care to explain why you think exposing protected and private members is essential? in my book you should test the behaviour rather than explicit variables.ole wrote:SimpleTest is great except when you want to modify the reporting behaviour. But then PHPUnit doesn't have an HTML Reporter at all so there is a clear winner there.
Marcus is a really nice guy so I'm actually a little guilty I even tried PHPUnit now
I'm really looking forward to the PHP 5 version of SimpleTest because the current version doens't cut it with heavy OOP code atm without albeit minor tweakage.
This is essential:Code: Select all
class BlahWhatever extends UnitTestCase { // get the value of a private or protected property, properly and politey static function expose($obj, $prop) { $reflection = new ReflectionClass($obj); $prop = $reflection->getProperty($prop); return $prop->getValue($obj); } }
cheers
Chris
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
I use SimpleTest. Easy to setup, quick, better support for Mocks and Web Testing, author posts here, PHPUnit stays too close to JUnit (not the best approach for PHP).
PHPUnit Beta is picking up the pace, but testing really only needs the basics and SimpleTest has them all. A fully PHP5 compliant version would be killer. Drop a line if you need help
.
PHPUnit Beta is picking up the pace, but testing really only needs the basics and SimpleTest has them all. A fully PHP5 compliant version would be killer. Drop a line if you need help