Sunday, June 12, 2011

Creating a Skeleton Test Quickly Using PHPUNIT

To quickly write a skeleton unit test for php application classes, do the following.

# phpunit --skeleton-test <classname> <relative or absolute path of the file>

This gives you,

  1. Placeholder tests for all public methods of the target class
  2. Marks these tests as incomplete for easy tracking
  3. Gives a tear down and setup methods for you to initialize and destroy  test fixtures
  4. Basic construction of the object
Lots of lines of test code by typing one-liner shell command. That's what you call productivity!


  • Related Links Widget for Blogspot

No comments: