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