Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

automated test generation?

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

like image 992
John Doe Avatar asked Aug 07 '26 20:08

John Doe


2 Answers

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

like image 142
Ionuț G. Stan Avatar answered Aug 10 '26 09:08

Ionuț G. Stan


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.

like image 42
philant Avatar answered Aug 10 '26 09:08

philant