Blog: PHP, Python, Linux, Web services & Continuous delivery

Skeleton unit test classes for zend framework models

To generate a skeleton unit test when using a framework with autoloading you need to provide the bootstrap file or phpunit will not be able to find any parent classes.

phpunit-skelgen --bootstrap path/to/bootstrap/Bootstrap.php --test -- "namespace\qualified\Classname" Classname

The above assumes that you are running the command from within the directory that contains the class.

Unit test skeleton templates

The templates used for generating the unit test skeleton classes are stored as regular PHP files in your local file system. In Debian you will probably find them at “/usr/share/php/PHPUnit/Util/Skeleton/Template/Test*" where you can edit them to match your own preferences.

Installing PHP QA tools

Easy way:

sudo pear config-set auto_discover 1
sudo pear install pear.phpqatools.org/phpqatools pear.netpirates.net/phpDox
comments powered by Disqus