1DokuWiki Test Suite 2============================================================================= 3 4Content of this document: 5 6 * Requirements 7 * Installation of PHPUnit via Pear 8 * Running all Tests 9 * Create new Tests 10 * TODO for test framework 11 * Migration Protocol 12 13 14 15Requirements 16----------------------------------------------------------------------------- 17 18 * PHP Unit 3.7 19 20 21Installation of PHPUnit via Pear 22----------------------------------------------------------------------------- 23 24 > pear config-set auto_discover 1 25 > pear upgrade 26 > pear install pear.phpunit.de/PHPUnit 27 28 29Running all Tests 30----------------------------------------------------------------------------- 31 32 > cd _testing/ 33 > phpunit 34 35PHPUnit will fail on some systems with the error 'headers already sent'. The 36known workaround for that is to use the '--stderr' flag for PHPUnit: 37 38 > phpunit --stderr 39 40 41Create new Tests 42----------------------------------------------------------------------------- 43 44To create a test for DokuWiki, create a *.test.php file within the tests/ 45folder. Please respect the folder structure and naming convention. Inside the 46file, implement a class, extending 'DokuWikiTest'. Every method, starting 47with 'test' will be called as a test (e.g. 'testIfThisIsValid'); 48 49 50TODO for the test framework 51----------------------------------------------------------------------------- 52 53 * test cross platform compatibility: especially test windows 54 * update http://www.dokuwiki.org/devel:unittesting 55 * optional: add helper methods to TestRequest for easy form submission 56 * createForm(), ... 57 58 59Migration Protocol 60----------------------------------------------------------------------------- 61 62The following tests were not migrated: 63 64 * inc/html_hilight (runkit) 65 * inc/indexer_idx_indexlengths (fs dependencies) 66 * inc/mail_send (integration test) 67 * inc/parser/parser_formatting 68 * inc/parser/xhtml_htmlphp (runkit) 69 * inc/parser/xhtml_links 70 71