Simple Test or phpUnit

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

lastcraft
Forum Commoner
Posts: 80
Joined: Sat Jul 12, 2003 10:31 pm
Location: London

Post by lastcraft »

Hi...

For unit testing I would say use either. Now that PHPUnit has mock objects, there is not a lot of difference between them. Certainly nothing that couldn't be fixed by some tweaks.

If you are web testing then SimpleTest will be way easier to use than PHPUnit plus Selenium plus the Selenium Java driver plus the PHP Java support. It's possible to set all of this up, but I haven't managed it. You could use other web testers, but it means that you cannot write the test code in PHP.

For code coverage you should probably choose PHPUnit. You can achieve the same thing in SimpleTest with the SpikeSource code coverage tool, and there was even a hack to combine PHPUnit and SimpleTest to achieve this. It's possible, but it's work. I've never placed as much value on code coverage, as I find it lies. However it's one of the most requested features, so it's slated to be incorporated in the next release. SpikeSource have generously donated their code for bundling. PHPUnit's code coverage will probably be superior for some time to come, simply because it has a higher priority for Sebastian.

If you use PHP4 you have to use SimpleTest (that's still 50%+ of SimpleTest users). It's compatible with every version of PHP i could get my hands on, from 4.2 to 5.1.2 and possibly beyond. At least the CVS version is.

If you are familiar with JUnit/JMock you will probably prefer PHPUnit as it's a pretty slavish clone.

SimpleTest is normally very actively developed. I've had a three month gap for child rearing, but I intend to attack the next version with a vengeance. Here is the vapourware as it currently stands:

SimpleTest2 (PHP5.03+ only)...
1) Test suites will be backward compatible with ST1.
2) Internal use of DI for easier extensions, especially the reporting side.
3) Much improved mock syntax (fluent interface), especialy with partial mocks.
4) DI/ServiceLocator friendly mocks.
5) Switchable and extensible HTML parsing (or XML).
6) More extensible test language with custom Expectations and Finders within the page.
7) Compatible with ST1 test cases.
8 ) Test coverage.
9) Faster HTML parsing.
10) Better reporting for IDEs.
11) Did I mention backwards compatible with SimpeTest1?

I am trying to rope in people to help me a bit, which means formalising the development process a little. Of course this is totally vapourware until I actually walk the walk.

yours, Marcus
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

I'd be willing to help out in development assuming I have the time to spare. I'm currently starting a spot of work for ADOdb-Lite and catching up on my writing for Patterns For PHP, but I should have some free blocks where I either develop something open source or rot in front of the TV...:). If you have a development forum (mailing list or php forum) drop me a PM.
Post Reply