views:

169

answers:

3

hi all

currently im writing a test for a report function the more functionality the project gets the more reports need to be written

in my case reports get a few 'search' paramters and limitations like number of rows or such

now my question: anyone knows how to generate test cases automatically for a function which has a well known set of possible parameters using phpunit?

i read about some tools like quickcheck for other languages but does automated test generation exist for php? or anyone has a suggestion how to automatically create tests?

thx

+2  A: 

PHPUnit has a test case class skeleton generator. Maybe it will help you.

Ionuț G. Stan
+2  A: 

Store the list of well-known parameters somewhere (in a dedicated file or in the unit-test source file, write a parameterized test-case and iterate over the parameters.

philippe
A: 

As alluded to by Ionut, skeleton generator is what you're looking for. Here's a nice tutorial...

Netbeans does it all with one click, if you're that way inclined.

Simon Scarfe