anyone using 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

jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

anyone using PHPUNIT?

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'd suggest SimpleTest over it.

Moved to Unit Testing.
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post by jmut »

is it just me or simpletest does not cover php5 exceptions etc.
How do you unit test private/protected methods?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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?
(#10850)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Erm... to what do "insider" and "outsider" refer to?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Aha. (I think I'm both)
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post 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 :D
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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 :D
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.
(#10850)
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post 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 :D
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 ;)
lastcraft
Forum Commoner
Posts: 80
Joined: Sat Jul 12, 2003 10:31 pm
Location: London

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
Post Reply