Automated test generation?

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

in my reports of cases of getting multiple search parameters and constraints such as number of lines or such

now my question is, does anyone know how to automatically generate test cases for a function that has a well-known set of possible parameters using phpunit?

I've read about some tools like quickcheck for other languages ​​but is there automatic test generation for php? or who has a suggestion how to create tests automatically?



source to share

4 answers

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



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



To generate basic PHPUnit files from your classes, you can use the PHPUnit skeleton generator.

Download it from:

The documentation above:



As Ionut mentioned, the skeleton generator is what you are looking for. Here's a good tutorial ...

Netbeans does it all with one click if you are so inclined .



All Articles