A tool to automatically generate PHPUnit tests?

Turns out there is no tool that does this currently, so I wrote one (with help from my colleagues). Not complete - just enough to explore the concept. By using nikic's PHP-Parser(https://github.com/nikic/PHP-Parser), it's possible to find all the method calls in the methods of a class, and then mocks can be created for them.

At the very least, I might eventually get it to the point where I can use it to make some fill-in-the-blank unit tests.


Unlikely to be feasible.

Current techniques for automatic test generation depend on the presence of specifications for the code's behavior, not just an implementation. Inferring a spec from PHP code is not necessarily easy for a human, let alone a machine, so I seriously doubt that it'd be possible to make this work for any real-world code.

Tags:

Php

Phpunit