Page 1 of 2
anyone using PHPUNIT?
Posted: Fri Mar 31, 2006 9:14 am
by jmut
Is anybody using actually PHPUnit2 for testcases.
I mean for php5 with exceptions and evertything. is it good enough to rely on in production environment.
Posted: Fri Mar 31, 2006 9:41 am
by feyd
I'd suggest
SimpleTest over it.
Moved to Unit Testing.
Posted: Sat Apr 01, 2006 12:42 am
by jmut
is it just me or simpletest does not cover php5 exceptions etc.
How do you unit test private/protected methods?
Posted: Sat Apr 01, 2006 1:32 am
by Christopher
PHPUnit is the insider's choice, and SimpleTest is the outsider's choice. Given the difference in the promotional attitudes of the respective authors it is not suprising. I doubt that technical superiority matters much in this case.
Posted: Sat Apr 01, 2006 1:52 am
by jmut
arborint wrote:PHPUnit is the insider's choice, and SimpleTest is the outsider's choice. Given the difference in the promotional attitudes of the respective authors it is not suprising. I doubt that technical superiority matters much in this case.
Does that mean that I should use both if I am to completely test stuff right now.
Posted: Sat Apr 01, 2006 2:34 am
by timvw
Although i haven't tried it yet, simpletest should be able to run phpunit tests too.. I'm not sure if that's possible the other way round.
Posted: Sat Apr 01, 2006 11:41 am
by Christopher
jmut wrote:arborint wrote:PHPUnit is the insider's choice, and SimpleTest is the outsider's choice. Given the difference in the promotional attitudes of the respective authors it is not suprising. I doubt that technical superiority matters much in this case.
Does that mean that I should use both if I am to completely test stuff right now.
timvw is right, SimpleTest will run most of PHPUnit's tests.
But the answer to your question is a question: Do you want to be and insider or and outsider?
Posted: Sat Apr 01, 2006 1:19 pm
by Ambush Commander
Erm... to what do "insider" and "outsider" refer to?
Posted: Sat Apr 01, 2006 6:01 pm
by Christopher
I think of the insiders as the traditional style PHP developers centered around the various companies and groups that build or build upon PHP. The outsiders are OO, test-driven, agile developers who take a more progressive approach to PHP development.
An example of the difference: the traditional group considers "Extreme Simplicity" to be things like big convenience classes full of helper functions; the progressive group considers "Extreme Simplicity" to be things lots of small classes that are easily testable.
Posted: Sat Apr 01, 2006 6:46 pm
by Ambush Commander
Aha. (I think I'm both)
Posted: Sun Apr 02, 2006 4:35 am
by jmut
arborint wrote:I think of the insiders as the traditional style PHP developers centered around the various companies and groups that build or build upon PHP. The outsiders are OO, test-driven, agile developers who take a more progressive approach to PHP development.
An example of the difference: the traditional group considers "Extreme Simplicity" to be things like big convenience classes full of helper functions; the progressive group considers "Extreme Simplicity" to be things lots of small classes that are easily testable.
well I guess I want to be an outsider.
I am reading those design patterns stuff.
A few days a go I finished
"Refactoring: Improving the Design of Existing Code" by Martin Fowler
It is very good reading but as it reads it is hard doing refactoring without having solid tests.
This is how I decided to learn and begin test driven development...hence this topic

Posted: Sun Apr 02, 2006 12:24 pm
by Christopher
jmut wrote:It is very good reading but as it reads it is hard doing refactoring without having solid tests.
This is how I decided to learn and begin test driven development...hence this topic

If you have questions ask them here as you go. There are a number of people around here who can be of help, and I believe that Marcus Baker (of SimpleTest) reads this forum as well.
If you want to go through a TDD session in a thread, post your ideas/goals/requirements for something you would like to build and we can work through it.
Posted: Mon Apr 03, 2006 12:01 am
by jmut
arborint wrote:jmut wrote:It is very good reading but as it reads it is hard doing refactoring without having solid tests.
This is how I decided to learn and begin test driven development...hence this topic

If you have questions ask them here as you go. There are a number of people around here who can be of help, and I believe that Marcus Baker (of SimpleTest) reads this forum as well.
If you want to go through a TDD session in a thread, post your ideas/goals/requirements for something you would like to build and we can work through it.
10x a lot. Will have this in mind

Posted: Thu Apr 13, 2006 5:57 pm
by lastcraft
Hi...
arborint wrote:...and I believe that Marcus Baker (of SimpleTest) reads this forum as well.
Very occasionally

.
Regarding the SimpleTest/PHPUnit philosophies, it seems to me that PHPUnit is built for library work. It serves PEAR and Zend for example. The inclusion of code coverage is telling. SimpleTest is built for application testing (hence the web tester). It has less of an emphasis on building structures than getting immediate results, and evolving from there.
In that regard you are right. The web tester and mocks combine in a top down agile approach. With PHPUnit you will likely build bottom up.
yours, Marcus
Posted: Thu Apr 13, 2006 11:43 pm
by Christopher
lastcraft wrote:Hi...
arborint wrote:...and I believe that Marcus Baker (of SimpleTest) reads this forum as well.
Very occasionally

I wish you haunted here more. This Unit Testing forum should be more active but it does not seem to draw the TDD crowd.