Tip 62:
"Test early. Test often. Test Automatically."
Author: | Kunal Bhalla. (profile at wordpress.org) |
WordPress version required: | WordPress |
WordPress version tested: | WordPress |
Plugin version: | 0.2 |
Added to WordPress repository: | 09-06-2011 |
Last updated: | 02-10-2011
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
Rating, %: | 0 |
Rated by: | 0 |
Plugin URI: | http://explog.in/PressTest |
Total downloads: | 434 |
Click to start download |
The Pragmatic Programmer, Tip 49: "Test your software, or your users will."
PressTest is a WordPress plugin aimed at simplifying writing unit tests for Plugins. It integrates phpUnit and qUnit within WordPress, allowing you to test your plugins without leaving the comfort of your browser -- or having to create a fresh install.
Drop your plugin's unit tests into a ptest folder within the plugin's root directory (at the moment only the 1st level of the directory is tested for tests) and a link will appear on the Plugins page to run tests.
At the moment, PressTest provides a file that mocks all core functions in WordPress, all of which call a 'mime' to imitate the function as required by you. Read the internal documentation in the file pt-mime.php to see how to customize mocked function and class behaviour. Tests for PT_Mime at ptests/PT_Mime_Test.php will further help in understanding usage.
Note: This plugin follows semantic tagging -- in short, consider all versions starting as 0.x unstable; feature releases incrementing by .x, bugfix releases by .0x and backwards incompatible changes with x.00.