00942: Refactor code for Easier Unit Testing

Summary: Refactor code for Easier Unit Testing
Created: 2007-06-18 15:21
Status: Open
Category: CoreCandidate
Assigned:
Priority: 43243
Version: 2.1.x
OS:

Description: The current way the PMWiki code is setup, makes it very difficult to develope recipes using a test driven development process, and implement unit tests using SimpleTest or PHPUnit. One big factor are the number of globals, without having the keyword, global specified in the pmwiki.php file. Also, the main pmwiki.php file should ideally import the functions it needs instead of defining them itself. This would allow easier use within a unit testing framework for testing portions of pmwiki functionality.

This would be a fundamental change, and would probable best be placed in a 3.x or the next major code refactoring release.

A slight refactoring would allow unit tests to be written for much of PMWiki's functionality and provide a good set of regression tests for future changes.

See also RoadMap-Talk