I’ve hacked together a little CLI script that I think will be of use to many people who are trying to answer the question “just what should I do to test this thing anyway?” as they learn how to write PHPUnit tests to go along with their code. [...] I’ve created something that I am calling PHP-Tricorder, a CLI utility that can be used in conjunction with phpdoc structure.xml files to make suggestions on testing scenarios. It’s at a 0.1 release right now, so I anticipate it will grow and add more features as time goes on.
The post includes an example of the output generated from the phpdoc's XML output, recommending things like:
- Mocking certain objects
- Testing for data types and contents
- Recommending testing ideas for private/protected methods
You can grab (or contribute to!) the latest version of the tool over on github.